Windows, blends, and reversals¶
Window controls are expressed in spectral bins unless the argument name explicitly ends in _nm. They depend on wavelength sampling; a bin count is not a universal physical line width.
Baseline and bounds¶
| Control | Role |
|---|---|
window_size |
Common baseline half-window; default 4 bins |
per_line_window_size |
One baseline half-window per line; overrides the common baseline |
per_line_min_halfwin |
Lower bounds; default 4 bins for every line |
per_line_max_halfwin |
Upper bounds; by default each per-line baseline plus 8, or window_size + 8 |
allow_shrink_below_base |
Whether adaptive logic may shrink below the baseline |
max_expand_bins, max_expand_factor |
Limits on ordinary adaptive expansion |
The implementation enforces the maximum to be at least the minimum. Ensure your chosen baseline and bounds are mutually sensible and do not encompass unrelated lines.
Initial localisation and close pairs¶
max_center_shift_nm limits the first local centre search relative to the reference wavelength (default 0.015 nm). init_centres_nm can supply initial centres. use_coarse_centers enables the coarse detector with its own search, smoothing, prominence, and peak-spacing controls.
close_pairs=[(3, 4)] declares the fourth and fifth requested lines as a pair. The coarse/local initialisation logic divides the shared region at a valley to reduce line swapping. Inspect the fitted profiles to assess blending and line assignment.
Reversal candidates¶
reversal_lines=[5] marks the sixth requested line as a candidate. The detector is evaluated for that candidate in each spectrum; a detected split structure can push its window toward the configured maximum. Thresholds control peak strength, valley depth, balance, and separation. The term reversal here describes two peaks with an intervening valley in inverted space; it does not by itself mean emission above the continuum.
reversal_window_floor, the strong/weak reversal thresholds, and the huge_emission_* controls are specialised settings. Inspect the corresponding profiles before changing them. The generated reference lists their exact defaults.
Expansion around evolving profiles¶
The fitter uses local continuum estimates, depression width, and an emission proxy to adapt windows. reject_expand_if_secondary_peak=True guards against expansion toward a sufficiently strong neighbour. depth_min_for_expand, frac_for_width, secondary_peak_rel, and the emission_* parameters tune these checks.
Tune a small set of representative cases together: isolated cores, shallow lines, close pairs, asymmetric wings, and any split cores. Record the chosen parameters and compare derived velocities and intensities before processing a full time series.