ewoksxas.fit.silx_engine#
silx fitting engine helpers shared by the peak-fit backend and the widget.
This module wraps silx.math.fit (the engine behind
silx.gui.fit.FitWidget) so the headless ewoks task and the interactive
Orange widget configure the same fit:
make_fit_manager()builds aFitManagercarrying only the peak theories we expose (so every selectable shape yields a meaningful descriptor) and, optionally, only the supported backgrounds.descriptors_from_fit_results()turns silx’s rawfit_resultsinto the physically meaningful per-peak descriptors (center, height, area, FWHM and the pseudo-Voigt mixing) the task and widget report.background_curve()evaluates the fitted background over the manager’s x-grid, splitting the total model into background and peak contributions.strip_theory()/snip_theory()are drop-in replacements for silx’s stock Strip/Snip peak-stripping backgrounds, whose process-wide caches crash when the data length changes between fits (a region-of-interest change) and tear under concurrent fits;make_fit_manager()installs them on every manager.
silx peak theories report Height (the true peak maximum) directly; the
integrated area is derived from the height and width(s) with the closed-form
expressions in area_from_height() – numerically integrating the model
curve would truncate the heavy Lorentzian/Voigt tails.
Functions
|
Return the analytic integrated area of a peak from its height and width. |
|
Evaluate the fitted background of a manager over its x-grid. |
|
Return the per-peak descriptors from silx |
|
Return a FitManager carrying the curated peak theories. |
Return a fresh Snip background theory with a per-manager cache. |
|
Return a fresh Strip background theory with a per-manager cache. |