@@ -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- )
0 commit comments