Skip to content

Commit 57e0a75

Browse files
Jammy2211Jammy2211
authored andcommitted
builds fixes
1 parent 861aeaf commit 57e0a75

4 files changed

Lines changed: 27 additions & 14 deletions

File tree

autoarray/dataset/plot/imaging_plotters.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,16 @@ def figures_2d(
9292
)
9393

9494
if psf:
95-
self.mat_plot_2d.plot_array(
96-
array=self.dataset.psf.kernel,
97-
visuals_2d=self.visuals_2d,
98-
auto_labels=AutoLabels(
99-
title=title_str or f"Point Spread Function",
100-
filename="psf",
101-
cb_unit="",
102-
),
103-
)
95+
if self.dataset.psf is not None:
96+
self.mat_plot_2d.plot_array(
97+
array=self.dataset.psf.kernel,
98+
visuals_2d=self.visuals_2d,
99+
auto_labels=AutoLabels(
100+
title=title_str or f"Point Spread Function",
101+
filename="psf",
102+
cb_unit="",
103+
),
104+
)
104105

105106
if signal_to_noise_map:
106107
self.mat_plot_2d.plot_array(

autoarray/inversion/mesh/interpolator/rectangular.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def _mappings_sizes_weights(self):
296296
adaptive_rectangular_mappings_weights_via_interpolation_from(
297297
source_grid_size=self.mesh.shape[0],
298298
data_grid=self.data_grid.array,
299-
data_grid_over_sampled=self.data_grid.over_sampled,
299+
data_grid_over_sampled=self.data_grid.over_sampled.array,
300300
mesh_weight_map=self.mesh_weight_map,
301301
xp=self._xp,
302302
)

autoarray/inversion/plot/inversion_plotters.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ def figures_2d_of_pixelization(
175175
mapper_plotter.mapper
176176
]
177177

178+
from autoarray.structures.visibilities import Visibilities
179+
180+
if isinstance(array, Visibilities):
181+
array = self.inversion.mapped_reconstructed_data_dict[
182+
mapper_plotter.mapper
183+
]
184+
178185
self.mat_plot_2d.plot_array(
179186
array=array,
180187
visuals_2d=self.visuals_2d,

autoarray/mask/mask_2d_util.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,10 @@ def min_false_distance_to_edge(mask: np.ndarray) -> Tuple[int, int]:
460460
# Return the minimum distance to both edges
461461
return min(top_dist, bottom_dist), min(left_dist, right_dist)
462462

463-
def blurring_mask_2d_from(mask_2d: np.ndarray, kernel_shape_native: Tuple[int, int]) -> np.ndarray:
463+
464+
def blurring_mask_2d_from(
465+
mask_2d: np.ndarray, kernel_shape_native: Tuple[int, int]
466+
) -> np.ndarray:
464467
"""
465468
Return the blurring mask for a 2D mask and kernel footprint.
466469
@@ -474,7 +477,9 @@ def blurring_mask_2d_from(mask_2d: np.ndarray, kernel_shape_native: Tuple[int, i
474477

475478
ky, kx = kernel_shape_native
476479
if ky <= 0 or kx <= 0:
477-
raise ValueError(f"kernel_shape_native must be positive, got {kernel_shape_native}.")
480+
raise ValueError(
481+
f"kernel_shape_native must be positive, got {kernel_shape_native}."
482+
)
478483

479484
# Keep your existing guard (optional)
480485
y_distance, x_distance = min_false_distance_to_edge(mask_2d)
@@ -510,8 +515,8 @@ def blurring_mask_2d_from(mask_2d: np.ndarray, kernel_shape_native: Tuple[int, i
510515
blurring_region = mask_2d & near_unmasked # True on the ring (in region-space)
511516

512517
# Convert region -> mask semantics: ring should be unmasked (False)
513-
blurring_mask = np.ones_like(mask_2d, dtype=bool) # start fully masked
514-
blurring_mask[blurring_region] = False # unmask the ring
518+
blurring_mask = np.ones_like(mask_2d, dtype=bool) # start fully masked
519+
blurring_mask[blurring_region] = False # unmask the ring
515520

516521
return blurring_mask
517522

0 commit comments

Comments
 (0)