RULES_spotcheck.txt -- pre-registered 2026-11-06, before any storm or placebo TEC was computed ================================================================================================ Purpose ------- Rebuild note 002's TEC pipeline from the public CODE final maps and check the note's own quiet ranges (quiet_band_envelopes.csv) and recovery times (recovery_times.csv). The brief asks for 5-10 storms; because the files for all 119 storms fit the download budget, all 119 are recomputed, and the pre-registered sample below is reported separately as "the spot check". Inputs (hashes in analysis_log.md) ---------------------------------- - note 002 Drive CSVs (checked against the note's SHA256SUMS.txt): storm_inventory.csv, quiet_days_selected.csv, quiet_band_envelopes.csv, recovery_times.csv - CODE final GIMs, one IONEX file per UT day (downloads/code-gim/, fetch_log.jsonl) - IGRF-14 coefficients (igrf14coeffs.txt) Spot-check sample (fixed now) ----------------------------- 1. Seven storms drawn with random.Random(20261106).sample(sorted(storm_ids), 7). 2. Plus every storm whose NS50 row has censor_reason = no_recovery_within_168h (the note's "3 storms never re-entered the band"). 3. Plus, if none of the above has t0 before 2014-10-18 (2-hourly maps), one storm drawn with random.Random(20261106 + 1).choice from those that do. Pipeline (the note's Methods, implemented as written) ----------------------------------------------------- - Storms, t0, merges, follow-up and censoring: taken from storm_inventory.csv (already rebuilt exactly from GFZ Kp by check_storms.py: 119/119 storms match in every compared field). - Quiet days: taken from quiet_days_selected.csv (the note's own list). - Band TEC: every map point with |geomagnetic latitude - c| <= 2.5 deg (c = 30, 50, 70; north and south separately), geomagnetic latitude from the IGRF-14 centred dipole, mean over all longitudes with cos(geographic latitude) weights; NS = mean of N and S. - Quiet range at UT hour h: 2.5 and 97.5 percentiles of the quiet-day band TEC at hour h if >= 5 quiet samples exist, else of the pooled quiet-day TEC at all hours. - T_rec: first hour >= t0 at which band TEC stays inside the range for >= 12 consecutive hours (a missing map breaks a run; the run must lie inside the follow-up); otherwise censored at the end of follow-up. Implementation details the note leaves open, to be fixed by matching the note's own quiet_band_envelopes.csv (q025, q50, q975; agreement = within 0.0015 TECU, the CSV's rounding) on the spot-check sample BEFORE any placebo T_rec is computed: (a) dipole epoch: per map epoch (interpolated IGRF-14) | per year | one fixed epoch (b) longitudes: 72 (drop the repeated 180 deg meridian) | all 73 (c) percentile method: linear interpolation (numpy default) | others if needed (d) map used for 00 UT: the day's own 00:00 map | the previous file's 24:00 map (e) 2-hourly era: 12 h run = 6 consecutive 2-hourly samples | 7 samples The option set with the highest exact agreement is locked and used unchanged for all storms and placebos. Details are logged in analysis_log.md. Outputs and how they are judged ------------------------------- - Envelope agreement (fraction of storm x band x UT-hour cells within 0.0015 TECU, and the largest difference). - T_rec agreement per storm and band: exact (same hour) / within 1 h / different; recovered flag agreement. Reported for the spot-check sample and for all 119. - KM median and S(48, 72, 96, 120, 144 h) for NS50, NS30, NS70 from our own T_rec, beside the note's. No pass/fail threshold changes any later step: whatever the agreement, the placebo is run with the locked pipeline, and disagreements are reported.