autolens.ArrayIrregular#
- class ArrayIrregular[source]#
Bases:
StructureA collection of values which are structured as follows:
[value0, value1, value3]
The values object does not store the values as a list of floats, but instead a 1D NumPy array of shape [total_values]. This array can be mapped to the list of floats structure above. They are stored as a NumPy array so the values can be used efficiently for calculations.
The values input to this function can have any of the following forms:
[value0, value1]
In all cases, they will be converted to a list of floats followed by a 1D NumPy array.
Print methods are overridden so a user always “sees” the values as the list structure.
In contrast to a Array2D structure, ArrayIrregular do not lie on a uniform grid or correspond to values that originate from a uniform grid. Therefore, when handling irregular data-sets ArrayIrregular should be used.
- Parameters:
values (
Union[List,ndarray]) – A collection of values.
Methods
allastypecopyinstance_flattenFlatten an instance of an autoarray class into a tuple of its attributes (i.e.. a pytree).
instance_unflattenUnflatten a tuple of attributes (i.e. a pytree) into an instance of an autoarray class.
invertmaxminreshapesqrtsumtrimmed_after_convolution_fromTrim the data structure back to its original shape after PSF convolution has been performed on a padded version of it.
with_new_arrayCopy this object but give it a new array.
Attributes
arrayderive_gridThe
DeriveGrid2Dobject of the mask, used to compute derived grids of (y,x) coordinates such as the edge grid, border grid, and full unmasked grid.derive_indexesThe
DeriveIndexes2Dobject of the mask, used to compute index arrays that map data between theslim(1D unmasked) andnative(2D full-shape) representations.derive_maskThe
DeriveMask2Dobject of the mask, used to compute derived masks such as the edge mask, border mask, and blurring mask.dtypegeometryThe geometry object of the mask associated with this structure, which defines coordinate conversions between pixel units and scaled units.
header_dictThe FITS header dictionary of the mask associated with this structure, containing pixel scale and origin entries.
imagReturn the values in a list.
is_transformedThe
ArrayIrregularin itsnativerepresentation.ndimoriginThe (y,x) scaled units origin of the mask's coordinate system.
pixel_areaThe area of a single pixel in scaled units squared (
pixel_scales[0] * pixel_scales[1]).pixel_scaleThe pixel scale as a single float value.
pixel_scalesThe (y,x) scaled units to pixel units conversion factors of every pixel, as a tuple of floats.
realshapeshape_nativeThe shape of the data structure in its
nativerepresentation (e.g.(total_y_pixels, total_x_pixels)for a 2D structure).shape_slimThe 1D shape of the data structure in its
slimrepresentation, equal to the number of unmasked pixels.sizeThe ArrayIrregular in their slim representation, a 1D ndarray of shape [total_values].
total_areaThe total area of all unmasked pixels in scaled units squared (
total_pixels * pixel_area).total_pixelsThe total number of unmasked pixels in the data structure (its
slimlength).unmasked_gridA grid of (y,x) coordinates of every pixel in the full mask shape (including masked pixels), using the mask's geometry to compute each pixel's scaled coordinate.
The raw underlying 1D ndarray of values, with shape [total_values].
- property values#
The raw underlying 1D ndarray of values, with shape [total_values].
- property slim: ArrayIrregular#
The ArrayIrregular in their slim representation, a 1D ndarray of shape [total_values].
- property native: Structure#
The
ArrayIrregularin itsnativerepresentation. For an irregular array there is no 2D native format, so this returns the array as-is.