#!/usr/bin/env python3 """Run every step of our check of Peterson (2026), in the order we ran them. python3 -I fetch_inputs.py # first: the inputs, about 180 MB python3 -I check_inputs.py # the values against the ones we used python3 -I run_all.py # then this: outputs go to /out/ The analysis scripts need numpy, scipy and netCDF4; keep them beside this file. The whole run takes about an hour and a half on a laptop, most of it in sea_null.py and sea_null_p95.py (simulated series) and by_pressure.py (1000 surrogate By series). The random draws are seeded, so the outputs come out the same each time. sea_null_p95.py and the corrected r1_sea.py were added after a review (RULES_post_review.txt); the page's numbers for Tests 2 and 4 come from them. Written for factchecked.science, 2026-11-15. """ import os import subprocess import sys HERE = os.path.dirname(os.path.abspath(__file__)) def run(args, capture=None): cmd = [sys.executable, '-I', os.path.join(HERE, args[0])] + args[1:] print('>', ' '.join(os.path.basename(c) if i < 3 else c for i, c in enumerate(cmd)), flush=True) if capture: r = subprocess.run(cmd, check=True, stdout=subprocess.PIPE) with open(capture, 'wb') as f: # LF line endings on every system f.write(r.stdout.replace(b'\r\n', b'\n')) else: subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL) def main(root): dl = os.path.join(root, 'downloads') out = os.path.join(root, 'out') os.makedirs(out, exist_ok=True) # Test 1: the crossing list from OMNI (pre-registered rules, then the post hoc readings) run(['hcs_list.py', dl, out]) run(['hcs_variants.py', dl, out]) run(['extrema_variants.py', dl], capture=os.path.join(out, 'extrema_variants.txt')) run(['make_lists.py', dl, out]) # Test 2: the thesis's reading on series with no link to the crossings run(['sea_null.py', out, 'RC', '200', '100', '100']) run(['sea_null.py', out, 'RA', '100', '50', '50']) run(['sea_null.py', out, 'RD', '100', '50', '50']) for tag in ('RC', 'RA', 'RD'): run(['seasonal_bias.py', dl, out, tag]) # Test 2, corrected after review: the thesis's reading at the 95th percentile, and sensitivity runs for tag in ('RC', 'RD', 'RA'): for part in ('mean', 'median', 'trend', 'phi06', 'flat', 'shift'): run(['sea_null_p95.py', out, tag, part]) # Test 3: multitaper criteria on series with no periodicity run(['multitaper_null.py', dl, out, '200']) run(['multitaper_ar1.py', out, '200']) # Test 4: R1 precipitation and surface pressure in the thesis's USA box for tag in ('RC', 'RA', 'RD'): run(['r1_sea.py', dl, out, tag]) # Test 5: By and surface pressure run(['by_pressure.py', dl, out, '1000', '200']) run(['by_pressure_polar.py', dl, out, '1000']) print('Done: outputs in', out) if __name__ == '__main__': if len(sys.argv) != 2: sys.exit(__doc__) main(sys.argv[1])