autoarray.inversion.pixelization.mesh.VoronoiMagnification#
- class VoronoiMagnification[source]#
Bases:
Voronoi
An irregular mesh of Voronoi pixels, which using no interpolation are paired with a 2D grid of (y,x) coordinates. The Voronoi cell centers are derived in the image-plane by overlaying a uniform grid over the image.
For a full description of how a mesh is paired with another grid, see the
Pixelization API documentation
.The Voronoi mesh represents pixels as an irregular 2D grid of Voronoi cells.
A
Pixelization
using aVoronoi
mesh has four grids associated with it:image_plane_data_grid
: The observed data grid in the image-plane (which is paired with the mesh in the source-plane).image_plane_mesh_grid
: The (y,x) mesh coordinates in the image-plane (which are the centres of Voronoi cells in the source-plane).source_plane_data_grid
: The observed data grid mapped to the source-plane (e.g. after gravitational lensing).source_plane_mesh_grid
: The centre of each Voronoi cell in the source-plane (theimage_plane_mesh_grid
maps to this after gravitational lensing).
Each (y,x) coordinate in the
source_plane_data_grid
is paired with all Voronoi cells it falls within, without using an interpolation scheme.The centers of the Voronoi cell pixels are derived in the image-plane by overlaying a uniform grid with the input
shape
over the masked image data’s grid. All coordinates in this uniform grid which are contained within the mask are kept and mapped to the source-plane via gravitational lensing, where they form the Voronoi pixel centers.- Parameters
shape (
Tuple
[int
,int
]) – The shape of the unmasked uniform grid in the image-plane which is laid over the masked image, in order to derive the image-plane (y,x) coordinates which act as the centres of the Voronoi pixels after being mapped to the source-plane via gravitational lensing.
Methods
Computes the mesh_grid in the data frame, by overlaying a uniform grid of coordinates over the masked 2D data (see Grid2DSparse.from_grid_and_unmasked_2d_grid_shape()).
mapper_grids_from
Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a mesh, in both the data and source frames.
mesh_grid_from
Return the Voronoi source_plane_mesh_grid as a Mesh2DVoronoi object, which provides additional functionality for performing operations that exploit the geometry of a Voronoi mesh.
relocated_grid_from
Relocates all coordinates of the input source_plane_data_grid that are outside of a border (which is defined by a grid of (y,x) coordinates) to the edge of this border.
relocated_mesh_grid_from
Relocates all coordinates of the input source_plane_mesh_grid that are outside of a border (which is defined by a grid of (y,x) coordinates) to the edge of this border.
weight_map_from
Attributes
is_stochastic
uses_interpolation
- image_plane_mesh_grid_from(image_plane_data_grid, adapt_data=None, settings=<autoarray.inversion.pixelization.settings.SettingsPixelization object>)[source]#
Computes the mesh_grid in the data frame, by overlaying a uniform grid of coordinates over the masked 2D data (see Grid2DSparse.from_grid_and_unmasked_2d_grid_shape()).
For a VoronoiMagnification this grid is computed by overlaying a 2D grid with dimensions shape over the masked 2D data in the data frame, whereby all (y,x) coordinates in this grid which are not masked are retained.
- Parameters
image_plane_mesh_grid – The sparse set of (y,x) coordinates computed from the unmasked data in the data frame. This has a transformation applied to it to create the source_plane_mesh_grid.
adapt_data (
Optional
[ndarray
]) – An image which is used to determine the image_plane_mesh_grid and therefore adapt the distribution of pixels of the Voronoi grid to the data it discretizes.settings – Settings controlling the pixelization for example if a border is used to relocate its exterior coordinates.
- Return type
Grid2DSparse