Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autoarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from .mask.derive.mask_2d import DeriveMask2D
from .mask.derive.grid_1d import DeriveGrid1D
from .mask.derive.grid_2d import DeriveGrid2D
from .mask.derive.zoom_2d import Zoom2D
from .mask.mask_1d import Mask1D
from .mask.mask_2d import Mask2D
from .operators.convolver import Convolver
Expand Down
1 change: 0 additions & 1 deletion autoarray/config/visualize/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ general:
log10_min_value: 1.0e-4 # If negative values are being plotted on a log10 scale, values below this value are rounded up to it (e.g. to remove negative values).
log10_max_value: 1.0e99 # If positive values are being plotted on a log10 scale, values above this value are rounded down to it (e.g. to prevent white blobs).
zoom_around_mask: true # If True, plots of data structures with a mask automatically zoom in the masked region.
disable_zoom_for_fits: true # If True, the zoom-in around the masked region is disabled when outputting .fits files, which is useful to retain the same dimensions as the input data.
inversion:
reconstruction_vmax_factor: 0.5
total_mappings_pixels : 8 # The number of source pixels used when plotting the subplot_mappings of a pixelization.
Expand Down
3 changes: 3 additions & 0 deletions autoarray/config/visualize/plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# For example, if `plots: fit: subplot_fit=True``, the ``fit_dataset.png`` subplot file will
# be plotted every time visualization is performed.

subplot_format: [png] # Output format of all subplots, can be png, pdf or both (e.g. [png, pdf])
fits_are_zoomed: true # If true, output .fits files are zoomed in on the center of the unmasked region image, saving hard-disk space.

dataset: # Settings for plots of all datasets (e.g. ImagingPlotter, InterferometerPlotter).
subplot_dataset: true # Plot subplot containing all dataset quantities (e.g. the data, noise-map, etc.)?
imaging: # Settings for plots of imaging datasets (e.g. ImagingPlotter)
Expand Down
4 changes: 2 additions & 2 deletions autoarray/geometry/geometry_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def convert_pixel_scales_2d(pixel_scales: ty.PixelScales) -> Tuple[float, float]

@numba_util.jit()
def central_pixel_coordinates_2d_from(
shape_native: Tuple[int, int]
shape_native: Tuple[int, int],
) -> Tuple[float, float]:
"""
Returns the central pixel coordinates of a 2D geometry (and therefore a 2D data structure like an ``Array2D``)
Expand Down Expand Up @@ -737,7 +737,7 @@ def grid_pixel_centres_2d_from(


def extent_symmetric_from(
extent: Tuple[float, float, float, float]
extent: Tuple[float, float, float, float],
) -> Tuple[float, float, float, float]:
"""
Given an input extent of the form (x_min, x_max, y_min, y_max), this function returns an extent which is
Expand Down
12 changes: 6 additions & 6 deletions autoarray/inversion/inversion/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,12 @@ def reconstruction(self) -> np.ndarray:

solutions = np.zeros(np.shape(self.curvature_reg_matrix)[0])

solutions[
values_to_solve
] = inversion_util.reconstruction_positive_only_from(
data_vector=data_vector_input,
curvature_reg_matrix=curvature_reg_matrix_input,
settings=self.settings,
solutions[values_to_solve] = (
inversion_util.reconstruction_positive_only_from(
data_vector=data_vector_input,
curvature_reg_matrix=curvature_reg_matrix_input,
settings=self.settings,
)
)
return solutions
else:
Expand Down
16 changes: 9 additions & 7 deletions autoarray/inversion/inversion/imaging/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def operated_mapping_matrix_list(self) -> List[np.ndarray]:
"""

return [
self.convolver.convolve_mapping_matrix(
mapping_matrix=linear_obj.mapping_matrix
(
self.convolver.convolve_mapping_matrix(
mapping_matrix=linear_obj.mapping_matrix
)
if linear_obj.operated_mapping_matrix_override is None
else self.linear_func_operated_mapping_matrix_dict[linear_obj]
)
if linear_obj.operated_mapping_matrix_override is None
else self.linear_func_operated_mapping_matrix_dict[linear_obj]
for linear_obj in self.linear_obj_list
]

Expand Down Expand Up @@ -156,9 +158,9 @@ def linear_func_operated_mapping_matrix_dict(self) -> Dict:
mapping_matrix=linear_func.mapping_matrix
)

linear_func_operated_mapping_matrix_dict[
linear_func
] = operated_mapping_matrix
linear_func_operated_mapping_matrix_dict[linear_func] = (
operated_mapping_matrix
)

return linear_func_operated_mapping_matrix_dict

Expand Down
12 changes: 6 additions & 6 deletions autoarray/inversion/pixelization/border_relocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ def sub_border_pixel_slim_indexes_from(
int(border_pixel)
]

sub_border_pixels[
border_1d_index
] = grid_2d_util.furthest_grid_2d_slim_index_from(
grid_2d_slim=sub_grid_2d_slim,
slim_indexes=sub_border_pixels_of_border_pixel,
coordinate=mask_centre,
sub_border_pixels[border_1d_index] = (
grid_2d_util.furthest_grid_2d_slim_index_from(
grid_2d_slim=sub_grid_2d_slim,
slim_indexes=sub_border_pixels_of_border_pixel,
coordinate=mask_centre,
)
)

return sub_border_pixels
Expand Down
2 changes: 1 addition & 1 deletion autoarray/inversion/pixelization/mesh/mesh_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@numba_util.jit()
def rectangular_neighbors_from(
shape_native: Tuple[int, int]
shape_native: Tuple[int, int],
) -> Tuple[np.ndarray, np.ndarray]:
"""
Returns the 4 (or less) adjacent neighbors of every pixel on a rectangular pixelization as an ndarray of shape
Expand Down
7 changes: 3 additions & 4 deletions autoarray/inversion/plot/inversion_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,9 @@ def figures_2d_of_pixelization(
"inversion"
]["reconstruction_vmax_factor"]

self.mat_plot_2d.cmap.kwargs[
"vmax"
] = reconstruction_vmax_factor * np.max(
self.inversion.reconstruction
self.mat_plot_2d.cmap.kwargs["vmax"] = (
reconstruction_vmax_factor
* np.max(self.inversion.reconstruction)
)
vmax_custom = True

Expand Down
Loading
Loading