pca2d-preclean

Two frames, one fit · SPIRou, NIRPS, HARPS, HARPS-N, ESPRESSO

← Home

MEASURED

What it is worth,
measured

A factor of 3.4 where the contamination is large and the barycentric span is wide; a few percent in the optical where the tellurics have already been cleaned once; and a loss where the star never moves relative to the sky. All three are reported.

TOI-2120, the demonstration case

An M dwarf observed with SPIRou: 321 exposures over 452 days, a barycentric velocity sweeping 37.9 km/s, and deep water bands crossing the stellar lines. It is the case the method was built for, and it shows what the method can do when the geometry is favourable.

Seriesrms (m/s)MAD (m/s)Median errorReduced \(\chi^2\)
Nightly means, on the 80 epochs both series share
LBL on the delivered spectra47.9834.763.70158.7
LBL after pca2d-preclean, 1–314.2011.554.429.5
All 316 individual exposures, as the figure below plots them
LBL on the delivered spectra47.7134.997.29 
LBL after pca2d-preclean, 1–318.3414.377.90 
Paired gain in rms
3.38×
Bootstrap, 16–84 %
3.14–3.65
Epochs compared
80
Reduced \(\chi^2\)
16.6× lower

Both series come from the same LBL stage of the same run, so nothing here is one pipeline's numbers compared against another's. The two blocks measure different things and both are given: nightly means average down the photon noise, which is why their error bars are smaller and their reduced \(\chi^2\) larger. The quoted gain and its bootstrap are on the nightly means, paired over the 80 shared epochs, 2000 draws; on the individual exposures the same comparison gives 2.6×.

The velocities themselves

LBL velocities from the delivered spectra and from the corrected ones.
TOI-2120 measured twice from the same exposures: once from the spectra as delivered, once after precleaning. The scatter that collapses is the part that was never stellar.

Where it comes from

River plot around 1267 nm, before, model and after.
The water band near 1267 nm, every exposure stacked and ordered by BERV. The slanted ridges in panel 1 are the atmosphere walking across the stellar lines over the year; panel 3 is what the corrected files hold. The window scatter drops 34 %, from 0.0740 to 0.0490.

A second window, to show it is not one lucky band

River plot around 1669 nm.
The same decomposition at 1669 nm, in the methane band. Weaker contamination here, and correspondingly less to remove: the window scatter goes from 0.0470 to 0.0455, a 3 % improvement. The fit does not invent a correction where there is nothing to correct, which is as important as removing one where there is.

What the components turned out to be

With one stellar and three Earth components, the rank correlations against every quantity the headers carry are these. They are the run's own correlations.csv, not a separate analysis.

ComponentBERVairmassseeingmedian fluxtimewater
\(a_1\) star −0.389−0.183−0.603+0.395−0.192−0.057
\(b_1\) Earth −0.093+0.099+0.356−0.540+0.571−0.138
\(b_2\) Earth −0.737+0.005+0.165+0.232+0.164−0.249
\(b_3\) Earth −0.248−0.032+0.051−0.185+0.805−0.073

Three things are worth saying plainly about this table, because none of them is what one would have predicted:

The stellar component's strongest partner is the seeing, at −0.603, with the median flux at +0.395: \(a_1\) is largely tracking how much light went down the fibre, which is a line-shape effect rather than a photospheric one. On a star where activity mattered more, one would expect this row to look different.

Rank correlation of every coefficient against every ancillary quantity.
The same table as the run draws it, over all 316 exposures. Blue is anticorrelated, red correlated; only cells above 0.3 in absolute value carry a printed number.

Where it pays: faint targets

Five campaigns across two spectrographs, each measured before and after on the epochs the two series share. The gain is ordered by the SNR of the individual exposures, and ordered perfectly:

The gain in RV rms against the median SNR per exposure, for five campaigns.
Gain in RV rms against median SNR per exposure. Error bars are paired bootstraps over epochs, 2000 draws. The dashed line is a power law fitted to the five points, gain ∝ SNR−0.45.
StarInstrumentSNREpochsrms inrms outGain
TOI-2120SPIRou338047.9814.203.38×
TOI-1452NIRPS3851101.4369.371.46×
GJ 328NIRPS181469.349.031.03×
GJ 1NIRPS2331402.542.560.99×
ProximaNIRPS2872502.963.290.90×

Faint targets gain; bright ones do not. On a photon-starved spectrum the contamination is comparable to the noise and worth removing. On a bright one it is already below the noise, and fitting it costs more than it returns: Proxima comes out 10 % worse.

Two caveats. The rank ordering is perfect, but it rests on five campaigns: a clear trend, not an established law, and the power-law index should not be read as a prediction. And the table mixes two code versions: TOI-2120 runs on the current code, while the four NIRPS rows predate the fixes of 15 and 16 October (deep line cores no longer clipped, the template high pass, LBL's HE profile). They will be rerun on one version, Proxima first.

Three HARPS campaigns, three ways

TOI-2120 is the favourable case. The harder test is the optical, where the tellurics have already been cleaned once and what is left is a residual of a residual. Each star below is measured three ways on the same exposures, in a single instrument mode, with the same frozen version of the code.

StarPipelinerms (m/s)MAD (m/s)Error bar
HD 10700
G8V, 86 epochs
ESO DRS, CCF2.161.690.34
LBL, telluric-cleaned2.191.750.38
+ pca2d-preclean2.071.570.49
HD 69830
K0V, 150 epochs
ESO DRS, CCF3.713.570.34
LBL, telluric-cleaned3.733.490.36
+ pca2d-preclean3.503.290.50
GJ 581
M3V, 116 epochs
ESO DRS, CCF9.8311.681.37
LBL, telluric-cleaned9.6212.060.84
+ pca2d-preclean9.0610.760.91

GJ 581's CCF row excludes three exposures where the DRS fails outright, returning −591 to −655 m/s where LBL finds −3 to +12; with those three the CCF rms is 97.8 m/s. pca2d-preclean is the only one of the three pipelines to beat the CCF on all three stars, and the gain is concentrated in the tails: it straightens the worst exposures more than it improves the median one, which is why the MAD moves less than the rms.

The gains in the optical are small, and that is the honest reading. A few percent on a 2 m/s star is not a breakthrough; it is a consistent improvement that holds across spectral type. The factor of three on TOI-2120 is what the method does when the contamination is large and the BERV span is wide. Both numbers are the method.

When it does not help

The separation of the two blocks rests entirely on the star moving relative to the sky. Take that away and the fit has no information to work with, and a fit with no information still returns an answer.

TOI-4552, wide BERV span
2× better
Same star, 0.7 km/s span
2.4× worse

Two slices of the same campaign, identical in every other respect. A campaign observed over a narrow range of barycentric velocity should not be precleaned this way, and the run's own report plots the BERV coverage on its first pages so that the question is asked before the answer is believed.

Other failure modes found by measurement. Two stellar components go degenerate on TOI-2120: the second amplitude starts tracking the sky, absorbs a 232 m/s shift, and the rms climbs to 67 m/s. A shared basis across several objects needs shared nights, not merely similar SNR: fitting GJ 1, Proxima and a third target together with only two nights in common made GJ 1 worse (3.04 against 2.61 solo).

How these numbers were produced

  1. One code version per comparison. Every star in a comparison runs on the same commit, frozen before the first run and recorded in the output. If a fix lands mid-campaign, everything is redone, even when the fix is provably cosmetic, because traceability is the point, not numerical equivalence.
  2. One instrument mode per star. The mode with the most epochs, never a mixture.
  3. Paired comparisons only. The same exposures on both sides, matched by timestamp; an epoch missing from either series is dropped from both.
  4. Robust statistics beside the plain ones. rms and MAD = 1.4826 × median absolute deviation, always both, because a correction that fixes the tails and a correction that fixes the core are different things.

Every run writes its resolved configuration, its component counts, its LBL version and a PDF report of around thirty pages beside its outputs, so any number on this page can be traced back to the run that produced it.