"""Dipole moment and axis at the storms' dates, and what the change does to L at a fixed place at 820 km. Fact-Checked Science ("Our analysis"), 16 November 2026, for the check of Pierrard et al. (2026), npj Space Exploration 2, 43 (doi:10.1038/s44453-026-00064-7). What it does Reads the IGRF-14 dipole series that factchecked.science publishes with its guide to Earth's magnetic field (magnetic-field-guide-numbers.json), interpolates the dipole moment, tilt and pole linearly to each storm's date (after 2025.0 the series is IGRF-14's secular-variation forecast), and works out, in a centred dipole, what the change since 17 March 2015 does to L at 820 km: nothing from the moment alone (L is geometric); the inward move of a drift shell that keeps its magnetic flux (L*); the outward move of a McIlwain L computed with a fixed reference moment; and the largest change of L at a fixed geographic place from the shift of the dipole axis. Needs Python 3.9+ (standard library only). Run python3 dipole.py (fetch_inputs.py fetches the file from https://factchecked.science/magnetic-field-guide/magnetic-field-guide-numbers.json and checks its SHA-256.) """ import datetime as dt import hashlib import json import math import sys RE = 6371.2 ALT = 820.0 def decyear(d): start = dt.date(d.year, 1, 1) n = (dt.date(d.year + 1, 1, 1) - start).days return d.year + ((d - start).days + 0.5) / n def interp(series, key, y): s = sorted(series, key=lambda r: r["epoch"]) for a, b in zip(s, s[1:]): if a["epoch"] <= y <= b["epoch"]: w = (y - a["epoch"]) / (b["epoch"] - a["epoch"]) return a[key] + w * (b[key] - a[key]), b["forecast"] raise ValueError(y) def unit(lat, lon): la, lo = math.radians(lat), math.radians(lon) return (math.cos(la) * math.cos(lo), math.cos(la) * math.sin(lo), math.sin(la)) def main(): if len(sys.argv) != 3: sys.exit("usage: python3 dipole.py ") with open(sys.argv[1], "rb") as f: raw = f.read() g = json.loads(raw.decode("utf-8")) series = g["field_decline"]["dipole_series"] storms = { "17 March 2015": dt.date(2015, 3, 17), "23 June 2015": dt.date(2015, 6, 23), "11 May 2024": dt.date(2024, 5, 11), "11 October 2024": dt.date(2024, 10, 11), "1 June 2025": dt.date(2025, 6, 1), "20 January 2026": dt.date(2026, 1, 20), "4 July 2026": dt.date(2026, 7, 4), } out = {"source": "IGRF-14 dipole series of factchecked.science/magnetic-field-guide/ " "(magnetic-field-guide-numbers.json), interpolated linearly between five-year epochs; " "values after 2025.0 use the 2025-2030 secular-variation forecast", "input_sha256": hashlib.sha256(raw).hexdigest(), "dates": {}} ref_m = None ref_axis = None for name, d in storms.items(): y = decyear(d) m, fc = interp(series, "M_1e22_Am2", y) lat, _ = interp(series, "pole_lat", y) lon, _ = interp(series, "pole_lon", y) tilt, _ = interp(series, "tilt_deg", y) ax = unit(lat, lon) if ref_m is None: ref_m, ref_axis = m, ax ang = math.degrees(math.acos(max(-1.0, min(1.0, sum(p * q for p, q in zip(ax, ref_axis)))))) out["dates"][name] = dict(decimal_year=round(y, 4), M_1e22_Am2=round(m, 4), forecast_segment=fc, change_vs_17Mar2015_pct=round(100 * (m - ref_m) / ref_m, 3), tilt_deg=round(tilt, 3), pole_lat=round(lat, 3), pole_lon=round(lon, 3), axis_angle_vs_17Mar2015_deg=round(ang, 3)) # L at a fixed place, centred dipole: L = (r/RE) / cos^2(lambda_m); independent of M. r = (RE + ALT) / RE lines = {} max_ang = max(v["axis_angle_vs_17Mar2015_deg"] for v in out["dates"].values()) for L in (1.9, 2.4, 3.8): lam = math.acos(math.sqrt(r / L)) dLdlam = 2 * L * math.tan(lam) # per radian of magnetic latitude dm = (out["dates"]["11 May 2024"]["change_vs_17Mar2015_pct"] / 100.0, out["dates"]["4 July 2026"]["change_vs_17Mar2015_pct"] / 100.0) lines[str(L)] = dict( magnetic_latitude_at_820km_deg=round(math.degrees(lam), 2), dL_from_moment_change_alone=0.0, dL_if_L_star_at_fixed_flux_May2024_Jul2026=[round(L * x, 4) for x in dm], dL_mcilwain_fixed_reference_moment_May2024_Jul2026=[round(L * ((1 + x) ** (-1 / 3) - 1), 4) for x in dm], dL_at_fixed_place_from_axis_shift_max=round(dLdlam * math.radians(max_ang), 4)) out["L_at_820km"] = lines out["notes"] = ("In a centred dipole L depends only on distance and magnetic latitude, so a change of the moment " "alone moves no field line. A drift shell holding the same magnetic flux (Roederer's L*) moves " "inward by the moment's fractional change; a McIlwain L computed with a fixed reference moment " "moves outward by a third of it. The axis shift changes the magnetic latitude of a fixed " "geographic place by up to the angle between the axes; the authors compute L from IGRF for each " "date, so their L bins follow the field, not geography.") with open(sys.argv[2], "w", newline="\n", encoding="utf-8") as f: json.dump(out, f, indent=1) print(json.dumps(out, indent=1)) if __name__ == "__main__": main()