autogalaxy.Visibilities#
- class Visibilities[source]#
Bases:
AbstractVisibilitiesA collection of (real, imag) visibilities which are used to represent the data in an Interferometer dataset.
The (real, imag) visibilities are stored as a 1D complex NumPy array of shape [total_visibilities]. These can be mapped to a 2D real NumPy array of shape [total_visibilities, 2] and a Grid2DIrregular data structure which is used for plotting the visibilities in 2D in the complex plane.
Calculations should use the NumPy array structure wherever possible for efficient calculations.
The vectors input to this function can have any of the following forms (they will be converted to the 1D complex NumPy array structure and can be converted back using the object’s properties):
[1.0+1.0j, 2.0+2.0j] [[1.0, 1.0], [2.0, 2.0]]
- __init__(visibilities)#
A collection of (real, imag) visibilities which are used to represent the data in an Interferometer dataset.
The (real, imag) visibilities are stored as a 1D complex NumPy array of shape [total_visibilities]. These can be mapped to a 2D real NumPy array of shape [total_visibilities, 2] and a Grid2DIrregular data structure which is used for plotting the visibilities in 2D in the complex plane.
Calculations should use the NumPy array structure wherever possible for efficient calculations.
The vectors input to this function can have any of the following forms (they will be converted to the 1D complex NumPy array structure and can be converted back using the object’s properties):
[1.0+1.0j, 2.0+2.0j] [[1.0, 1.0], [2.0, 2.0]]
Methods
__init__(visibilities)A collection of (real, imag) visibilities which are used to represent the data in an Interferometer dataset.
all()astype(*args, **kwargs)copy()from_fits(file_path, hdu)Create Visibilities (see AbstractVisibilities.__new__) by loading the(real, imag) values from a .fits file.
full(fill_value, shape_slim)Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with an input fill value, analogous to the method numpy ndarray.full.
instance_flatten(instance)Flatten an instance of an autoarray class into a tuple of its attributes (i.e.. a pytree).
instance_unflatten(aux_data, children)Unflatten a tuple of attributes (i.e. a pytree) into an instance of an autoarray class.
invert()max(*args, **kwargs)min(*args, **kwargs)ones(shape_slim)Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with ones, analogous to the method np.ones().
reshape(*args, **kwargs)sqrt(*args, **kwargs)sum(*args, **kwargs)trimmed_after_convolution_from(kernel_shape)Trim the data structure back to its original shape after PSF convolution has been performed on a padded version of it.
with_new_array(array)Copy this object but give it a new array.
zeros(shape_slim)Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with zeros, analogous to the method np.zeros().
Attributes
amplitudesarrayderive_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.
imagin_arrayReturns the 1D complex NumPy array of values with shape [total_visibilities] as a NumPy float array of shape [total_visibilities, 2].
in_gridReturns the 1D complex NumPy array of values as an irregular grid.
is_transformedmasknativeReturns the data structure in its native format which contains all unmaksed values to the native dimensions.
ndimoriginThe (y,x) scaled units origin of the mask's coordinate system.
phasespixel_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.
realscaled_maximaThe maximum values of the visibilities if they are treated as a 2D grid in the complex plane.
scaled_minimaThe minimum values of the visibilities if they are treated as a 2D grid in the complex plane.
shapeshape_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.sizeslimReturns the data structure in its slim format which flattens all unmasked values to a 1D array.
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.
- classmethod full(fill_value, shape_slim)[source]#
Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with an input fill value, analogous to the method numpy ndarray.full.
From 1D input the method cannot determine the 2D shape of the array and its mask, thus the shape_native must be input into this method. The mask is setup as a unmasked Mask2D of shape_native.
- classmethod ones(shape_slim)[source]#
Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with ones, analogous to the method np.ones().
From 1D input the method cannot determine the 2D shape of the array and its mask, thus the shape_native must be input into this method. The mask is setup as a unmasked Mask2D of shape_native.
- classmethod zeros(shape_slim)[source]#
Create Visibilities (see AbstractVisibilities.__new__) where all (real, imag) values are filled with zeros, analogous to the method np.zeros().
From 1D input the method cannot determine the 2D shape of the array and its mask, thus the shape_native must be input into this method. The mask is setup as a unmasked Mask2D of shape_native.