#!/usr/bin/env python3 """POST HOC (added in wave 2, not pre-registered): the 1800 anomaly under the pre-1840 axial-dipole rates that the open archaeomagnetic models and later studies give (as reported by our check of Gubbins et al. 2006, /dipole-before-1840/; extended in wave 3 to Suttie et al. as Laj & Kissel summarize it, 11-15, and Hellio & Gillet 2018, 16 +/- 2), with the note's own method: the whole gufm1 field in 1800 rescaled to |g10|(1800) = |g10|(1840) + rate x 40. Usage: py -3.12 -I -B rate_range.py """ import json import os import sys HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) import fieldlib as fl # noqa: E402 V = sys.argv[1] gu = fl.SplineModel(os.path.join(V, "downloads", "gufm1", "gufm1.txt"), "gufm1") ig = fl.IGRF(os.path.join(V, "downloads", "igrf14", "igrf14coeffs.txt")) grid = fl.Grid(step=0.25, nmax=14) g25, h25 = ig.gh(2025.0) now = fl.anomaly(grid, g25, h25, 13) g1840 = abs(float(gu.flat(1840.0)[0])) g, h = gu.gh(1800.0) out = {"2025": {"min_F": now["min_F"], "area_Mkm2": now["area_km2_8"] / 1e6}, "rates": {}} for rate in (-1.7, -0.44, 2.28, 3.9, 5.0, 8.2, 9.9, 10.8, 11.0, 12.0, 12.5, 14.0, 15.0, 15.2, 16.0, 18.0): s = (g1840 + rate * 40.0) / abs(g[1, 0]) a = fl.anomaly(grid, g * s, h * s, 14) out["rates"][str(rate)] = {"scale": s, "min_F_1800": a["min_F"], "deepening_to_2025": a["min_F"] - now["min_F"], "area_1800_Mkm2": a["area_km2_8"] / 1e6, "growth_to_2025": now["area_km2_8"] / a["area_km2_8"]} print("%6.2f nT/yr: 1800 min %.0f nT, deepening %.0f nT, area %.2f million km2, growth %.2fx" % ( rate, a["min_F"], a["min_F"] - now["min_F"], a["area_km2_8"] / 1e6, now["area_km2_8"] / a["area_km2_8"])) json.dump(out, open(os.path.join(V, "results", "rate_range.json"), "w", newline="\n"), indent=1)