Files
aimsight-labeling/auto/analyses/JUNGFRAU_2026-10-21T1030_2026-11-01T0000/scripts/requalify_vis.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

31 lines
1.8 KiB
Python

"""Visibility labels: ranges.py --k 5 --rolling R on label +-12 h, noise outside the label; keep the ranges overlapping the label (targets only)."""
import json, subprocess, sys, re
from datetime import datetime, timedelta
D = sys.argv[1]; R = sys.argv[2] if len(sys.argv) > 2 else "4"
f = lambda s: datetime.strptime(s, "%Y-%m-%dT%H:%MZ")
g = lambda d: d.strftime("%Y-%m-%dT%H:%MZ")
for line in open(f"{D}/work/requalify_input.jsonl"):
L = json.loads(line)
if L["family"] != "Visibility": continue
s, e = f(L["start"]), f(L["end"])
for name, extra in [("roll" + R, ["--rolling", R]), ("plain", [])]:
cmd = ["python3", "tools/scripts/ranges.py", "data/JUNGFRAU", "--columns", "corr_x,corr_y", "--k", "5",
"--start", g(s - timedelta(hours=12)), "--end", g(e + timedelta(hours=12)),
"--outside", f"{L['start']}/{L['end']}"] + extra
txt = subprocess.run(cmd, capture_output=True, text=True).stdout
open(f"{D}/work/rq/{L['id']}_wide_{name}.txt", "w").write(" ".join(cmd) + "\n" + txt)
best = {}; col = None
for l in txt.splitlines():
m = re.match(r"(corr_[xy]): ranges", l)
if m: col = m.group(1); continue
if l.startswith("=="): col = None; continue
p = l.split()
if col and len(p) >= 8 and re.match(r"\d{4}-", p[1]) and not p[0].startswith("REF"):
try: z = float(p[5]); t = f(p[6])
except ValueError: continue
if not (s <= t <= e): continue
k = (p[0], col)
if abs(z) > abs(best.get(k, (0,))[0]): best[k] = (z, p[6], int(p[3]))
top = sorted(best.items(), key=lambda kv: -abs(kv[1][0]))[:5]
print(L["id"], L["start"][5:], L["end"][5:], name, len(best), "|", "; ".join(f"{a} {c[-1]} {z:+.1f} @{t[11:16]} n={n}" for (a, c), (z, t, n) in top) or "none")