def test_threshold_boundingbelowzero(self):
"""Test fuzzy threshold of below-zero."""
bounds = (-1.0, 1.0)
plugin = Threshold(0.0, fuzzy_bounds=bounds, below_thresh_ok=True)
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] = 0.25
self.assertArrayAlmostEqual(result.data, expected_result_array)
评论列表
文章目录