class eradiate.contexts.SpectralContext[source]#

Bases: ABC, Context

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 the class method constructor.

static convert(value)[source]#

Object converter method.

If value is a dictionary, this method uses from_dict() to create a SpectralContext.

Otherwise, it returns value.


Create a copy of self with changes applied.


**changes – Keyword changes in the new copy.


<same type as self> – A copy of self with changes 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 a pint.Quantity container.


d (dict) – Configuration dictionary used for initialisation.


SpectralContext – Created object. The actual type depends on context.

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.

  • **kwargs – Keyword arguments depending on the currently active mode (see below for a list of actual keyword arguments).

  • wavelength (quantity or float, 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 or str or None, optional, default: "10nm" (test value)) – (CKD modes [CKDSpectralContext]) Bin set from which the bindex originates.

abstract property spectral_index#

Spectral index associated with spectral context.

abstract property spectral_index_formatted#

Spectral index formatted as a human-readable string.



abstract property wavelength#

Wavelength associated with spectral context.