ewoksxas.fit.peak_fit.PeakShape#

class ewoksxas.fit.peak_fit.PeakShape(theory_name, family, asymmetric)[source]#

Bases: Enum

A peak shape and the silx fit theory that realises it.

Symmetric and asymmetric variants are separate members. Each member carries, in order, the silx theory name, the profile family (used to derive the area from the height and to decide whether an eta mixing fraction is reported) and whether the shape is asymmetric (reports per-side FWHMs). The lowercase label (used in config and the GUI) is derived from the member name.

silx provides pseudo-Voigt (not a true Voigt) and models asymmetry with two half-widths (“Split …”), so VOIGT maps to a pseudo-Voigt and the skewed shapes map to split profiles.

Parameters:
  • theory_name (str)

  • family (str)

  • asymmetric (bool)

GAUSSIAN = ('Gaussians', 'gaussian', False)#
LORENTZIAN = ('Lorentz', 'lorentzian', False)#
SKEWED_GAUSSIAN = ('Split Gaussian', 'gaussian', True)#
SKEWED_VOIGT = ('Split Pseudo-Voigt', 'voigt', True)#
SPLIT_LORENTZIAN = ('Split Lorentz', 'lorentzian', True)#
VOIGT = ('Pseudo-Voigt Line', 'voigt', False)#
classmethod from_label(value)[source]#

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

Raises:

ValueError: If the label does not match any shape.

Parameters:

value (str | PeakShape)

Return type:

PeakShape

classmethod from_theory_name(theory_name)[source]#

Resolve a silx theory name (e.g. "Gaussians") to a PeakShape.

Raises:

ValueError: If no shape maps to the theory name.

Parameters:

theory_name (str)

Return type:

PeakShape