@@ -166,13 +166,15 @@ def sub_size_radial_bins_from(
166166
167167 return sub_size_list [bin_indices ]
168168
169+
169170from autoarray .geometry import geometry_util
170171
172+
171173def grid_2d_slim_over_sampled_via_mask_from (
172- mask_2d : np .ndarray ,
173- pixel_scales : ty .PixelScales ,
174- sub_size : np .ndarray ,
175- origin : Tuple [float , float ] = (0.0 , 0.0 ),
174+ mask_2d : np .ndarray ,
175+ pixel_scales : ty .PixelScales ,
176+ sub_size : np .ndarray ,
177+ origin : Tuple [float , float ] = (0.0 , 0.0 ),
176178) -> np .ndarray :
177179 """
178180 For a sub-grid, every unmasked pixel of its 2D mask with shape (total_y_pixels, total_x_pixels) is divided into
@@ -216,11 +218,9 @@ def grid_2d_slim_over_sampled_via_mask_from(
216218 pixels_in_mask = (np .size (mask_2d ) - np .sum (mask_2d )).astype (int )
217219
218220 if isinstance (sub_size , int ):
219- sub_size = np .full (
220- fill_value = sub_size , shape = pixels_in_mask
221- )
221+ sub_size = np .full (fill_value = sub_size , shape = pixels_in_mask )
222222
223- total_sub_pixels = np .sum (sub_size ** 2 )
223+ total_sub_pixels = np .sum (sub_size ** 2 )
224224
225225 grid_slim = np .zeros (shape = (total_sub_pixels , 2 ))
226226
@@ -248,10 +248,10 @@ def grid_2d_slim_over_sampled_via_mask_from(
248248 for y1 in range (sub ):
249249 for x1 in range (sub ):
250250 grid_slim [sub_index , 0 ] = - (
251- y_scaled - y_sub_half + y1 * y_sub_step + (y_sub_step / 2.0 )
251+ y_scaled - y_sub_half + y1 * y_sub_step + (y_sub_step / 2.0 )
252252 )
253253 grid_slim [sub_index , 1 ] = (
254- x_scaled - x_sub_half + x1 * x_sub_step + (x_sub_step / 2.0 )
254+ x_scaled - x_sub_half + x1 * x_sub_step + (x_sub_step / 2.0 )
255255 )
256256 sub_index += 1
257257
0 commit comments