autoarray.inversion.mesh.mesh.RectangularRTUAdaptImage#

class RectangularRTUAdaptImage[source]#

Bases: RectangularRTUAdaptDensity

A uniform rectangular mesh of pixels used to reconstruct a source on a regular grid, with adaptive weighting driven by an external adapt image.

The mesh geometry is fixed and defined by a 2D shape (total_y_pixels, total_x_pixels). Pixels are indexed in row-major order:

  • Index 0 corresponds to the top-left pixel.

  • Indices increase left-to-right across rows and top-to-bottom between rows.

Each source-plane coordinate is associated with the rectangular pixel in which it lies. No interpolation is performed — every coordinate contributes fully to a single pixel.

Methods

interpolator_from

Mapper objects describe the mappings between pixels in the masked 2D data and the pixels in a pixelization, in both the data and source frames.

mesh_weight_map_from

The weight map the mesh adapts to, computed from the adapt image: clipped, raised to weight_power, floored at weight_floor and normalized to sum to 1.

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.

zeroed_pixels_from

Return the positive mesh-local indices of the pixels the inversion holds at zero, for a mapper whose parameter block is pixels long.

Attributes

interpolator_cls

interpolator_kwargs

Extra keyword arguments interpolator_from forwards to interpolator_cls — the kernel-CDF parameters for the adaptive meshes; overridden to {} by RectangularUniform, whose interpolator takes no kernel arguments.

supports_split_regularization

Whether this mesh supports "split" regularization schemes (e.g. ConstantSplit, AdaptSplit, AdaptSplitZeroth).

zeroed_pixels

Return the positive 1D pixel indices of the edge pixels in a rectangular mesh.

mesh_weight_map_from(adapt_data, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>)[source]#

The weight map the mesh adapts to, computed from the adapt image: clipped, raised to weight_power, floored at weight_floor and normalized to sum to 1.

Parameters:
  • adapt_data – The adapt image whose (masked) values weight the mesh adaption.

  • xp – The array library to use.