normalize_to_region¶
Divide the flux by its NaN-safe mean over [wave_lo, wave_hi].
| Category | Continuum |
| Backend | numpy - implemented here on top of numpy primitives |
| Version | 1.0.0 |
| Reads | ctx.spectrum (a Spectrum1D) |
| Writes | spectrum, metrics.region_mean |
out = flux / nanmean(flux[wave_lo:wave_hi]). The window is closed at both ends and clamped to the spectrum's wavelength range. Uncertainty (if present) is scaled by |region_mean|. If the region mean is zero or non-finite the algorithm fails with a clear message rather than emitting NaN.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
wave_lo |
0.0 |
yes | Lower bound of the reference window (same unit as the wavelength axis). |
wave_hi |
0.0 |
yes | Upper bound of the reference window. |
Use it¶
References¶
- Tody 1986, Proc. SPIE 627, 733 — IRAF continuum heritage.
Related algorithms¶
compare_normalisations- Run every continuum-normalisation method onctx.spectrumand collect them.normalize_edges- Normalise a spectrum using a continuum fitted only on its line-free edges.normalize_max- Normalise a spectrum by dividing the flux by its maximum value.normalize_percentile- Normalise a spectrum by dividing the flux by a high percentile of itself.normalize_polynomial- Normalise the continuum to unity with a sigma-clipped polynomial fit.subtract_continuum- Subtract a sigma-clipped polynomial continuum, leaving the line residual.