Skip to main content

peak_sum_molecular

Function peak_sum_molecular 

Source
pub fn peak_sum_molecular(
    peaks: &[PeakSpec<'_>],
    n_slices: usize,
    energies: &[f64],
    out_xx: &mut [Complex<f64>],
    out_zz: &mut [Complex<f64>],
) -> Result<()>
Expand description

Accumulate the molecular peak sum into slab-major (slice, energy) buffers.

Each peak contributes height[s] * f_xx[s] * line(E) to out_xx and height[s] * f_zz[s] * line(E) to out_zz, where line is the unit-amplitude lineshapes profile (delta + i beta). A peak with one shape row evaluates its line once per energy; a peak with one row per slice evaluates per slice.

ยงErrors

Returns [RefloxideError::InvalidParameter] naming the lineshape when a shape parameter is non-finite, or outside its per-kind domain: Gaussian width <= 0, Lorentzian gamma <= 0, Voigt sigma <= 0 or gamma < 0, pseudo-Voigt fwhm <= 0 or eta outside [0, 1]. It also fails when a height, projection or energy is non-finite. Returns [RefloxideError::InvalidShape] on length mismatches.