ewoksxas.fit.peak_fit.PeakModel#

class ewoksxas.fit.peak_fit.PeakModel(data, shape=PeakShape.GAUSSIAN, baseline=Baseline.NONE, roi=None, sensitivity=2.5, fwhm_points=None, auto_fwhm=True, strip_width=None, strip_iterations=None, snip_width=None)[source]#

Bases: object

Fit one or several peaks of a single shape, with an optional baseline.

Parameters:
  • data (XYData)

  • shape (str | PeakShape)

  • baseline (str | Baseline)

  • roi (tuple[float, float] | None)

  • sensitivity (float)

  • fwhm_points (int | None)

  • auto_fwhm (bool)

  • strip_width (int | None)

  • strip_iterations (int | None)

  • snip_width (int | None)

auto_fwhm: bool#
baseline: Baseline#
data: XYData#
fit()[source]#

Fit the peaks and background to the region of interest.

Runs silx’s native flow – estimate (auto peak count) then runfit with the selected background theory – and prunes peaks the fit drove to zero.

Return type:

MultiPeakFitResult

Returns:

The fit wrapped in a MultiPeakFitResult.

classmethod from_dict(data, parameters=None)[source]#

Construct a PeakModel from plain dictionaries.

Args:

data: Mapping with "x" and "y" arrays. parameters: Optional settings: shape, baseline, xmin,

xmax, sensitivity, fwhm_points, auto_fwhm, strip_width, strip_iterations and snip_width.

Parameters:
  • data (dict[str, ndarray[tuple[int, ...], dtype[float64]]])

  • parameters (dict | None)

Return type:

PeakModel

fwhm_points: int | None#
roi: XYData#
sensitivity: float#
shape: PeakShape#
xmax: float#
xmin: float#