"""Repeat our numbers for the factchecked.science page on Matthews, Dupree, Richards & Dent (2026), "New Spatially Resolved Observations of Betelgeuse from the VLA and ALMA" (AJ 172, 184; arXiv:2608.02847). python3 -I betelgeuse_pipeline.py [] 1. Fetches the paper's arXiv source files (version 1, 747 KB, CC BY 4.0) by URL, under a plain client name, into /downloads/, and checks them against the SHA-256 of the copy we used. It stops if they differ. 2. Reads them as data, in memory (read_eprint.py): nothing is compiled or run. dump_fig_pdf.py and extract_fig13.py read the 13 points of Figure 13 from the figure's vector paths, and build_data.py the paper's Tables 4, 5 and 6. 3. Runs the pre-registered tests (analysis.py; rules in RULES_analysis.txt), and writes the numbers the page uses (summarize.py) and its two charts (chart_data.py, whose phase-shift strip was added after the first run). 4. Prints the SHA-256 of each output beside the one in our log. One check, C11, compares the published version's Tables 5 and 6 with arXiv's. It needs the published PDF's text, made with `pdftotext -enc UTF-8 -layout` from https://iopscience.iop.org/article/10.3847/1538-3881/ae953d/pdf, given as the second argument. Without it the check is skipped, and so is the comparison of the full output file with our log; everything else is compared. All the scripts must sit in the same folder as this one. Standard library only. """ import hashlib import subprocess import sys import urllib.error import urllib.request from pathlib import Path UA = "factchecked-research/1.0" HERE = Path(__file__).resolve().parent EPRINT_URL = "https://arxiv.org/e-print/2608.02847v1" EPRINT_SHA256 = "dbbe05de5ef0693fc866d832c6ce1c56fcbc63f2db0ca7e32601db188fe22b68" # SHA-256 of our own outputs, as logged in analysis-log.txt LOGGED = { "fig13-points.json": "a0bb69d1ef924492f0d6e501b4a181ba63852bbe93564c0853792cf83b4c90c9", "ellipticity-data.json": "149b72742e6a0b1f8efb8440099d3518c3602f7c460a8a1fb83c653ae1058e6b", "results-summary.json": "513ea570f99e71bde9143001fbaaa917a20b7dc0e214908c8bd1bdca3a2873cb", "chart-data.json": "12f5920910eb6207b3867d362d76cb88a1ec41e745a5e2b8719fbc259d098c00", } LOGGED_FULL = {"analysis-results.json": "11e93f2be4cc23f20b1ae8c5463ade73e404444eac278560da216132af338d9c"} def sha256(path): return hashlib.sha256(Path(path).read_bytes()).hexdigest() def fetch(url, dest): if dest.exists(): print(f"have {dest.name}", flush=True) return req = urllib.request.Request(url, headers={"User-Agent": UA}) try: with urllib.request.urlopen(req, timeout=120) as r: data = r.read() except urllib.error.HTTPError as e: sys.exit(f"{url} answered HTTP {e.code}. Not retried: fetch it by hand into {dest}.") dest.write_bytes(data) print(f"fetched {dest.name}: {len(data):,} bytes", flush=True) def run(*args): cmd = [sys.executable, "-I", *map(str, args)] print("$", " ".join(Path(a).name if i == 2 else str(a) for i, a in enumerate(cmd)), flush=True) subprocess.run(cmd, check=True) def main(): if len(sys.argv) not in (2, 3): sys.exit(__doc__) work = Path(sys.argv[1]).resolve() dl, out, txt = work / "downloads", work / "out", work / "eprint-text" for d in (dl, out, txt): d.mkdir(parents=True, exist_ok=True) eprint = dl / "2608.02847v1-eprint.bin" fetch(EPRINT_URL, eprint) if sha256(eprint) != EPRINT_SHA256: sys.exit(f"{eprint.name} differs from the copy we used (SHA-256 {EPRINT_SHA256}); stopping.") if len(sys.argv) == 3: vor = Path(sys.argv[2]).resolve() have_vor = True else: vor = out / "no-published-text.txt" vor.write_text("\f" * 16, encoding="utf-8") have_vor = False print("No published-PDF text given: check C11 will be skipped.", flush=True) run(HERE / "read_eprint.py", eprint, txt) run(HERE / "dump_fig_pdf.py", eprint, "f13rev.pdf", out / "f13rev-dump.txt") run(HERE / "extract_fig13.py", out / "f13rev-dump.txt", out / "fig13-points.json") run(HERE / "build_data.py", txt / "Betelgeuse_continuum2026.tex", out / "fig13-points.json", out / "ellipticity-data.json") run(HERE / "analysis.py", out / "ellipticity-data.json", vor, out / "analysis-results.json") run(HERE / "summarize.py", out / "analysis-results.json", out / "results-summary.json") run(HERE / "chart_data.py", out / "analysis-results.json", out / "chart-data.json", out / "charts") print("\nOutputs against our log:") checks = dict(LOGGED, **(LOGGED_FULL if have_vor else {})) for name, want in checks.items(): got = sha256(out / name) print(f" {name}: {got} {'same as ours' if got == want else 'DIFFERS from ours'}") if not have_vor: print(" analysis-results.json: not compared, because its C11 part needs the published PDF's text") if __name__ == "__main__": main()