autoarray.inversion.mesh.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.

  • respect_small_datasets (bool) – When PYAUTO_SMALL_DATASETS=1 is set, shape is capped per axis to the small-datasets cap, matching the cap Grid2D.uniform and Mask2D.circular apply to the data. Pass False to opt out for an image mesh whose resolution is load-bearing for the script.

Methods

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

image_plane_mesh_grid_from(mask, adapt_data=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 – 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.

property uses_adapt_images: bool#