Files
aimsight-labeling/auto/analyses/FLORIDA_2026-10-11T0945_2026-10-22T0315/scripts/night.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

35 lines
1.8 KiB
Python

"""Thermal labels: max deviation of Sellette 4/5 corr_x, corr_y (px, mm) from the night level (median 00:00-05:00 UTC
of the label's day, or of the next day when that night is missing), in noises (median |diff|, whole range)."""
import sys, json, statistics as st
from datetime import timedelta
sys.path.insert(0, "tools/scripts")
import data
D = sys.argv[1]
S = data.load("data/FLORIDA/")
T0, T1 = data.parse_time("2026-10-11T09:45Z"), data.parse_time("2026-10-22T03:15Z")
tg = ["Sellette 4", "Sellette 5"]
noise = {}
for s in tg:
ms = data.filter_window(S[s], T0, T1)
for c in ("corr_x", "corr_y"):
v = [m[c] for m in ms if m[c] is not None]; noise[s, c] = st.median(abs(a - b) for a, b in zip(v, v[1:]))
for line in open(D + "/work/requalify_input.jsonl"):
L = json.loads(line)
if not L["family"].startswith("Thermal"): continue
a, b = data.parse_time(L["start"]), data.parse_time(L["end"])
out = []
for s in tg:
for c in ("corr_x", "corr_y"):
for day in (0, 1):
d0 = a.replace(hour=0, minute=0) + timedelta(days=day)
nv = [m for m in data.filter_window(S[s], d0, d0 + timedelta(hours=5)) if m[c] is not None]
if len(nv) > 5: break
l = st.median(m[c] for m in nv); lmm = st.median(m[c + "_mm"] for m in nv)
iv = [m for m in data.filter_window(S[s], a, b) if m[c] is not None]
ks = [((m[c] - l) / noise[s, c], m) for m in iv]
# robust: 3rd largest |k| (a sustained cycle, not a single spike)
absk = sorted(((abs(k), k, m) for k, m in ks), key=lambda x: x[0])
k1, k3 = absk[-1], absk[-3]
out.append(f"{s} {c[-1]} max {k1[1]:+.1f}n@{data.iso(k1[2]['t'])[11:16]} ({k1[2][c+'_mm']-lmm:+.1f}mm) 3rd {k3[1]:+.1f}n [night d+{day}]")
print(L["id"], L["start"][5:16], L["end"][5:16], "|", "; ".join(out))