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 two-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=None)[source]#

Generate a bin set from an absorption dataset.

Parameters:
  • dataset (Dataset) – Absorption dataset.

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

Returns:

BinSet – Generated bin set.

Notes

Assumes that:

  • the absorption dataset has a bin coordinate with values in nanometers.

  • the absorption dataset has a bin_set attribute with the bin width in nanometers.

classmethod from_wavelengths(wavelengths, width=<Quantity(10.0, 'nanometer')>, quad=None)[source]#

Generate a bin set with bins centered on the given wavelengths.

Parameters:
  • wavelengths (sequence of quantity) – Wavelengths to center bins on.

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

Returns:

BinSet – Generated bin set.