ewoksxas.fit.peak_fit.MultiPeakFitResult#

class ewoksxas.fit.peak_fit.MultiPeakFitResult(manager, shape, roi)[source]#

Bases: object

The result of an N-peak fit, exposing per-peak physical descriptors.

The bare scalar properties (center, area, …) report the first (leftmost) peak so that single-peak callers keep working unchanged; the full per-peak descriptors are available through peaks.

Parameters:
property area: float#

Integrated area of the first peak.

as_dict()[source]#

Return the first peak’s descriptors and the fit quality as a dict.

Return type:

dict[str, float]

property center: float#

Center x0 of the first (leftmost) peak.

property dof: int#

Degrees of freedom of the fit (data points minus varied params).

property eta: float#

Pseudo-Voigt mixing fraction of the first peak (Voigt shapes only).

property fwhm: float#

Total full width at half maximum of the first (symmetric) peak.

property fwhm_high: float#

High-side full width at half maximum of the first (asymmetric) peak.

property fwhm_low: float#

Low-side full width at half maximum of the first (asymmetric) peak.

property height: float#

Maximum height of the first peak above the baseline.

property n_peaks: int#

Number of fitted peaks.

property peaks: list[dict[str, float]]#

Per-peak descriptor dictionaries, ordered by ascending center.

property r2: float#

Coefficient of determination of the total model.

property rmse: float#

Root-mean-square error of the total model against the data.

shape: PeakShape#
summary()[source]#

Return a formatted report of the fit.

Return type:

str

without_negligible_peaks()[source]#

Return a result with vanishing peaks dropped (for automatic counting).

silx may over-detect peaks; a surplus peak’s height and area are driven towards zero by the fit. Those are removed so the output reports only the peaks the data supports. A zeroed peak’s removal barely perturbs the model curve, so no re-fit is needed; at least the tallest peak is kept, and self is returned when nothing is pruned.

Return type:

MultiPeakFitResult