Files
aimsight-labeling/auto/analyses/LENZSPITZE_2026-10-23T2355_2026-11-01T1140/scripts/requal_instant.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

25 lines
1.2 KiB
Python

"""Deviation of every target (corr_x, corr_y) from the median of its ±12 neighbours, in its batch noise, at given instants;
the 6 largest, and rejected sensors. usage: requal_instant.py T1 T2 ..."""
import sys, statistics
sys.path.insert(0, 'tools/scripts')
from data import load, parse_time, is_reference, rejected
from common import own_noise
B0, B1 = parse_time('2026-10-23T23:55Z'), parse_time('2026-11-01T11:40Z')
by = load('data/LENZSPITZE')
for T in sys.argv[1:]:
t = parse_time(T); devs = []; rej = []
for s, ms in by.items():
ms = [m for m in ms if B0 <= m['t'] <= B1]
idx = next((i for i, m in enumerate(ms) if m['t'] == t), None)
if idx is None: continue
if rejected(ms[idx]): rej.append(s)
if is_reference(by[s]): continue
for c in ('corr_x', 'corr_y'):
v = ms[idx][c]
if v is None: continue
noise = own_noise([m[c] for m in ms if m[c] is not None])
nb = [m[c] for m in ms[max(0, idx-12):idx] + ms[idx+1:idx+13] if m[c] is not None]
if noise and nb: devs.append(((v - statistics.median(nb)) / noise, s, c))
devs.sort(key=lambda d: -abs(d[0]))
print(T, ' '.join(f"{s}{c[-1]} {d:+.1f}" for d, s, c in devs[:7]), '| rejected:', ','.join(rej))