Files
aimsight-labeling/auto/analyses/NORDEND_2026-08-10T0115_2026-08-23T0515/scripts/thermal_all.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.7 KiB
Python

"""Weak thermal labels: per target (all but CTR02-04), deviation from the end-of-night level (3 h before
the start), in noises, over the whole label outside the nested Visibility/Obstruction/No data labels:
the hourly median (the cycle) and the largest single point."""
import json, statistics, sys
ids = sys.argv[1:]; sys.argv = sys.argv[:1]
exec(open("labeling/auto/analyses/NORDEND_2026-08-10T0115_2026-08-23T0515/scripts/requalify.py").read().rsplit("\nfor line in open", 1)[0])
labels = [json.loads(l) for l in open(f"{D}/work/requalify_input.jsonl")]
nested = [(T(l["start"]), T(l["end"])) for l in labels if l["family"] != "Thermal displacement"]
for L in labels:
if L["id"] not in ids: continue
a, b = T(L["start"]), T(L["end"]); hr, pt = [], []
for (s, c), pts in data.items():
if s in REFS or (c, s) not in noise: continue
pre = [v for t, v in pts if a - timedelta(hours=3) <= t < a]
if len(pre) < 3: continue
m = statistics.median(pre); n = noise[(c, s)]; hours = defaultdict(list); w = []
for t, v in pts:
if a <= t <= b and not any(x <= t <= y for x, y in nested):
hours[t.replace(minute=0)].append(v - m); w.append((t, v - m))
if not w: continue
h, d = max(((h, statistics.median(v)) for h, v in hours.items() if len(v) >= 2), key=lambda x: abs(x[1]), default=(a, 0))
hr.append((abs(d) / n, f"{s} {c[-1]} {d/n:+.1f}@{h:%d %H}h"))
t1, d1 = max(w, key=lambda x: abs(x[1])); pt.append((abs(d1) / n, f"{s} {c[-1]} {d1/n:+.1f}@{t1:%d %H:%M}"))
hr.sort(reverse=True); pt.sort(reverse=True)
print(f"{L['id']} hourly: " + "; ".join(x for _, x in hr[:5]) + "\n points: " + "; ".join(x for _, x in pt[:5]))