ewoksfluo.xrffit.fit.slow_fit.fit_xrf_spectra#

ewoksfluo.xrffit.fit.slow_fit.fit_xrf_spectra(xrf_spectra, configuration, quantification=None, individual_weights=None, live_times=None, positive_peak_areas=None, diagnostics=None)[source]#

Slow fitting refers to fitting XRF spectra one-by-one. This function does not use the high-level API from PyMca. It uses the low-level API to

  • calculate elemental spectra

  • calculate mass fractions from fit results

  • strip spectral background

  • and perform linear least-squares fit.

Parameters:
  • xrf_spectra (ndarray) – shape (num_spectra, num_channels)

  • configuration (PyMcaXrfConfiguration) – PyMca configuration.

  • quantification (Optional[bool]) – Calculate mass fractions from peak area’s.

  • individual_weights (Optional[bool]) – When fitting with weights, use the weight of each spectrum (slow) instead of the average weight.

  • live_times (Optional[ndarray]) – 1D array with one value for each XRF spectrum. Only used for mass fractions with fundamental parameters.

  • positive_peak_areas (Optional[bool])

  • diagnostics (Optional[bool]) – fit model and residuals.

Return type:

XRFBatchFitResult