autoemx.data.Xray_lines.make_common_peak_overlaps_file module

Generate common_peak_overlaps.json: pairs of X-ray lines from different elements that lie too close to be reliably separated by an EDS detector, so that users can be warned about potentially inaccurate quantification.

The table is organised by measurement method. Only ‘EDS’ is defined here. The table stores all candidate pairs closer than MAX_CANDIDATE_SEPARATION_EV; their severity is assigned at runtime (autoemx.core.quantifier.peak_overlaps) from the separation in units of the detector sigma at the line energies, computed with the calibration of the microscope used:

  • severe: separation < 2 sigma_eff (Sparrow limit: two equal Gaussians merge into one peak)

  • significant: separation < 3 sigma_eff (overlap criterion of the fitter, see Peaks_Model)

with sigma_eff = sqrt((sigma1^2 + sigma2^2) / 2). The resolution model and these thresholds are specific to energy-dispersive detectors: whoever adds another measurement method to autoemx must define its own resolution model, severity categories and candidate pairs under a new key of “methods”.

Only lines whose area is fitted freely are considered, i.e. lines that are their own weight reference in XSp_Fitter (Ka1, La1 or Ll when La1 is absent, Ma1 or Mz1). All other lines have their area tied to a reference line of the same element, so they do not cause ambiguity. Lines made free by the user through free_area_el_lines are not included, as they depend on the fit configuration.

Line energies are taken from LineEnergies.csv. Re-run this script after modifying LineEnergies.csv, LineWeights.csv or the reference-line logic of XSp_Fitter.

autoemx.data.Xray_lines.make_common_peak_overlaps_file.build_table()[source]