auto: the analysts verified the labels of 32 periods (11 stations, up to 14 days each): 710 labels -> 835, 587 unchanged; one analysis folder per period with its report (section Verification)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 15:13:44 +01:00
1 parent df979301b5
commit 2a5d87659b
279 files changed
+10758 -710

No files matched your search

@@ -0,0 +1,35 @@
"""Per instant, sensors whose corr deviates from their level in a reference window by more than K noises (r: rejected).
Usage: python3 dev.py data/NIEDERHORN START END REF_START REF_END [K] [sensors,comma]"""
import sys, statistics
sys.path.insert(0, "tools/scripts")
import data
f, a, b, ra, rb = sys.argv[1], *map(data.parse_time, sys.argv[2:6])
K = float(sys.argv[6]) if len(sys.argv) > 6 else 5
only = set(sys.argv[7].split(",")) if len(sys.argv) > 7 else None
PERM = {"e03", "e04", "e05", "e07", "e08", "e11", "e12"}
M = data.load(f)
for v in M.values():
for m in v: m["t"] = m["t"].replace(second=0, microsecond=0)
lvl, noise = {}, {}
for s, v in M.items():
for c in ("corr_x", "corr_y"):
r = [m[c] for m in v if ra <= m["t"] <= rb and m[c] is not None]
allv = [m[c] for m in v if m[c] is not None]
d = [abs(y - x) for x, y in zip(allv, allv[1:])]
lvl[s, c] = statistics.median(r) if r else None
noise[s, c] = statistics.median(d) if d else 0
times = sorted({m["t"] for v in M.values() for m in v if a <= m["t"] <= b})
by = {s: {m["t"]: m for m in v} for s, v in M.items()}
short = lambda s: s.replace("PWD_", "").replace("_C09", "")
for t in times:
out = []
for s in sorted(M):
if s in PERM or (only and s not in only): continue
m = by[s].get(t)
if m is None: continue
if data.rejected(m): out.append(f"{short(s)}:r"); continue
for c in ("corr_x", "corr_y"):
if lvl[s, c] is None or not noise[s, c]: continue
d = (m[c] - lvl[s, c]) / noise[s, c]
if abs(d) >= K: out.append(f"{short(s)}:{c[-1]}{d:+.0f}")
print(data.iso(t), len(out), " ".join(out))