Skip to content

Commit 2f55a41

Browse files
Jammy2211Jammy2211
authored andcommitted
delete more methods
1 parent 898703b commit 2f55a41

9 files changed

Lines changed: 6 additions & 116 deletions

File tree

autoarray/inversion/inversion/mapper_valued.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,6 @@ def __init__(self, mapper, values, mesh_pixel_mask: Optional[np.ndarray] = None)
3939
self.values = values
4040
self.mesh_pixel_mask = mesh_pixel_mask
4141

42-
@property
43-
def values_masked(self):
44-
"""
45-
Applies the `mesh_pixel_mask` to the values, setting all masked pixels to 0.0, so that mesh pixels
46-
can be removed to prevent them from impacting calculations.
47-
48-
For example, the magnification calculation uses the values of the reconstruction to compute the magnification,
49-
but this can be impacted by pixels with low signal-to-noise. The `mesh_pixel_mask` can be used to remove
50-
these pixels from the calculation.
51-
52-
Returns
53-
-------
54-
The values of the mapper with the `mesh_pixel_mask` applied.
55-
"""
56-
57-
values = self.values
58-
59-
if self.mesh_pixel_mask is not None:
60-
if self.mapper._xp.__name__.startswith("jax"):
61-
values = values.at[self.mesh_pixel_mask].set(0.0)
62-
else:
63-
values = values.copy()
64-
values[self.mesh_pixel_mask] = 0.0
65-
66-
return values
67-
6842
def max_pixel_list_from(
6943
self, total_pixels: int = 1, filter_neighbors: bool = False
7044
) -> List[List[int]]:
@@ -136,37 +110,3 @@ def max_pixel_centre(self) -> Grid2DIrregular:
136110
)
137111

138112
return max_pixel_centre
139-
140-
def mapped_reconstructed_image_from(
141-
self,
142-
) -> Array2D:
143-
"""
144-
Returns the image of the reconstruction computed via the mapping matrix, where the image is the reconstruction
145-
of the source-plane image in the image-plane without accounting for the PSF convolution.
146-
147-
This image is computed by mapping the reconstruction to the image, using the mapping matrix of the inversion.
148-
149-
The image is used to compute magnification, where the magnification is the ratio of the surface brightness of
150-
image in the image-plane over the surface brightness of the source in the source-plane.
151-
152-
Returns
153-
-------
154-
The image of the reconstruction computed via the mapping matrix, with the PSF convolution not accounted for.
155-
"""
156-
157-
mapping_matrix = self.mapper.mapping_matrix
158-
159-
if self.mesh_pixel_mask is not None:
160-
if self.mapper._xp.__name__.startswith("jax"):
161-
mapping_matrix = mapping_matrix.at[:, self.mesh_pixel_mask].set(0.0)
162-
else:
163-
mapping_matrix[:, self.mesh_pixel_mask] = 0.0
164-
165-
return Array2D(
166-
values=inversion_util.mapped_reconstructed_data_via_mapping_matrix_from(
167-
mapping_matrix=mapping_matrix,
168-
reconstruction=self.values_masked,
169-
xp=self.mapper._xp,
170-
),
171-
mask=self.mapper.mapper_grids.mask,
172-
)

autoarray/inversion/pixelization/mappers/abstract.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def extent_from(
410410
extent=self.source_plane_mesh_grid.geometry.extent
411411
)
412412

413+
413414
class PixSubWeights:
414415
def __init__(self, mappings: np.ndarray, sizes: np.ndarray, weights: np.ndarray):
415416
"""

autoarray/inversion/pixelization/mappers/mapper_numba_util.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import numpy as np
22
from typing import Tuple
33

4-
from autoconf import conf
5-
64
from autoarray import numba_util
7-
from autoarray.inversion.pixelization.mesh import mesh_numba_util
8-
9-
from autoarray import exc
105

116

127
@numba_util.jit()

autoarray/inversion/pixelization/mesh/mesh_numba_util.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

autoarray/inversion/plot/mapper_plotters.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ def __init__(
4646

4747
self.mapper = mapper
4848

49-
def figure_2d(
50-
self, solution_vector: bool = None
51-
):
49+
def figure_2d(self, solution_vector: bool = None):
5250
"""
5351
Plots the plotter's `Mapper` object in 2D.
5452
@@ -78,7 +76,8 @@ def figure_2d_image(self, image):
7876
)
7977

8078
def subplot_image_and_mapper(
81-
self, image: Array2D,
79+
self,
80+
image: Array2D,
8281
):
8382
"""
8483
Make a subplot of an input image and the `Mapper`'s source-plane reconstruction.

autoarray/structures/mesh/delaunay_2d.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from autoarray.inversion.linear_obj.neighbors import Neighbors
1212

1313
from autoarray import exc
14-
from autoarray.inversion.pixelization.mesh import mesh_numba_util
1514

1615

1716
def scipy_delaunay(points_np, query_points_np, use_voronoi_areas, areas_factor):

autoarray/util/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from autoarray.layout import layout_util as layout
1212
from autoarray.fit import fit_util as fit
1313
from autoarray.inversion.pixelization.mesh import mesh_util as mesh
14-
from autoarray.inversion.pixelization.mesh import mesh_numba_util as mesh_numba
1514
from autoarray.inversion.pixelization.mappers import mapper_util as mapper
1615
from autoarray.inversion.pixelization.mappers import mapper_numba_util as mapper_numba
1716
from autoarray.inversion.regularization import regularization_util as regularization

test_autoarray/inversion/inversion/test_mapper_valued.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ def test__max_pixel_list_from__filter_neighbors():
5151
assert pixel_list[0] == [
5252
0,
5353
8,
54-
]
54+
]

test_autoarray/structures/mesh/test_delaunay.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import autoarray as aa
55

6+
67
def test__neighbors(grid_2d_sub_1_7x7):
78

89
mesh_grid = aa.Grid2D.no_mask(

0 commit comments

Comments
 (0)