"""Single entry point: regenerates every number, table and figure of the study. python3 run_all.py # about 20 minutes on one core (network caches present) python3 run_all.py --full # also clears the geometry caches and re-queries JPL Horizons # (308 daily ephemerides + about 4,000 single-date queries) and the # PDS ODE REST service (1,300 points): roughly 3-4 h, dominated by Horizons Steps s00_download raw inputs -> fermi_raw/seta_haystack (or $SETA_RAW); skipped if present s01_neo_completeness known near-Earth asteroids / debiased population models s01b_discovery_geometry (revision) solar elongation and magnitude of real near-Earth asteroids on the night of first observation: two-body for short-arc orbits, JPL Horizons for the rest (cached) s02_calibrate_surveys survey simulator: elongation weight MEASURED from s01b (for each depth variant), nightly probabilities fitted to the NEO discovery history (7 variants) s03_fetch_earthlike_ephem JPL Horizons ephemerides of real Earth-like and co-orbital asteroids (cached) s04_fetch_ode_samples random-point image coverage of the Moon (LROC NAC) and Mars (CTX, HiRISE) (cached) s06_belts catalogue completeness from the main belt outward (MPCORB) s07_surfaces HiRISE union coverage from the PDS index; summary of the point samples s08_recognition how artificial objects catalogued as asteroids were recognised; characterisation rates s05_parked_orbits detection probability for objects parked near Earth; tests on real objects, minimoons and human hardware s09_interstellar interstellar objects: count, effective survey volume, density limits s10_synthesis completeness matrix in three tiers, recognition model, probability of having been found s11_figures figures/*.png Inputs that are not downloaded: data/neo_population_models.csv (transcribed by hand from Table 3 of Nesvorny et al. 2024, NEOMOD2, which also tabulates Harris & Chodas 2021; checked row by row by the referee). The catalogues change daily: a rerun on a later date reproduces the method, not the exact counts (the numbers in the report are for downloads made on 2026-10-12). """ import os import subprocess import sys import time HERE = os.path.dirname(os.path.abspath(__file__)) STEPS = ["s00_download", "s01_neo_completeness", "s01b_discovery_geometry", "s02_calibrate_surveys", "s03_fetch_earthlike_ephem", "s04_fetch_ode_samples", "s06_belts", "s07_surfaces", "s08_recognition", "s05_parked_orbits", "s09_interstellar", "s10_synthesis", "s11_figures"] REFRESHABLE = {"s01b_discovery_geometry", "s03_fetch_earthlike_ephem", "s04_fetch_ode_samples"} CACHES = ["neo_orbit_hists.npz", "granvik_sample.csv", "granvik_class_fractions.csv"] def main(): full = "--full" in sys.argv only = [a for a in sys.argv[1:] if not a.startswith("--")] if full: for c in CACHES: p = os.path.join(os.path.dirname(HERE), "data", c) if os.path.exists(p): os.remove(p) for c in ("neo_orbit_hists_stage1.npz", "neo_orbit_hists_variants.npz"): p = os.path.join(os.environ.get("SETA_RAW", "fermi_raw/seta_haystack"), c) if os.path.exists(p): os.remove(p) t00 = time.time() for s in STEPS: if only and s not in only: continue t0 = time.time() cmd = [sys.executable, "-u", os.path.join(HERE, s + ".py")] if full and s in REFRESHABLE: cmd.append("--refresh") print(f"\n===== {s} =====", flush=True) r = subprocess.run(cmd, cwd=HERE) if r.returncode != 0: sys.exit(f"{s} failed with exit code {r.returncode}") print(f"===== {s} done in {time.time() - t0:.0f} s =====", flush=True) print(f"\nall steps done in {(time.time() - t00) / 60:.1f} min") if __name__ == "__main__": main()