@@ -34,25 +34,13 @@ def test_remove_stripe_ti_on_data(data, flats, darks):
3434 assert data_after_stripe_removal .dtype == np .float32
3535
3636
37- # def test_remove_stripe_ti_on_flats(host_flats):
38- # #: testing that numpy uint16 arrays can be passed
39- # corrected_data = remove_stripe_ti(np.copy(host_flats))
40- # assert_allclose(np.mean(corrected_data), 976.558447, rtol=1e-7)
41- # assert_allclose(np.mean(corrected_data, axis=(1, 2)).sum(), 19531.168945, rtol=1e-7)
42- # assert_allclose(np.median(corrected_data), 976.0, rtol=1e-7)
43-
44-
45- # def test_remove_stripe_ti_numpy_vs_cupy_on_random_data():
46- # host_data = np.random.random_sample(size=(181, 5, 256)).astype(np.float32) * 2.0
47- # corrected_host_data = remove_stripe_ti(np.copy(host_data))
48- # corrected_data = remove_stripe_ti(
49- # cp.copy(cp.asarray(host_data, dtype=cp.float32))
50- # ).get()
51-
52- # assert_allclose(np.sum(corrected_data), np.sum(corrected_host_data), rtol=1e-6)
53- # assert_allclose(
54- # np.median(corrected_data), np.median(corrected_host_data), rtol=1e-6
55- # )
37+ @pytest .mark .parametrize ("angles" , [180 , 181 ])
38+ @pytest .mark .parametrize ("det_x" , [11 , 18 ])
39+ @pytest .mark .parametrize ("det_y" , [5 , 7 ])
40+ def test_remove_stripe_ti_dims_change (angles , det_y , det_x ):
41+ data = cp .random .random_sample (size = (angles , det_y , det_x )).astype (cp .float32 ) * 2.0
42+ corrected_data = remove_stripe_ti (data .copy ())
43+ assert corrected_data .shape == (angles , det_y , det_x )
5644
5745
5846def test_stripe_removal_sorting_cupy (data , flats , darks ):
0 commit comments