Files
aimsight-labeling/auto/analyses/SNCF01_2026-10-04T0000_2026-10-14T0645/scripts/fast_instants.py
T
maximeandClaude Opus 5.5 ddb17c2189 auto: labels requalified under the 5-noise rules (only what stands out from the noise): 32 analyses refined, the 6 paused periods verified, the long labels requalified with the fixes the period analysts found; 1153 -> 961 labels
- 32 analyses: each label kept, rewritten or removed by its analyst (section Requalification of the report; mm magnitudes where the targets have them)
- SNCF01 x3, WILDSTRUBEL 2026-09-01 -> 2026-10-06 x3: verified from their existing labels under the new rules
- long labels (no analysis): auto/analyses/long-labels/<STATION>/; NORDEND-169 and -195 run to 07/11, so NORDEND-283 and -284 (their continuation) are removed
- reading-rules.md, stations.md: the citations of removed or rewritten labels point to their successor, or to [expert]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 23:58:00 +01:00

26 lines
1.2 KiB
Python

"""Instants where a target's corr deviates >K own noises from its rolling ±4 median (passages excluded), per day,
with the targets, to bound the daytime agitation. Usage: fast_instants.py folder START END EXCL K"""
import sys, statistics
from datetime import timedelta
sys.path.insert(0, "tools/scripts")
import data, common
folder, start, end = sys.argv[1], data.parse_time(sys.argv[2]), data.parse_time(sys.argv[3])
excl = set(sys.argv[4].split(",")); K = float(sys.argv[5])
TI = {"BG.1", "F4.1", "CV.6", "CV.7", "F4.3", "F4.4"}
by = data.load(folder)
hits = {}
for s, ms in by.items():
if data.is_reference(ms) or s in TI:
continue
for col in ("corr_x", "corr_y"):
ser = [(m["t"], m[col]) for m in ms if start <= m["t"] <= end and m[col] is not None and data.iso(m["t"]) not in excl]
vals = [v for _, v in ser]
noise = common.own_noise(vals)
for i, (t, v) in enumerate(ser):
nb = vals[max(0, i - 4):i] + vals[i + 1:i + 5]
dv = (v - statistics.median(nb)) / noise
if abs(dv) > K:
hits.setdefault(t, []).append(f"{s}{col[-1]}{dv:+.1f}")
for t in sorted(hits):
print(data.iso(t), len(hits[t]), " ".join(hits[t]))