#!/usr/bin/env python3 # SENSITIVITY CHECK, NOT PRE-REGISTERED: as prl_check.py but with windows anchored at the GOES >100 MeV onset (01:50 UT): # pre 23:50-01:50 UT (05:20-07:20 IST), post 01:50-04:50 UT (07:20-10:20 IST). Reported beside the pre-registered result; does not replace it. """Independent check of RULES_C C3 for PRL (stdlib only). File clock = IST (UT+5:30). pre = 00:45-02:45 UT = 06:15-08:15 IST; post = 02:45-05:45 UT = 08:15-11:15 IST; raw kV/m; 5-min means; S1, S2, S3.""" import os, sys, statistics as st sys.stdout.reconfigure(encoding="utf-8") B = sys.argv[1] def win(path, a, b): sums = {} with open(path, encoding="utf-8", errors="replace") as f: for line in f: p = line.split(",") if len(p) < 3 or p[2].strip() != "0": continue h, m, s = p[0].split(":") t = int(h) * 3600 + int(m) * 60 + int(s) if a <= t < b: k = (t - a) // 300 x = sums.setdefault(k, [0.0, 0]) x[0] += float(p[1]); x[1] += 1 return [v[0] / v[1] for k, v in sorted(sums.items())] pre_a, pre_b = (5 * 3600 + 20 * 60), (7 * 3600 + 20 * 60) post_a, post_b = (7 * 3600 + 20 * 60), (10 * 3600 + 20 * 60) rows = [] for tag in ["05082024", "05092024", "05102024", "05112024", "05122024", "05132024", "05142024"]: f = os.path.join(B, f"skbu-{tag}.efm") pre = win(f, pre_a, pre_b); post = win(f, post_a, post_b) rows.append((tag, st.mean(post) - st.mean(pre), st.stdev(post), st.stdev(post) - st.stdev(pre), len(pre), len(post))) for k, name in ((1, "S1"), (2, "S2"), (3, "S3")): order = sorted(rows, key=lambda r: -r[k]) print(name, "rank of 11 May:", [r[0] for r in order].index("05112024") + 1, "of", len(rows), "|", [(r[0][:4], round(r[k], 4)) for r in rows])