eradiate.spectral.SpectralGrid¶
- class eradiate.spectral.SpectralGrid[source]¶
Bases:
ABCAbstract interface for all spectral grids.
- 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:
SpectralGrid– Generated spectral grid.
- static from_absorption_database(abs_db)[source]¶
Retrieve the spectral grid from an absorption database. The returned type depends on the currently active mode.
- abstract 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)[source]¶
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.
- abstract walk_indices(**kwargs)[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.
- abstract property wavelengths¶
Convenience accessor to characteristic wavelengths of this spectral grid.