eradiate.contexts.SpectralContext#
- class eradiate.contexts.SpectralContext[source]#
-
Context data structure holding state relevant to the evaluation of spectrally dependent objects. This class is abstract.
This object is usually used as part of a
KernelDictContext
to pass around spectral information to kernel dictionary emission methods which require spectral configuration information.While this class is abstract, it should however be the main entry point to create
SpectralContext
child class objects through theSpectralContext.new()
class method constructor.- static convert(value)[source]#
Object converter method.
If
value
is a dictionary, this method usesfrom_dict()
to create aSpectralContext
.Otherwise, it returns
value
.
- evolve(**changes)#
Create a copy of self with changes applied.
- Parameters:
**changes – Keyword changes in the new copy.
- Returns:
<same type as self>
– A copy of self withchanges
incorporated.
- static from_dict(d)[source]#
Create from a dictionary. This class method will additionally pre-process the passed dictionary to merge any field with an associated
"_units"
field into apint.Quantity
container.- Parameters:
d (
dict
) – Configuration dictionary used for initialisation.- Returns:
SpectralContext
– Created object. The actual type depends on context.
See also
- static new(**kwargs)[source]#
Create a new instance of one of the
SpectralContext
child classes. The instantiated class is defined based on the currently active mode. Keyword arguments are passed to the instantiated class’s constructor.- Parameters:
**kwargs – Keyword arguments depending on the currently active mode (see below for a list of actual keyword arguments).
wavelength (
quantity
orfloat
, default:550 nm
) – (Monochromatic modes [MonoSpectralContext
]) Wavelength. Unit-enabled field (default: ucc[wavelength]).bindex (
Bindex
, optional, default: 1st quadrature point for the"550"
bin of the"10nm"
bin set (test value)) – (CKD modes [CKDSpectralContext
]) CKD bindex.bin_set (
BinSet
orstr
orNone
, optional, default:"10nm"
(test value)) – (CKD modes [CKDSpectralContext
]) Bin set from which the bindex originates.
See also
- abstract property spectral_index#
Spectral index associated with spectral context.
- abstract property spectral_index_formatted#
Spectral index formatted as a human-readable string.
- Type:
- abstract property wavelength#
Wavelength associated with spectral context.
- Type:
quantity