eradiate.spectral.MonoSpectralGrid#
- class eradiate.spectral.MonoSpectralGrid(wavelengths)[source]#
Bases:
SpectralGrid
A spectral grid consisting of discrete wavelengths, used in monochromatic modes.
- Parameters:
wavelengths (
quantity
or array-like orfloat
) – Wavelengths.
- static arange(start, stop, step)[source]#
Generate a spectral grid from equally-spaced wavelengths.
- Parameters:
start (
quantity
orfloat
) – Central wavelength of the first bin. If a unitless value is passed, it is interpreted in default wavelength units (usually nm).stop (
quantity
orfloat
) – Wavelength after which bin generation stops. If a unitless value is passed, it is interpreted in default wavelength units (usually nm).step (
quantity
orfloat
) – 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
SpectralResponseFunction
instance or convertible to aSpectralResponseFunction
by 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
srf
parameter.
- 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.