Skip to main content

estimate_slit

Function estimate_slit 

Source
pub fn estimate_slit(x: &[f64], y: &[f64]) -> Option<Vec<f64>>
Expand description

Seed for slit_model: [height, position, fwhm, beamfwhm, background].

Mirrors silx estimate_slit: seed the up- and down-edges to size the beam sharpness, then take the slit centre/width from the half-maximum crossings of the background-subtracted data. silx subtracts a strip background; that filter is a separate theory (not yet ported), so the baseline here is min(y) — the same simplification the peak estimators use. beamfwhm is seeded as the average of the up/down edge FWHMs (silx’s docstring intent; its code has an index typo that reads the down-step centre instead), then clamped to silx’s [range*3/n, edge_distance/10] bounds.