@@ -85,16 +85,16 @@ def test_combiner_create():
8585 ccd_data = ccd_data_func ()
8686 ccd_list = [ccd_data , ccd_data , ccd_data ]
8787 c = Combiner (ccd_list )
88- assert c .data_arr .shape == (3 , 100 , 100 )
89- assert c .data_arr_mask .shape == (3 , 100 , 100 )
88+ assert c ._data_arr .shape == (3 , 100 , 100 )
89+ assert c ._data_arr_mask .shape == (3 , 100 , 100 )
9090
9191
9292# test if dtype matches the value that is passed
9393def test_combiner_dtype ():
9494 ccd_data = ccd_data_func ()
9595 ccd_list = [ccd_data , ccd_data , ccd_data ]
9696 c = Combiner (ccd_list , dtype = xp .float32 )
97- assert c .data_arr .dtype == xp .float32
97+ assert c ._data_arr .dtype == xp .float32
9898 avg = c .average_combine ()
9999 # dtype of average should match input dtype
100100 assert avg .dtype == c .dtype
@@ -114,9 +114,9 @@ def test_combiner_mask():
114114 ccd = CCDData (data , unit = u .adu , mask = mask )
115115 ccd_list = [ccd , ccd , ccd ]
116116 c = Combiner (ccd_list )
117- assert c .data_arr .shape == (3 , 10 , 10 )
118- assert c .data_arr_mask .shape == (3 , 10 , 10 )
119- assert not c .data_arr_mask [0 , 5 , 5 ]
117+ assert c ._data_arr .shape == (3 , 10 , 10 )
118+ assert c ._data_arr_mask .shape == (3 , 10 , 10 )
119+ assert not c ._data_arr_mask [0 , 5 , 5 ]
120120
121121
122122def test_weights ():
@@ -158,7 +158,7 @@ def test_pixelwise_weights():
158158 CCDData (xp .zeros ((10 , 10 )) + 1000 , unit = u .adu ),
159159 ]
160160 combo = Combiner (ccd_list )
161- combo .weights = xp .ones_like (combo .data_arr )
161+ combo .weights = xp .ones_like (combo ._data_arr )
162162 combo .weights = xpx .at (combo .weights )[:, 5 , 5 ].set (xp .array ([1 , 5 , 10 ]))
163163 ccd = combo .average_combine ()
164164 np_testing .assert_allclose (ccd .data [5 , 5 ], 312.5 )
@@ -188,7 +188,7 @@ def test_combiner_minmax_max():
188188
189189 c = Combiner (ccd_list )
190190 c .minmax_clipping (min_clip = None , max_clip = 500 )
191- assert c .data_arr_mask [2 ].all ()
191+ assert c ._data_arr_mask [2 ].all ()
192192
193193
194194def test_combiner_minmax_min ():
@@ -200,7 +200,7 @@ def test_combiner_minmax_min():
200200
201201 c = Combiner (ccd_list )
202202 c .minmax_clipping (min_clip = - 500 , max_clip = None )
203- assert c .data_arr_mask [1 ].all ()
203+ assert c ._data_arr_mask [1 ].all ()
204204
205205
206206def test_combiner_sigmaclip_high ():
@@ -216,7 +216,7 @@ def test_combiner_sigmaclip_high():
216216 c = Combiner (ccd_list )
217217 # using mad for more robust statistics vs. std
218218 c .sigma_clipping (high_thresh = 3 , low_thresh = None , func = "median" , dev_func = mad )
219- assert c .data_arr_mask [5 ].all ()
219+ assert c ._data_arr_mask [5 ].all ()
220220
221221
222222def test_combiner_sigmaclip_single_pix ():
@@ -231,13 +231,13 @@ def test_combiner_sigmaclip_single_pix():
231231 combo = Combiner (ccd_list )
232232 # add a single pixel in another array to check that
233233 # that one gets rejected
234- combo .data_arr = xpx .at (combo .data_arr )[0 , 5 , 5 ].set (0 )
235- combo .data_arr = xpx .at (combo .data_arr )[1 , 5 , 5 ].set (- 5 )
236- combo .data_arr = xpx .at (combo .data_arr )[2 , 5 , 5 ].set (5 )
237- combo .data_arr = xpx .at (combo .data_arr )[3 , 5 , 5 ].set (- 5 )
238- combo .data_arr = xpx .at (combo .data_arr )[4 , 5 , 5 ].set (25 )
234+ combo ._data_arr = xpx .at (combo ._data_arr )[0 , 5 , 5 ].set (0 )
235+ combo ._data_arr = xpx .at (combo ._data_arr )[1 , 5 , 5 ].set (- 5 )
236+ combo ._data_arr = xpx .at (combo ._data_arr )[2 , 5 , 5 ].set (5 )
237+ combo ._data_arr = xpx .at (combo ._data_arr )[3 , 5 , 5 ].set (- 5 )
238+ combo ._data_arr = xpx .at (combo ._data_arr )[4 , 5 , 5 ].set (25 )
239239 combo .sigma_clipping (high_thresh = 3 , low_thresh = None , func = "median" , dev_func = mad )
240- assert combo .data_arr_mask [4 , 5 , 5 ]
240+ assert combo ._data_arr_mask [4 , 5 , 5 ]
241241
242242
243243def test_combiner_sigmaclip_low ():
@@ -253,7 +253,7 @@ def test_combiner_sigmaclip_low():
253253 c = Combiner (ccd_list )
254254 # using mad for more robust statistics vs. std
255255 c .sigma_clipping (high_thresh = None , low_thresh = 3 , func = "median" , dev_func = mad )
256- assert c .data_arr_mask [5 ].all ()
256+ assert c ._data_arr_mask [5 ].all ()
257257
258258
259259# test that the median combination works and returns a ccddata object
@@ -377,7 +377,7 @@ def test_combiner_with_scaling():
377377 np_testing .assert_allclose (np_median (med_ccd ), np_median (med_inp_data ))
378378
379379 # Set the scaling manually...
380- combiner .scaling = [scale_by_mean (combiner .data_arr [i ]) for i in range (3 )]
380+ combiner .scaling = [scale_by_mean (combiner ._data_arr [i ]) for i in range (3 )]
381381 avg_ccd = combiner .average_combine ()
382382 np_testing .assert_allclose (avg_ccd .data .mean (), ccd_data .data .mean ())
383383 assert avg_ccd .shape == ccd_data .shape
@@ -586,7 +586,7 @@ def test_average_combine_uncertainty():
586586 ccd_list = [ccd_data , ccd_data , ccd_data ]
587587 c = Combiner (ccd_list )
588588 ccd = c .average_combine (uncertainty_func = xp .sum )
589- uncert_ref = xp .sum (c .data_arr , 0 ) / xp .sqrt (3 )
589+ uncert_ref = xp .sum (c ._data_arr , 0 ) / xp .sqrt (3 )
590590 np_testing .assert_allclose (ccd .uncertainty .array , uncert_ref )
591591
592592 # Compare this also to the "combine" call
@@ -601,7 +601,7 @@ def test_median_combine_uncertainty():
601601 ccd_list = [ccd_data , ccd_data , ccd_data ]
602602 c = Combiner (ccd_list )
603603 ccd = c .median_combine (uncertainty_func = xp .sum )
604- uncert_ref = xp .sum (c .data_arr , 0 ) / xp .sqrt (3 )
604+ uncert_ref = xp .sum (c ._data_arr , 0 ) / xp .sqrt (3 )
605605 np_testing .assert_allclose (ccd .uncertainty .array , uncert_ref )
606606
607607 # Compare this also to the "combine" call
@@ -616,7 +616,7 @@ def test_sum_combine_uncertainty():
616616 ccd_list = [ccd_data , ccd_data , ccd_data ]
617617 c = Combiner (ccd_list )
618618 ccd = c .sum_combine (uncertainty_func = xp .sum )
619- uncert_ref = xp .sum (c .data_arr , 0 ) * xp .sqrt (3 )
619+ uncert_ref = xp .sum (c ._data_arr , 0 ) * xp .sqrt (3 )
620620 np_testing .assert_allclose (ccd .uncertainty .array , uncert_ref )
621621
622622 # Compare this also to the "combine" call
@@ -798,8 +798,8 @@ def test_combiner_3d():
798798 ccd_list = [data1 , data2 , data3 ]
799799
800800 c = Combiner (ccd_list )
801- assert c .data_arr .shape == (3 , 5 , 5 , 5 )
802- assert c .data_arr_mask .shape == (3 , 5 , 5 , 5 )
801+ assert c ._data_arr .shape == (3 , 5 , 5 , 5 )
802+ assert c ._data_arr_mask .shape == (3 , 5 , 5 , 5 )
803803
804804 ccd = c .average_combine ()
805805 assert ccd .shape == (5 , 5 , 5 )
@@ -836,7 +836,7 @@ def test_3d_combiner_with_scaling():
836836 np_testing .assert_allclose (np_median (med_ccd ), np_median (med_inp_data ))
837837
838838 # Set the scaling manually...
839- combiner .scaling = [scale_by_mean (combiner .data_arr [i ]) for i in range (3 )]
839+ combiner .scaling = [scale_by_mean (combiner ._data_arr [i ]) for i in range (3 )]
840840 avg_ccd = combiner .average_combine ()
841841 np_testing .assert_allclose (avg_ccd .data .mean (), ccd_data .data .mean ())
842842 assert avg_ccd .shape == ccd_data .shape
@@ -935,9 +935,9 @@ def test_clip_extrema_with_other_rejection():
935935 ccdlist [1 ].data = xpx .at (ccdlist [1 ].data )[2 , 0 ].set (100.1 )
936936 c = Combiner (ccdlist )
937937 # Reject ccdlist[1].data[1,2] by other means
938- c .data_arr_mask = xpx .at (c .data_arr_mask )[1 , 1 , 2 ].set (True )
938+ c ._data_arr_mask = xpx .at (c ._data_arr_mask )[1 , 1 , 2 ].set (True )
939939 # Reject ccdlist[1].data[1,2] by other means
940- c .data_arr_mask = xpx .at (c .data_arr_mask )[3 , 0 , 0 ].set (True )
940+ c ._data_arr_mask = xpx .at (c ._data_arr_mask )[3 , 0 , 0 ].set (True )
941941
942942 c .clip_extrema (nlow = 1 , nhigh = 1 )
943943 result = c .average_combine ()
@@ -979,8 +979,8 @@ def create_gen():
979979 yield ccd_data
980980
981981 c = Combiner (create_gen ())
982- assert c .data_arr .shape == (3 , 100 , 100 )
983- assert c .data_arr_mask .shape == (3 , 100 , 100 )
982+ assert c ._data_arr .shape == (3 , 100 , 100 )
983+ assert c ._data_arr_mask .shape == (3 , 100 , 100 )
984984
985985
986986@pytest .mark .parametrize (
@@ -1057,7 +1057,7 @@ def sum_func(_, axis=axis):
10571057 return xp .sum (new_data , axis = axis )
10581058
10591059 expected_result = 3 * data
1060- actual_result = c .sum_combine (sum_func = my_summer (c .data_arr , c .data_arr_mask ))
1060+ actual_result = c .sum_combine (sum_func = my_summer (c ._data_arr , c ._data_arr_mask ))
10611061 elif comb_func == "average_combine" :
10621062 expected_result = data
10631063 actual_result = c .average_combine (scale_func = xp .mean )
0 commit comments