ewoksxas.fit.peak_fit.Baseline#

class ewoksxas.fit.peak_fit.Baseline(label, theory_name)[source]#

Bases: Enum

A baseline option and the silx background theory it maps to.

The background is fitted by silx together with the peaks. STRIP and SNIP are silx’s iterative peak-stripping backgrounds, suited to multi-peak spectra; their filter settings come from the fit configuration (see PeakModel).

Parameters:
  • label (str)

  • theory_name (str)

LINEAR = ('linear', 'Linear')#
NONE = ('none', 'No Background')#
OFFSET = ('offset', 'Constant')#
SNIP = ('snip', 'Snip')#
STRIP = ('strip', 'Strip')#
classmethod from_label(value)[source]#

Resolve a label string (or pass a member through) to a Baseline.

Raises:

ValueError: If the label does not match any baseline.

Parameters:

value (str | Baseline)

Return type:

Baseline

classmethod from_theory_name(theory_name)[source]#

Resolve a silx background name (e.g. "Constant") to a Baseline.

Raises:

ValueError: If no baseline maps to the background name.

Parameters:

theory_name (str)

Return type:

Baseline