Where this fits
In the near infrared, APERO has already removed the tellurics before pca2d ever sees the data, and the fit works on what APERO left behind. In the optical (HARPS, HARPS-N, ESPRESSO) the spectra arrive with the atmosphere still in them, so LBL's telluric cleaning runs first and pca2d fits the residuals of that cleaning.
That makes the quality of the telluric step part of this pipeline's business, and two things about it were changed in the course of this work: how the absorption is measured, and what it is measured against.
The absorption model
An atmospheric transmission spectrum, to first order, scales as a power of a reference transmission: Beer-Lambert with the column as the exponent. Two components suffice for a radial-velocity pipeline:
\(\alpha\) tracks the precipitable water vapour, which changes on the timescale of minutes; \(\beta\) tracks everything that scales with the dry airmass (O\(_2\), CO\(_2\), CH\(_4\)), which is smooth and predictable. Both are fitted per exposure, \(\beta\) free rather than pinned to the airmass, because at a given airmass the dry column still depends on the pressure at the summit.
Measuring the exponents from the derivative
The classical way to find \(\alpha\) is a cross-correlation against a telluric template. It works, but it has a weakness: a CCF is sensitive to anything that looks like a shifted copy of the template, including the stellar lines, and it degrades when the water lines are shallow.
The alternative used here asks a sharper question. A correctly removed absorption line leaves a smooth spectrum behind; an incorrectly removed one leaves a kink. So minimise the scatter of the derivative of the corrected spectrum:
where the variance is taken over the telluric-bearing pixels only, with photon weights. The criterion is scanned over \(\alpha \in [0.002,\,2.5]\) before a simplex refines it, because the cost surface has a shallow floor and a simplex started in the wrong place walks into it.
| Method | Scatter of the gradient | Change |
|---|---|---|
| Uncorrected | 344.8 | - |
| LBL's CCF loop | 359.6 | +4.3 % (worse) |
| Derivative criterion | 304.1 | −11.8 % |
The CCF loop making things actively worse on this star is not a typo: on a line-dense spectrum, without a template to divide by, the correlation locks onto stellar structure.
What it is measured against: the template is not optional
This is the part that is easy to get wrong, and this project got it wrong before getting it right. The fit must be performed on the spectrum divided by the stellar template, never on the raw spectrum.
Without the division, the criterion sees the entire stellar spectrum. On a star dense in lines, the derivative scatter is dominated by the photosphere, and the shallow telluric signal it is supposed to measure contributes almost nothing. The procedure is therefore three passes, and APERO has always done it this way:
- Clean without a template. A first approximation, good enough to build on.
- Build the stellar template from the spectra cleaned that way.
- Re-clean the raw spectra with that template, the fit now running on \(s/\bar{S}\).
What the division buys, measured on GJ 581 (M3V): of five exposures that had been falling back to a default value for want of a measurable signal, three converge to a real measurement (0.0275, 0.1486, 0.0347) as soon as a template, even a crude one, is divided out.
When there is nothing to measure
On a late M dwarf the water lines are genuinely faint against the stellar forest: a 5 % water line is 2.8 σ per pixel on GJ 581 where it is 13.4 σ on HD 10700. When the cost curve is flat (less than 5 % of span) or its minimum sits on the edge of the scan, the fit refuses to report a number and falls back to a default column.
Refusing is the right answer, and the fallback exposures are not thereby ruined: the residual, scaled by SNR, comes out at 1.70 for fallback exposures against 1.85 for measured ones on HD 10700, and 1.74 against 1.77 on HD 69830. A default column is a perfectly good estimate when the data cannot improve on it.
Making it fast
The first working version took 16.55 s per exposure, of which 14.16 s was a double Python loop propagating saturation contamination outward from each blanked pixel. The same operation is a pair of running maxima:
With that, plus building the convolved transmission grid only over the wavelength spans that actually constrain the fit (margins half a kernel wide, merged, and snapped to the grid so the convolution phases match), the cost went from 16.55 s to 0.49 s per fit.
No logic changed: the two versions return the same exponents.
Two fibres are two instruments
HARPS has been through two fibre configurations, HAM (the 1″ fibre) and EGGS (the 1.4″ one), and they have different instrumental profiles and different velocity zero points. Mixing them in a single series puts a step function in the middle of the time series that no amount of precleaning will fix.