autolens.Imaging#

class Imaging[source]#

Bases: AbstractDataset

A class containing an imaging dataset, including the image data, noise-map and a point spread function (PSF).

Parameters
  • image (Array2D) – The array of the image data, for example in units of electrons per second.

  • noise_map (Optional[Array2D]) – An array describing the RMS standard deviation error in each pixel, for example in units of electrons per second.

  • psf (Optional[Kernel2D]) – An array describing the Point Spread Function kernel of the image which accounts for diffraction due to the telescope optics via 2D convolution.

  • settings (SettingsImaging) – Controls settings of how the dataset is set up (e.g. the types of grids used to perform calculations).

Methods

apply_mask

Apply a mask to the imaging dataset, whereby the mask is applied to the image data, noise-map and other quantities one-by-one.

apply_settings

Returns a new instance of the imaging with the input SettingsImaging applied to them.

from_fits

Factory for loading the imaging data_type from .fits files, as well as computing properties like the noise-map, exposure-time map, etc.

output_to_fits

trimmed_after_convolution_from

rtype

AbstractDataset

Attributes

absolute_signal_to_noise_map

The estimated absolute_signal-to-noise_maps mappers of the image.

absolute_signal_to_noise_max

The maximum value of absolute signal-to-noise_map in an image pixel in the image's signal-to-noise_maps mappers.

blurring_grid

A property that is only computed once per instance and then replaces itself with an ordinary attribute.

convolver

A property that is only computed once per instance and then replaces itself with an ordinary attribute.

image

inverse_noise_map

rtype

Structure

mask

rtype

Union[Mask1D, Mask2D]

noise_covariance_matrix_inv

A property that is only computed once per instance and then replaces itself with an ordinary attribute.

pixel_scales

potential_chi_squared_map

The potential chi-squared-map of the imaging data_type.

potential_chi_squared_max

The maximum value of the potential chi-squared-map.

shape_native

shape_slim

signal_to_noise_map

The estimated signal-to-noise_maps mappers of the image.

signal_to_noise_max

The maximum value of signal-to-noise_maps in an image pixel in the image's signal-to-noise_maps mappers.

w_tilde

A property that is only computed once per instance and then replaces itself with an ordinary attribute.

classmethod from_fits(image_path, pixel_scales, noise_map_path, image_hdu=0, noise_map_hdu=0, psf_path=None, psf_hdu=0, noise_covariance_matrix=None)[source]#

Factory for loading the imaging data_type from .fits files, as well as computing properties like the noise-map, exposure-time map, etc. from the imaging-data.

This factory also includes a number of routines for converting the imaging-data from unit_label not supported by PyAutoLens (e.g. adus, electrons) to electrons per second.

Parameters
  • noise_map_non_constant

  • image_path (str) – The path to the image .fits file containing the image (e.g. ‘/path/to/image.fits’)

  • pixel_scales (Union[Tuple[float], Tuple[float, float], float]) – The size of each pixel in scaled units.

  • image_hdu (int) – The hdu the image is contained in the .fits file specified by image_path.

  • psf_path (Optional[str]) – The path to the psf .fits file containing the psf (e.g. ‘/path/to/psf.fits’)

  • psf_hdu (int) – The hdu the psf is contained in the .fits file specified by psf_path.

  • noise_map_path (str) – The path to the noise_map .fits file containing the noise_map (e.g. ‘/path/to/noise_map.fits’)

  • noise_map_hdu (int) – The hdu the noise_map is contained in the .fits file specified by noise_map_path.

Return type

Imaging

apply_mask(mask)[source]#

Apply a mask to the imaging dataset, whereby the mask is applied to the image data, noise-map and other quantities one-by-one.

The original unmasked imaging data is stored as the self.unmasked attribute. This is used to ensure that if the apply_mask function is called multiple times, every mask is always applied to the original unmasked imaging dataset.

Parameters

mask (Mask2D) – The 2D mask that is applied to the image.

Return type

Imaging

apply_settings(settings)[source]#

Returns a new instance of the imaging with the input SettingsImaging applied to them.

This can be used to update settings like the types of grids associated with the dataset that are used to perform calculations or putting a limit of the dataset’s signal-to-noise.

Parameters

settings (SettingsImaging) – The settings for the imaging data that control things like the grids used for calculations.

Return type

Imaging