"""Single entry point: regenerates every table, number and figure of the tf_kiii study. python3 code/run_all.py # from the study directory (or from anywhere) Raw downloads are cached in fermi_raw/tf_kiii (see common.RAW); with a warm cache the whole pipeline takes a few minutes single-threaded. From a cold cache step s02 (SDSS sizes, ~8 min) and step s08 (852 small cone queries and ~1,200 image cutouts, roughly an hour) are limited by the remote services. Hand-entered inputs that are NOT regenerated (all in data/): * visual_classification.csv : blind by-eye classification of the 135 contact-sheet objects of step s13. Used only for the "with visual vetting" VARIANT, not for the primary limits. * no_photometry_notes.csv : by-eye class of the 35 broad-line HI sources with a counterpart but no usable SDSS photometry (used only in the "by-eye ordinary sources removed" accounting row). * dark_visual_notes.csv : notes on the 9 broad-line HI sources without a counterpart (not used in any number). The write-up is prepared by hand from the tables in data/ and the log of this script; no step writes it. """ import importlib import os import sys import time HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) STEPS = [ ("s01_download", "catalogue downloads (VizieR TAP)"), ("s02_build_alfalfa", "ALFALFA-SDSS sample, cuts, confusion flags, SDSS sizes"), ("s03_fit_tf", "ALFALFA-SDSS Tully-Fisher fits and residuals"), ("s04_xmatch", "2MASS XSC / AllWISE cross-match (CDS XMatch)"), ("s06_cf4", "Cosmicflows-4 sample, fits and residuals"), ("s07_union", "union sample, SIMBAD neighbours (s05), flags, dimming bookkeeping"), ("s08_vet_download", "per-object vetting downloads (cones, cutouts)"), ("s09_aperture_phot", "independent aperture photometry"), ("s10_vet_table", "vetting table and mid-infrared test"), ("s11_dark", "ALFALFA sources without optical counterparts"), ("s12_clustering", "3D clustering of residuals"), ("s13_contact_sheets", "blind contact sheets for visual vetting"), ("s14_limits", "candidate bookkeeping and upper limits"), ("s16_robustness", "robustness table, CF4 membership check"), ("s15_figures", "figures"), ] def main(): t00 = time.time() for mod, what in STEPS: t0 = time.time() print(f"=== {mod}: {what}", flush=True) importlib.import_module(mod).main() print(f" done in {time.time() - t0:.0f} s", flush=True) print(f"all steps finished in {(time.time() - t00) / 60:.1f} min") if __name__ == "__main__": main()