eradiate.scenes.measure._core.CKDMeasureSpectralConfig
eradiate.scenes.measure._core.CKDMeasureSpectralConfig#
- class eradiate.scenes.measure._core.CKDMeasureSpectralConfig(srf=_Nothing.NOTHING, bin_set='10nm', bins=AUTO)[source]#
Bases:
eradiate.scenes.measure._core.MeasureSpectralConfig
A data structure specifying the spectral configuration of a
Measure
in CKD modes.- Parameters
srf (
str
orSpectrum
ordict
orfloat
, default:UniformSpectrum(value=1.0)
) – Spectral response function. If a string is passed, the corresponding shipped SRF data will be loaded from the Eradiate database. Other types will be converted byspectrum_factory
.bin_set (
BinSet
orstr
, default:"10nm"
) – CKD bin set definition. If a string is passed, the data repository is queried for the corresponding identifier usingBinSet.from_db()
.bins (
list
of(str
ortuple
ordict
orcallable)
orAUTO
, default:AUTO
) – List of CKD bins on which to perform the spectral loop. If set toAUTO
, all the bins relevant to the selected spectral response will be covered.
- Fields
- static convert(value)#
Object converter method.
If
value
is a dictionary, this method usesfrom_dict()
to create aSpectralContext
.Otherwise, it returns
value
.
- static from_dict(d)#
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
spectral_cfg (
MeasureSpectralConfig
) – Created object.
- static new(**kwargs)#
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 (
dict
, optional) – Keyword arguments depending on the currently active mode (see below for a list of actual keyword arguments).wavelengths (
quantity
, default:[550] nm
) – Monochromatic modes [MonoMeasureSpectralConfig
]. List of wavelengths (automatically converted to a Numpy array). Unit-enabled field (default: ucc[wavelength]).bin_set (
BinSet
orstr
, default:"10nm"
) – CKD modes [CKDMeasureSpectralConfig
]. CKD bin set definition. If a string is passed, the data repository is queried for the corresponding identifier usingBinSet.from_db()
.bins (
list
of(str
ortuple
ordict
orcallable)
) – CKD modes [CKDSpectralContext
]. List of CKD bins on which to perform the spectral loop. If unset, all the bins defined by the selected bin set will be covered.
See also
- spectral_ctxs()[source]#
Return a list of
SpectralContext
objects based on the stored spectral configuration. These data structures can be used to drive the evaluation of spectrally dependent components during a spectral loop.- Returns
list
ofSpectralContext
– List of generated spectral contexts. The concrete class (MonoSpectralContext
,CKDSpectralContext
, etc.) depends on the active mode.