fit_telluric_scaling¶
Fit the airmass that best matches a telluric template to ctx.spectrum.
| Category | Corrections |
| Backend | scipy - implemented here on top of scipy primitives |
| Version | 1.0.1 |
| Reads | ctx.spectrum (a Spectrum1D) |
| Writes | extras.telluric_fit, extras.telluric_template_scaled, metrics.telluric_airmass_fit |
Only wavelengths inside the telluric bands carry information for this fit. The algorithm restricts the residual to the regions where the template transmission drops below band_threshold (default 0.9 — i.e. pixels where the template absorbs at least 10%). Outside those regions the spectrum is dominated by continuum / stellar lines and would only bias the fit. The rescaled template is written to ctx.extras['telluric_template_scaled'] (on the observed wavelength grid), which remove_telluric_division picks up by default.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
template_key |
'telluric_template' |
- | Where to read the template from ctx.extras (output of synth_telluric). |
band_threshold |
0.9 |
- | Pixels of the template where T < threshold count as 'inside a band'. |
airmass_min |
0.5 |
- | Lower bound of the airmass search interval. |
airmass_max |
4.0 |
- | Upper bound of the airmass search interval. |
Use it¶
{
"tool": "fit_telluric_scaling",
"arguments": {
"session_id": "<session_id>",
"params": {
"template_key": "telluric_template",
"band_threshold": 0.9,
"airmass_min": 0.5,
"airmass_max": 4.0
}
}
}
Every algorithm is an MCP tool of the same name; describe_algorithm returns
this page's metadata as JSON.
References¶
- Beer-Lambert atmospheric transmission scaling: T(airmass) = T(1)^airmass.
- scipy.optimize.minimize_scalar.
Related algorithms¶
air_to_vacuum- Convert the wavelength axis from air to vacuum wavelengths.barycentric_correction- Compute the barycentric (or heliocentric) correction and Julian date, and shift the spectrum.doppler_shift- Doppler-shift the wavelength axis by a radial velocity.extinction_correct_easyspec- Apply atmospheric extinction correction toctx.spectrumvia easyspec.remove_telluric_division- Remove telluric absorption by dividing the science spectrum by a reference.synth_telluric- Generate a synthetic telluric transmission spectrum.vacuum_to_air- Convert the wavelength axis from vacuum to air wavelengths.