eradiate.spectral.MonoSpectralGrid¶
- class eradiate.spectral.MonoSpectralGrid(wavelengths)[source]¶
Bases:
SpectralGridA spectral grid consisting of discrete wavelengths, used in monochromatic modes.
- Parameters:
wavelengths (
quantityor array-like orfloat) – Wavelengths.
- static arange(start, stop, step)[source]¶
Generate a spectral grid from equally-spaced wavelengths.
- Parameters:
start (
quantityorfloat) – Central wavelength of the first bin. If a unitless value is passed, it is interpreted in default wavelength units (usually nm).stop (
quantityorfloat) – Wavelength after which bin generation stops. If a unitless value is passed, it is interpreted in default wavelength units (usually nm).step (
quantityorfloat) – Spectral bin size. If a unitless value is passed, it is interpreted in default wavelength units (usually nm).
- Returns:
MonoSpectralGrid– Generated spectral grid.
- static default()[source]¶
Generate a default monochromatic spectral grid that covers the default spectral range with 1 nm spacing.
- classmethod from_absorption_database(abs_db)[source]¶
Retrieve the spectral grid from a monochromatic absorption database.
- merge(other)[source]¶
Merge two spectral grids, applying a boolean “OR” operation.
- Parameters:
other (
SpectralGrid) – Other spectral, of the same type, to merge with the current one.- Returns:
SpectralGrid– A new spectral grid of the same type that merges the two.
- select(srf)¶
Select a subset of the spectral grid based on a spectral response function.
- Parameters:
srf – A value that is either a
SpectralResponseFunctioninstance or convertible to aSpectralResponseFunctionby theSpectralResponseFunction.convert()method.- Returns:
SpectralGrid– New spectral grid instance covering the extent of the filtering SRF.
Notes
The implementation of this method uses single dispatch based on the type of the
srfparameter.
- walk_indices()[source]¶
A generator that yields a sequence of spectral index values.
- Yields:
SpectralIndex– Generated spectral index of a type aligned with the current active mode.
- property wavelengths¶
Convenience accessor to characteristic wavelengths of this spectral grid.