@@ -198,7 +198,7 @@ def residual_map_with_mask_from(
198198 model_data
199199 The model data used to fit the data.
200200 """
201- return xp .where (xp . asarray ( mask ) == 0 , xp .subtract (data , model_data ), 0 )
201+ return xp .where (mask == 0 , xp .subtract (data , model_data ), 0 )
202202
203203
204204@to_new_array
@@ -221,7 +221,7 @@ def normalized_residual_map_with_mask_from(
221221 mask
222222 The mask applied to the residual-map, where `False` entries are included in the calculation.
223223 """
224- return xp .where (xp . asarray ( mask ) == 0 , xp .divide (residual_map , noise_map ), 0 )
224+ return xp .where (mask == 0 , xp .divide (residual_map , noise_map ), 0 )
225225
226226
227227@to_new_array
@@ -244,7 +244,7 @@ def chi_squared_map_with_mask_from(
244244 mask
245245 The mask applied to the residual-map, where `False` entries are included in the calculation.
246246 """
247- return xp .where (xp . asarray ( mask ) == 0 , xp .square (residual_map / noise_map ), 0 )
247+ return xp .where (mask == 0 , xp .square (residual_map / noise_map ), 0 )
248248
249249
250250def chi_squared_with_mask_from (
@@ -263,7 +263,7 @@ def chi_squared_with_mask_from(
263263 mask
264264 The mask applied to the chi-squared-map, where `False` entries are included in the calculation.
265265 """
266- return float (xp .sum (chi_squared_map [xp . asarray ( mask ) == 0 ]))
266+ return float (xp .sum (chi_squared_map [mask == 0 ]))
267267
268268
269269def chi_squared_with_mask_fast_from (
@@ -301,8 +301,8 @@ def chi_squared_with_mask_fast_from(
301301 xp .subtract (
302302 data ,
303303 model_data ,
304- )[xp . asarray ( mask ) == 0 ],
305- noise_map [xp . asarray ( mask ) == 0 ],
304+ )[mask == 0 ],
305+ noise_map [mask == 0 ],
306306 )
307307 )
308308 )
@@ -326,7 +326,7 @@ def noise_normalization_with_mask_from(
326326 mask
327327 The mask applied to the noise-map, where `False` entries are included in the calculation.
328328 """
329- return float (xp .sum (xp .log (2 * xp .pi * noise_map [xp . asarray ( mask ) == 0 ] ** 2.0 )))
329+ return float (xp .sum (xp .log (2 * xp .pi * noise_map [mask == 0 ] ** 2.0 )))
330330
331331
332332def chi_squared_with_noise_covariance_from (
0 commit comments