"""EXPLORATORY (added after stations.py): the note's South Pole numbers with equal-weight (plain 12-month) annual means. Not pre-registered. Usage: py -3.12 -I southpole_equal.py """ import os import sys import numpy as np sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import ppt_lib as L # noqa: E402 import stations as S # noqa: E402 yy, mm, vv = S.read_reader(os.path.join(sys.argv[1], "reader", "Amundsen_Scott.All.station_level_pressure.txt")) ok = ~np.isnan(vv) for wt in ("days", "equal"): y, a = L.annual_means(yy[ok], mm[ok], vv[ok], weighting=wt) for s, e in ((1957, 2025), (1979, 2025)): t = L.trend_window(y, a, s, e, "M1") print(wt, s, e, f"{t['slope']:.4f} [{t['lo']:.4f}, {t['hi']:.4f}] n={t['n']}")