def test_threshold_boundingzero_above(self):
"""Test fuzzy threshold of zero where data are above upper-bound."""
bounds = (-0.1, 0.1)
plugin = Threshold(0.0, fuzzy_bounds=bounds)
result = plugin.process(self.cube)
expected_result_array = np.full_like(
self.cube.data, fill_value=0.5).reshape(1, 1, 5, 5)
expected_result_array[0][0][2][2] = 1.
self.assertArrayAlmostEqual(result.data, expected_result_array)
评论列表
文章目录