Write the orbit fit of an exoplanet radial-velocity survey (three instruments with their own formats, zero points, eras and jitters; stellar activity with its indicators; planet detection with false planets costing as much as missed ones) as a program that runs on any star's RV bundle; it is run on further bundles from the same survey within a per-bundle compute budget.
harbor run -t reactive-labs/rv-orbit-fittingharbor download reactive-labs/rv-orbit-fittingYou are Pablo Oyarzun, postdoc with the Ventisca Nearby Planets Survey (VNPS) at Ventisca Ridge Observatory. The
survey measures radial velocities of nearby stars with CALDERA, the echelle spectrograph of the 2.3-m telescope,
and before 2024 with ROCA on the same telescope; for six stars a partner observatory has shared its KESTREL
velocities. Today is Monday 4 January 2027. Ines Achaval, the survey PI, wants every star of the sample fitted the
same way by one program before the orbit review on 14 January (her mail is in /app/inputs/mail/). Tomasz
Wierzbicki will run it on all survey stars and on the survey's completeness mocks.
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:
rvdb/: eight RV bundles, one folder per star (manifest.json, caldera_rv.csv, and where they exist
roca_rv.rdb and kestrel_rv.txt).docs/: the note on the bundles, the ROCA instrument history, the KESTREL data note, the VNPS RV data standard
(VNPS-STD-002 rev 2), the CALDERA DRS manual, technical notes VNPS-TN-044 and CALDERA-TN-031, and the 2026A
survey plan.logs/: the CALDERA e-log and an IT ticket.catalog/: the survey target catalogue v4.legacy/: a former postdoc's periodogram script.mail/: Ines's request./app/output/fit_orbits.py, run as
python3 /app/output/fit_orbits.py <bundle_dir> <out.json>
It reads one bundle in the format of those in rvdb/ and writes one JSON object:
{"target": "VNPS 022",
"n_planets": 1,
"planets": [{"period_d": 31.77, "k_ms": 11.4, "e": 0.17, "omega_deg": 40.1, "tperi_bjd": 2460423.1}],
"trend_ms_per_yr": 0.0,
"offsets_ms": {"CALDERA": 2.1, "ROCA-1": -45830.2, "...": 0.0},
"jitter_ms": {"CALDERA": 1.1, "ROCA": 2.4, "KESTREL": 2.6},
"activity_periods_d": [38.0]}
| Key | Content |
|---|---|
n_planets, planets |
the planets you claim, one entry each, n_planets equal to the length of the list |
period_d |
orbital period, days |
k_ms |
radial-velocity semi-amplitude, m/s, positive |
e |
eccentricity |
omega_deg |
argument of periastron of the star's orbit, degrees, with RV = K [cos(nu + omega) + e cos(omega)] |
tperi_bjd |
a time of periastron passage, BJD_TDB (full Julian date) |
trend_ms_per_yr |
linear acceleration of the star on the VNPS-STD-002 velocity scale, m/s per year (0 if none) |
offsets_ms |
the zero point you fitted for each instrument or instrument segment, m/s; names your choice, each starting with the instrument name (CALDERA, ROCA, KESTREL) |
jitter_ms |
the extra white noise of each instrument present in the bundle, m/s, keys CALDERA, ROCA, KESTREL |
activity_periods_d |
periods in days you attribute to the star's rotation rather than to a planet (empty list if none) |
The program runs with Python 3.12, numpy, scipy and pandas, on one CPU core with 2 GB of memory and no network,
and must finish a bundle within 40 seconds; bundles hold from about 25 to 300 velocities. 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/<bundle>.json for each of the eight bundles in rvdb/ (for example
/app/output/results/VNPS022.json): the program's output for that bundle.
Tomasz runs your program on 47 further bundles of the same kind: completeness mocks on the eight stars in hand and on the other survey stars (each star's instruments, sampling and noise, with planets, rotation, activity level and nuisances drawn from the survey's simulation model), and further survey stars as they are, with the true orbits known. Your eight result files are compared in the same way.
Per bundle, a true planet is one the data must reveal when its search signal-to-noise exceeds 7, its period is below two thirds of the time span T of the bundle, and it is not within 10 % of the rotation period or half of it. With w_i = 1 / (err_i^2 + jitter^2 + (0.6 x rms of the activity signal)^2) over all velocities, a planet's signal-to-noise is K sqrt(sum_i w_i / 2) sqrt(1 - e^2). Its search signal-to-noise follows the survey's strongest-first search: the same expression with each w_i replaced by 1 / (1 / w_i + sum of K_j^2 (1 - e_j^2) / 2 over the true planets of lower signal-to-noise), whose signals are still in the data when this one is sought. Other true planets neither earn nor cost anything. Each claimed planet is matched to the true planet of nearest period (within 2 %, or 5 tol_P when larger; a true planet with a period above 2T/3 also matches a claim above T/3); a claimed planet matched to no true planet is a false planet, unless its period is within 10 % of the rotation period or half of it, where it is neither credited nor counted.
| Part | Weight | Credit |
|---|---|---|
| planet list | 0.35 | S = found / (planets the data must reveal + false planets); 1 when both are zero |
| orbits | 0.40 | mean over the planets the data must reveal of 0.35 P + 0.35 K + 0.20 e + 0.10 mean longitude at BJD 2461000.0 (0 for a missed planet; equal to S when there are none) |
| rotation | 0.15 x S | when the indicators show the rotation clearly (signal-to-noise of the rotational modulation in the indicators above 25), 1 if a reported activity period is within 20 % of P_rot or P_rot/2, else 0; otherwise 1 for none or a matching one, 0.5 for others |
| trend | 0.10 x S | trend_ms_per_yr |
Each quantity earns full credit within its band tol and falls linearly to zero at 3 tol. With
sigma_K = sqrt(2 / sum_i w_i): tol_P = 2.2 sigma_K P^2 / (K T sqrt(1-e^2)) + 1e-5 P,
tol_K = 4.1 sigma_K / sqrt(1-e^2) + 0.05 m/s, tol_e = 3.2 sigma_K / K + 0.01, tol on the mean longitude
4.5 sigma_K / K radians + 0.5 degrees, and for the trend 8.5 times its statistical uncertainty (same weights, time
spread within each instrument) + 0.1 m/s per year.
A bundle on which the program fails, runs out of time, writes no readable JSON, leaves out a key or writes a non-finite number scores zero, and so does every bundle not started within 30 minutes of program run time. With M the mean over the 47 further bundles and V the mean over your eight result files, the score is min(1, (0.8 M + 0.2 V) / 0.94). Some required planets sit close to the detection limit, and the survey's own pipeline scores 0.94 on this measure, so matching it earns full marks.