lineshapes
Fast, composable optical-constant models for soft X-ray work. A [Model] is a sum of
analytic Kramers-Kronig-paired peaks (Gaussian, Lorentzian, Voigt, pseudo-Voigt), a continuum
in beta (linear background + erf ionization steps) and a fixed continuum delta table.
Evaluating it returns delta + i*beta on an energy grid in eV.
use Model;
let mut m = new
.gaussian // e0, 1/e half-width, beta height
.voigt // e0, sigma, gamma (HWHM), height
.continuum
.step;
let n = m.eval; // Vec<Complex64>, single core
let n = m.eval_par; // feature "parallel" (default), rayon
// Fitting: update through the flat parameter vector instead of rebuilding.
let mut theta = m.params;
theta += 0.01;
m.set_params?;
// Or bind a fixed grid; only components whose parameters changed are recomputed.
let mut ev = new;
ev.eval_params_into?;
No Python dependency. The Python bindings live in the sibling crate lineshapes-py
(package lineshapes). Conventions: delta = H[beta] (delta < 0 below a resonance, no mirror
term at -E0); amp is the beta peak height.