eradiate.spectral.BinSet#

class eradiate.spectral.BinSet(bins)[source]#

Bases: SpectralSet

A data class representing a bin set used in CKD mode.

Parameters:

bins (iterable of Bin) – Set of bins.

Fields:

bins (list of Bin) – Set of bins.

See also

WavelengthSet

classmethod arange(start, stop, step=<Quantity(10.0, 'nanometer')>, quad=None)[source]#

Generate a bin set with linearly spaced bins.

Parameters:
  • start (quantity or float) – Lower bound of first bin. If a float is passed, it is interpreted as being in units of nm.

  • stop (quantity) – Upper bound of last bin. If a float is passed, it is interpreted as being in units of nm.

  • step (quantity, default: 10 nm) – Bin width. If a float is passed, it is interpreted as being in units of nm.

  • quad (Quad, optional) – Quadrature rule (same for all bins in the set). Defaults to a one-point Gauss-Legendre quadrature.

Returns:

BinSet – Generated bin set.

classmethod default()[source]#

Generate a default bin set, which covers Eradiate’s default spectral range with 10 nm-wide bins.

classmethod from_absorption_data(datasets, quad_spec=None)[source]#

Generate a bin set from one or several absorption datasets.

Parameters:
  • datasets (Dataset or sequence of Dataset) – Absorption dataset.

  • quad_spec (QuadSpec) – Quadrature rule specification. If provided, it will be used to generate the quadrature rule based on error data in the absorption dataset.

Returns:

BinSet – Generated bin set.

Notes

Assumes that the absorption datasets have a wbounds data variable.

classmethod from_srf(srf, step=<Quantity(10.0, 'nanometer')>, quad=None)[source]#

Generate a bin set with linearly spaced bins covering the spectral range of a spectral response function.

Parameters:
  • srf (Dataset) – Spectral response function dataset.

  • step (quantity) – Wavelength step.

  • quad (Quad, optional) – Quadrature rule (same for all bins in the set). Defaults to a one-point Gauss-Legendre quadrature.

Returns:

BinSet – Generated bin set.

property wcenters#

Return the central wavelength of all bins.

property wmaxs#

Return the upper bound of all bins.

property wmins#

Return the lower bound of all bins.