autoemxsp.runners.fit_and_quantify_spectrum module

Fit and (optionally) quantify a single spectrum.

param spectrum_vals:

The measured EDS spectrum (counts per channel).

type spectrum_vals:

numpy.ndarray

param spectrum_lims:

Tuple specifying the start and end indices for the spectrum region to analyze.

type spectrum_lims:

tuple of int

param microscope_ID:

Microscope identifier for detector calibration data.

type microscope_ID:

str

param meas_type:

Measurement type (e.g., ‘EDS’).

type meas_type:

str

param meas_mode:

Measurement mode, defining detector calibrations and (optionally) beam current (e.g., ‘point’).

type meas_mode:

str

param det_ch_offset:

Detector channel energy offset (keV).

type det_ch_offset:

float

param det_ch_width:

Detector channel width (keV).

type det_ch_width:

float

param beam_energy:

Electron beam energy (keV).

type beam_energy:

float

param emergence_angle:

Detector emergence (take-off) angle (degrees).

type emergence_angle:

float

param sp_collection_time:

Live time of spectrum acquisition (in seconds).

type sp_collection_time:

float or None

param sample_ID:

Sample identifier.

type sample_ID:

str

param els_sample:

List of elements in the sample.

type els_sample:

list, optional

param els_substrate:

List of substrate elements.

type els_substrate:

list, optional

param background_vals:

Background spectrum to subtract. If None, the background will be modeled during fitting.

type background_vals:

array-like or None, optional

param fit_tol:

scipy fit tolerance. Defines conditions of fit convergence

type fit_tol:

float, optional

param is_particle:

If True, treats sample as particle (powder). Uses particle geometry fitting parameters

type is_particle:

bool, optional

param quantify_plot:

Whether to quantify the spectrum.

type quantify_plot:

bool, optional

param max_undetectable_w_fr:

Maximum allowed weight fraction for undetectable elements (default: 0). Total mass fraction of fitted elements is forced to be between [1-max_undetectable_w_fr, 1]

type max_undetectable_w_fr:

float, optional

param force_single_iteration:

If True, quantification will be run for a single iteration only (default: False).

type force_single_iteration:

bool, optional

param interrupt_fits_bad_spectra:

If True, interrupt fitting if spectrum is detected to lead to poor quantification (default: False).

type interrupt_fits_bad_spectra:

bool, optional

param standards_dict:

Dictionary of standard values to use for quantification.

type standards_dict:

dict, optional

param plot_signal:

Whether to plot the fitted spectrum.

type plot_signal:

bool, optional

param plot_title:

String printed as plot title.

type plot_title:

str

param zoom_plot:

Whether to zoom on a specific line.

type zoom_plot:

bool, optional

param line_to_plot:

Line to zoom on.

type line_to_plot:

str, optional

param print_results:

If True, prints all fitted parameters and their values (default: True).

type print_results:

bool, optional

param quant_verbose:

If True, prints quantification operations

type quant_verbose:

bool, optional

param fitting_verbose:

If True, prints fitting operations

type fitting_verbose:

bool, optional

returns:

quantifier – The quantifier object containing the results, fit parameters, and methods for further analysis and plotting.

rtype:

XSp_Quantifier