autoarray.inversion.pixelization.image_mesh.Overlay#

class Overlay[source]#

Bases: AbstractImageMesh

Computes an image-mesh by overlaying a uniform grid of (y,x) coordinates over the masked image that the pixelization is fitting.

For example, the masked image data may consist of a 2D annular region. This image mesh class determines the image-mesh grid as follows:

1) Overlay a uniform grid of dimensions shape over the annular mask, covering its four extreme (y,x) coordinates (e.g. max(x), min(x), max(y), min(y)).

2) Find all pixels in the overlaid uniform grid which are contained within the annular mask, discarding all other pixels.

Parameters:

shape – The 2D shape of the grid which is overlaid over the grid to determine the image mesh.

Methods

check_adapt_background_pixels

Checks the number of mesh pixels in the background of the image-mesh and raises an InversionException if there are fewer mesh pixels in the background than the input settings.

check_mesh_pixels_per_image_pixels

Checks the number of mesh pixels in every image pixel and raises an InversionException if there are fewer mesh pixels inside a certain number of image-pixels than the input settings.

image_plane_mesh_grid_from

Returns an image-mesh by overlaying a uniform grid of (y,x) coordinates over the masked image that the pixelization is fitting.

mesh_pixels_per_image_pixels_from

Returns an array containing the number of mesh pixels in every pixel of the data's mask.

Attributes

uses_adapt_images

rtype:

bool

image_plane_mesh_grid_from(grid, adapt_data=None, settings=None)[source]#

Returns an image-mesh by overlaying a uniform grid of (y,x) coordinates over the masked image that the pixelization is fitting.

See the __init__ docstring for a full description of how this is performed.

Parameters:
  • grid (Grid2D) – The grid of (y,x) coordinates of the image data the pixelization fits, which the overlay grid is laid over.

  • adapt_data (Optional[ndarray]) – Not used by this image mesh.

Return type:

Grid2DIrregular