autogalaxy.ArrayIrregular#

class ArrayIrregular[source]#

Bases: Structure

A 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 ([float] or equivalent) – A collection of values.

Methods

all

astype

copy

instance_flatten

Flatten an instance of an autoarray class into a tuple of its attributes (i.e.. a pytree).

instance_unflatten

Unflatten a tuple of attributes (i.e. a pytree) into an instance of an autoarray class.

invert

max

min

reshape

sqrt

sum

trimmed_after_convolution_from

Trim the data structure back to its original shape after PSF convolution has been performed on a padded version of it.

with_new_array

Copy this object but give it a new array.

Attributes

array

derive_grid

The DeriveGrid2D object of the mask, used to compute derived grids of (y,x) coordinates such as the edge grid, border grid, and full unmasked grid.

derive_indexes

The DeriveIndexes2D object of the mask, used to compute index arrays that map data between the slim (1D unmasked) and native (2D full-shape) representations.

derive_mask

The DeriveMask2D object of the mask, used to compute derived masks such as the edge mask, border mask, and blurring mask.

dtype

geometry

The geometry object of the mask associated with this structure, which defines coordinate conversions between pixel units and scaled units.

header_dict

The FITS header dictionary of the mask associated with this structure, containing pixel scale and origin entries.

imag

in_list

Return the values in a list.

is_transformed

native

The ArrayIrregular in its native representation.

ndim

origin

The (y,x) scaled units origin of the mask's coordinate system.

pixel_area

The area of a single pixel in scaled units squared (pixel_scales[0] * pixel_scales[1]).

pixel_scale

The pixel scale as a single float value.

pixel_scales

The (y,x) scaled units to pixel units conversion factors of every pixel, as a tuple of floats.

real

shape

shape_native

The shape of the data structure in its native representation (e.g. (total_y_pixels, total_x_pixels) for a 2D structure).

shape_slim

The 1D shape of the data structure in its slim representation, equal to the number of unmasked pixels.

size

slim

The ArrayIrregular in their slim representation, a 1D ndarray of shape [total_values].

total_area

The total area of all unmasked pixels in scaled units squared (total_pixels * pixel_area).

total_pixels

The total number of unmasked pixels in the data structure (its slim length).

unmasked_grid

A 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.

values

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 ArrayIrregular in its native representation. For an irregular array there is no 2D native format, so this returns the array as-is.

property in_list: List#

Return the values in a list.