- class VoronoiNNBrightnessImage[source]#
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 applying a KMeans clustering algorithm to the image’s weight map.
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.
Voronoimesh 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 (the
image_plane_mesh_gridmaps to this after gravitational lensing).
Each (y,x) coordinate in the
source_plane_data_gridis 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 applying a KMeans clustering algorithm to the masked image data’s weight-map. The
weight_powerallow the KMeans algorithm to adapt the image-plane coordinates to the image’s brightest or faintest values. The computed valies are mapped to the source-plane via gravitational lensing, where they form the Voronoi cell pixel centers.
pixels – The total number of pixels in the mesh, which is therefore also the number of (y,x) coordinates computed via the KMeans clustering algorithm in image-plane.
float) – A parameter which reweights the data values the KMeans algorithm is applied too; as the floor increases more weight is applied to values with lower values thus allowing mesh pixels to be placed in these regions of the data.
float) – A parameter which reweights the data values the KMeans algorithm is applied too; as the power increases more weight is applied to values with higher values thus allowing mesh pixels to be placed in these regions of the data.
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 objects describe the mappings between pixels in the masked 2D data and the pixels in a mesh, in both the data and source frames.
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 pixelization.
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.
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.
Computes a weight_map from an input hyper_data, where this image represents components in the masked 2d data in the data frame.