lezargus.container.image module#
Image data container.
This module and class primarily deals with images containing spatial information.
- class lezargus.container.image.LezargusImage(data: ndarray, uncertainty: ndarray | None = None, wavelength: float | None = None, wavelength_unit: str | Unit = None, data_unit: str | Unit | None = None, mask: ndarray | None = None, flags: ndarray | None = None, header: Header | None = None)[source]#
Bases:
LezargusContainerArithmetic
Container to hold image and perform operations on it.
- wavelength#
The wavelength of the image. The unit of wavelength is typically in microns; but, check the wavelength_unit value. If none has been provided, this value is an array of None.
- Type:
float
- data#
The flux of the spectra cube. The unit of the flux is typically in flam; but, check the flux_unit value.
- Type:
ndarray
- uncertainty#
The uncertainty in the flux of the spectra. The unit of the uncertainty is the same as the flux value; per uncertainty_unit.
- Type:
ndarray
- wavelength_unit#
The unit of the wavelength array.
- Type:
Astropy Unit
- flux_unit#
The unit of the flux array.
- Type:
Astropy Unit
- uncertainty_unit#
The unit of the uncertainty array. This unit is the same as the flux unit.
- Type:
Astropy Unit
- mask#
A mask of the flux data, used to remove problematic areas. Where True, the values of the flux is considered mask.
- Type:
ndarray
- flags#
Flags of the flux data. These flags store metadata about the flux.
- Type:
ndarray
- header#
The header information, or metadata in general, about the data.
- Type:
Header
- __init__(data: ndarray, uncertainty: ndarray | None = None, wavelength: float | None = None, wavelength_unit: str | Unit = None, data_unit: str | Unit | None = None, mask: ndarray | None = None, flags: ndarray | None = None, header: Header | None = None) None [source]#
Instantiate the spectra class.
- Parameters:
data (ndarray) – The flux of the spectra.
uncertainty (ndarray, default = None) – The uncertainty of the spectra. By default, it is None and the uncertainty value is 0.
wavelength (ndarray, default = None) – The wavelength of the image. If this is not provided, it defaults to 0, otherwise, it is an array of a single value.
wavelength_unit (Astropy-Unit like, default = None) – The wavelength unit of the spectra. It must be interpretable by the Astropy Units package. If None, the the unit is dimensionless.
data_unit (Astropy-Unit like, default = None) – The data unit of the spectra. It must be interpretable by the Astropy Units package. If None, the the unit is dimensionless.
mask (ndarray, default = None) – A mask which should be applied to the spectra, if needed.
flags (ndarray, default = None) – A set of flags which describe specific points of data in the spectra.
header (Header, default = None) – A set of header data describing the data. Note that when saving, this header is written to disk with minimal processing. We highly suggest writing of the metadata to conform to the FITS Header specification as much as possible.
- classmethod read_fits_file(filename: str) Self [source]#
Read a Lezargus image FITS file.
We load a Lezargus FITS file from disk. Note that this should only be used for 2-D image files.
- Parameters:
filename (str) – The filename to load.
- Returns:
cube – The LezargusImage class instance.
- Return type:
Self-like