eradiate.spectral.BinSet#

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

Bases: object

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

Parameters:

bins (iterable of Bin) – Set of bins.

Fields:

bins (set 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) – Lower bound of first bin.

  • stop (quantity) – Upper bound of last bin.

  • step (quantity) – Bin width.

  • 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_dataset(dataset, quad_spec=None)[source]#

Generate a bin set from an absorption dataset.

Parameters:
  • dataset (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 dataset has a wbounds data variable.

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

Generate a bin set from a list of absorption datasets.

Parameters:
  • datasets (list of Dataset) – Absorption datasets.

  • 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, that covers 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.