#!/usr/bin/env python3 """Could today's weaker field raise oxygen escape? A scaling estimate against what one storm does. Fact-Checked Science, November 2026, for the paper check "ring-current-oxygen" ("Our analysis"). The rules were written before computing: RULES_field_scaling.txt, beside this script. Standard library only. Run it python3 field_scaling.py [folder] Reads oxygen-budget.json, which oxygen_budget.py writes into the same folder (default: ./ring-current-oxygen-data), and writes field-scaling.json there. What it computes Polar-cap area, and so polar-cap escape if escape is proportional to that area (the case most favourable to a weaker field raising escape; Gunell et al. 2018 as described by Tsareva et al. 2020), scales as M^(2 gamma - 1), with the magnetopause standoff as M^(1/3) and the polar-cap width as M^(gamma - 1/2) for gamma = 0, 1/3 and 1/2 (Glassmeier et al. 2004, Ann. Geophys. 22, 3669). M is the dipole moment: 0.91 of its 1840 value today and 0.924 of its 1900 value in 2025, as our guide to the field gives them. Storm factors: Slapak et al.'s (2017) fit from Kp 0 to Kp 9, and the May 2024 window's mean rate against the 2016-2025 mean (both from oxygen-budget.json). Added after the fresh review: amounts as well as rates. The storm's escape above the 2016-2025 mean rate, against a year's extra escape from the field's factor, on the typical-year rate and on Gunell et al.'s 2 kg/s. """ import hashlib import json import math import os import sys RULES_SHA256 = "0b32cf633db842c7c71563783d4f6137d204e3d18d9cc96f0fdda35df4d098d7" def main(): folder = sys.argv[1] if len(sys.argv) > 1 else "ring-current-oxygen-data" rules = os.path.join(os.path.dirname(os.path.abspath(__file__)), "RULES_field_scaling.txt") if os.path.exists(rules): got = hashlib.sha256(open(rules, "rb").read()).hexdigest() print("rules SHA-256 %s (%s)" % (got, "as registered" if got == RULES_SHA256 else "NOT the registered file")) bud = json.load(open(os.path.join(folder, "oxygen-budget.json"), encoding="utf-8")) res = {"area_factor": {}, "standoff_RE": {}} for label, ratio in (("today vs 1840", 0.91), ("2025 vs 1900", 0.924)): for g in (0.0, 1.0 / 3.0, 0.5): f = ratio ** (2 * g - 1) res["area_factor"]["%s, gamma=%.3f" % (label, g)] = f print("%s, gamma = %.3f: polar-cap area (escape) x %.3f" % (label, g, f)) res["standoff_RE"][label] = 10.0 * ratio ** (1.0 / 3.0) print("%s: magnetopause standoff 10 RE -> %.2f RE" % (label, res["standoff_RE"][label])) res["kp9_vs_kp0"] = math.exp(0.45 * 9) res["storm_vs_2016_2025_mean"] = bud["A_central"]["mean_rate_ions_per_s"] / bud["E_annual"]["mean_rate_ions_per_s"] print("storm factors: Kp 9 against Kp 0, x %.1f; May 2024's window against the 2016-2025 mean, x %.1f" % ( res["kp9_vs_kp0"], res["storm_vs_2016_2025_mean"])) worst = max(res["area_factor"].values()) res["decision_as_registered"] = worst < 1.2 and min(res["kp9_vs_kp0"], res["storm_vs_2016_2025_mean"]) > 10 print("decision as registered (field factor < 1.2 and every storm factor > 10): %s" % res["decision_as_registered"]) # Added after the fresh review: the storm's factor lasts 3.5 days, the field's all year. Compare amounts: # the storm's escape above the 2016-2025 mean rate, against a year's extra escape from the field's factor, # on the typical-year rate (Slapak fit) and on Gunell et al.'s 2 kg/s. storm_t = bud["A_central"]["kg"] / 1000.0 typical_t = bud["E_annual"]["kg_per_yr"] / 1000.0 gunell_t = bud["F_gunell"]["kg_per_yr_high"] / 1000.0 excess_t = storm_t - typical_t * 3.5 / 365.25 res["year_comparison"] = {"storm_t": storm_t, "storm_excess_over_mean_t": excess_t, "typical_year_t": typical_t, "gunell_2kg_s_year_t": gunell_t, "field_extra_per_year": {}} for g in (0.0, 1.0 / 3.0, 0.5): f = res["area_factor"]["today vs 1840, gamma=%.3f" % g] add_typ, add_gun = typical_t * (f - 1), gunell_t * (f - 1) res["year_comparison"]["field_extra_per_year"]["gamma=%.3f" % g] = { "on_typical_year_t": add_typ, "on_gunell_2kg_s_t": add_gun, "storm_excesses_typical": add_typ / excess_t, "storm_excesses_gunell": add_gun / excess_t} print("gamma = %.3f: the field adds %.0f t a year on the typical-year rate (%.2f storm excesses), %.0f t on 2 kg/s (%.2f)" % ( g, add_typ, add_typ / excess_t, add_gun, add_gun / excess_t)) print("the storm sent %.0f t, %.0f t above the 2016-2025 mean rate over its 3.5 days" % (storm_t, excess_t)) with open(os.path.join(folder, "field-scaling.json"), "w", encoding="utf-8", newline="\n") as f: json.dump(res, f, indent=1) f.write("\n") if __name__ == "__main__": main()