"""Repeat our numbers for the factchecked.science page on Ugolnikov et al. (2026), arXiv:2610.41750v1, "Long-Term Trend of Noctilucent Cloud Altitude Detected". python3 -I nlc_pipeline.py 1. Fetches the preprint's PDF from arXiv and SILSO's daily sunspot numbers, by URL, under a plain client name, into /downloads/. It checks the PDF against the SHA-256 of the copy we used and stops if it differs. SILSO's file grows every day, so its hash is only reported. 2. Reads pages 10 and 6 of the PDF as data (no PDF library, nothing in it is run): dump_page.py, vector_shapes.py and extract_points.py find the plotted markers of Figures 4 and 5, and fig3_shift.py those of Figure 3. 3. Runs the pre-registered re-fit (refit.py, rules in RULES_refit.txt), the checks added after its first run (posthoc.py) and after the page's fresh review (posthoc2.py), and the page's two charts (chart_rows.py). 4. Prints the SHA-256 of each output beside the one in our log (refit-log.txt). All the scripts must sit in the same folder as this one. Standard library only. The outputs, in /out/, include the 91 plotted values read from the preprint's figures: they are for checking our numbers, not for republishing (the preprint is under arXiv's non-exclusive licence). """ 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 PDF_URL = "https://arxiv.org/pdf/2610.41750v1" PDF_SHA256 = "45bcb749e9c422ca9ecd7a4504705f748ae5b47abece1b6ca9027bb6d3d7fc88" SILSO_URL = "https://www.sidc.be/SILSO/DATA/SN_d_tot_V2.0.csv" SILSO_SHA256_OURS = "28525cc0adeb43200dc8b5fd858d184cd56f669834a3701b6c34b588ae12fe51" # SHA-256 of our own outputs, as logged in refit-log.txt LOGGED = { "fig45-points.json": "e2b24e8ca7fb9dc9815a63bcca6eb2979a50312594c460684e0ec0947166b727", "refit-results.json": "20dca1d254730f0db53da0161d37e0aae5d459535dca71883ca2d4f48cd36de0", "posthoc-results.json": "4ee9bcaf7eccd3cb2f787770561bc3ce63a9ad7a673382279aec07b9b1e12232", "fig3-shift.json": "adbfc024a82955b40bc26c9ece88d097b4a64ce91371e6c7e24e9df1c0dddba2", "posthoc2-results.json": "e18d9c0031d163cd852c7c4ccab41ef8e6aa911847d6b18608e17e6f493b2573", "chart-rows.json": "f094e9b314e01696f3dc5277a156fea745c64f533909f412b733c9cef5313eaa", } 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) != 2: sys.exit(__doc__) work = Path(sys.argv[1]).resolve() dl, out = work / "downloads", work / "out" dl.mkdir(parents=True, exist_ok=True) out.mkdir(parents=True, exist_ok=True) pdf, silso = dl / "2610.41750v1.pdf", dl / "SN_d_tot_V2.0.csv" fetch(PDF_URL, pdf) if sha256(pdf) != PDF_SHA256: sys.exit(f"{pdf.name} differs from the copy we used (SHA-256 {PDF_SHA256}); stopping.") fetch(SILSO_URL, silso) h = sha256(silso) print("SILSO file", "matches ours" if h == SILSO_SHA256_OURS else f"differs from ours ({h}); only R1b can change", flush=True) run(HERE / "dump_page.py", pdf, 10, out / "page10-content.txt") run(HERE / "dump_page.py", pdf, 6, out / "page6-content.txt") run(HERE / "vector_shapes.py", out / "page10-content.txt", out / "page10-shapes.json") run(HERE / "vector_shapes.py", out / "page6-content.txt", out / "page6-shapes.json") run(HERE / "extract_points.py", out / "page10-shapes.json", out / "fig45-points.json") run(HERE / "refit.py", out / "fig45-points.json", silso, out / "refit-results.json") run(HERE / "posthoc.py", out / "refit-results.json", out / "posthoc-results.json") run(HERE / "posthoc2.py", out / "refit-results.json", out / "posthoc2-results.json") run(HERE / "fig3_shift.py", out / "page6-shapes.json", out / "fig3-shift.json") run(HERE / "chart_rows.py", out / "refit-results.json", out / "posthoc-results.json", out / "chart-rows.json") print("\nOutputs against our log:") for name, want in LOGGED.items(): got = sha256(out / name) print(f" {name}: {got} {'same as ours' if got == want else 'DIFFERS from ours'}") if __name__ == "__main__": main()