Write the offline radial-velocity extraction of an exoplanet survey's echelle spectrograph (etalon drift, exposure-meter weighted barycentric correction, telluric and sky handling, template matching, survey corrections) as a program that runs on any archive retrieval; it is run on further retrievals from the same instrument within a per-retrieval compute budget.
harbor run -t reactive-labs/rv-extractionharbor download reactive-labs/rv-extractionYou are Marta Ilves, postdoc with the Ventisca Nearby Planets Survey (VNPS) at Ventisca Ridge Observatory. The
survey measures radial velocities of nearby stars with CALDERA, the fibre-fed echelle spectrograph of the 2.3-m
telescope. Today is Wednesday 2 December 2026. Ines Achaval, the survey PI, wrote last night (the mail is in
/app/inputs/mail/): the orbit-fitting group needs all CALDERA velocities of 2024-2026 on one footing by
14 January, and the survey has no offline RV pipeline it trusts. She wants it written as one program that takes an
archive retrieval of one star and returns the velocities to the survey's RV standard, for every programme the
survey runs. Tomasz Wierzbicki, the instrument scientist, will run it on the whole archive.
You have 60 minutes. Whatever is in /app/output when the time is up is graded, so keep a working program saved as
you go.
In /app/inputs:
archive/: ten archive retrievals, each one star over a date range (manifest.csv, science/ with one S2D
export per exposure, calib/ with the wavelength files, etalon references and FP_FP frames the retrieval
includes).docs/: the CALDERA DRS user manual (issue 3.1), the VNPS RV data standard (VNPS-STD-002 rev 2), technical notes
VNPS-TN-044 and CALDERA-TN-031, and the 2026A survey plan.logs/: the CALDERA e-log export and an IT ticket.catalog/: the survey target catalogue v4.reference/: the observatory ephemeris table, UT1-UTC, telluric and sky line lists, CCF masks, the HE fibre
throughput table and the ThAr line list.legacy/: the previous postdoc's quick CCF script and his handover notes.mail/: Ines's request./app/output/rv_extract.py, run as
python3 /app/output/rv_extract.py <retrieval_dir> <out.json>
It reads one retrieval in the format of those in archive/ and writes one JSON object:
{"target": "VNPS 011", "rv_abs_kms": 33.08,
"exposures": {"CALDERA.2025-03-02T03:50:16.591.npz":
{"bjd_tdb": 2460736.664915, "rv": 4.21, "rv_err": 0.86, "berv": 5137.603, "drift": -1.428},
"...": {}}}
| Key | Content |
|---|---|
target |
the star (not scored) |
rv_abs_kms |
absolute barycentric RV of the star in km/s, as VNPS-STD-002 section 2 defines it |
exposures |
one entry per science exposure of the retrieval, keyed by its file name in science/ |
bjd_tdb |
BJD_TDB of the exposure (full Julian date, days), as VNPS-STD-002 1.5 defines it |
rv |
the VNPS radial velocity of VNPS-STD-002 section 1, m/s; its zero point is free (one constant per retrieval) |
rv_err |
1-sigma uncertainty of rv, m/s |
berv |
the barycentric correction c z_B of the DRS manual section 6.5 for the exposure, m/s |
drift |
the instrumental drift D of the DRS manual section 5, m/s, relative to the wavelength file the DRS assigned to the exposure |
The program runs with Python 3.12, numpy, scipy and pandas, on one CPU core with 3 GB of memory and no network,
and must finish a retrieval within 60 seconds; retrievals hold from a few to about 110 exposures. It runs as
another user from a copy of /app/output: it may load helper files you put in /app/output (found relative to
__file__), but /app/inputs is not there when it runs.
/app/output/results/<retrieval>.json for each of the ten retrievals in archive/ (for example
/app/output/results/VNPS011_20240501-20250930.json): the program's output for that retrieval.
Tomasz runs your program on 36 further retrievals from the same instrument, 2024-2026, from all four programmes of the survey plan, with the true stellar velocities, drifts and times known. Your ten result files are compared in the same way.
Per retrieval, for every science exposure:
| Quantity | Full credit within | Zero credit at |
|---|---|---|
rv, after removing the weighted median of (rv - truth) over the retrieval |
T = k sqrt(sigma^2 + s0^2), sigma the photon-noise uncertainty of the exposure; k = 2.5, s0 = 0.3 m/s (HA); k = 3.3, s0 = 1.0 m/s (HE) | 3 T |
berv |
0.03 m/s | 0.09 m/s |
bjd_tdb |
1.2 s | 3.6 s |
drift |
1.0 m/s | 3.0 m/s |
rv_err |
a factor 1.22 of sigma either way | a factor 1.82 |
and per retrieval rv_abs_kms within 0.14 km/s (zero at 0.42). Credit falls linearly in between. Missing or
non-finite values earn nothing. For each per-exposure quantity the worst exposure, and one more per 10 exposures,
are left out of the mean.
A retrieval scores F x S, where F is the mean rv credit over its exposures and S = 0.30 berv +
0.20 bjd + 0.25 drift + 0.15 rv_err + 0.10 rv_abs (means over exposures). A retrieval on which the program fails,
runs out of time or writes no readable JSON scores zero. The final score is 80 % the mean over the 36 further
retrievals and 20 % the mean over your ten result files.