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,26 @@
"""Fast deviations of corr_x/corr_y (vs median of +-N neighbours), flagged instants and coverage by non-thermal labels."""
import sys, json, statistics
sys.path.insert(0, 'tools/scripts')
import data
D = 'labeling/auto/analyses/NORDEND_2026-08-10T0115_2026-08-23T0515/'
S, E = data.parse_time('2026-08-10T01:15Z'), data.parse_time('2026-08-23T05:15Z')
K = float(sys.argv[1]) if len(sys.argv) > 1 else 6
N = int(sys.argv[2]) if len(sys.argv) > 2 else 4
labs = [json.loads(l) for l in open(D + 'work/existing.jsonl')]
labs = [(data.parse_time(l['start']), data.parse_time(l['end']), l['id'], l['family']) for l in labs if l['family'] != 'Thermal displacement']
allm = data.load('data/NORDEND')
flags = {}
for s, ms in allm.items():
ms = data.filter_window(ms, S, E)
for c in ('corr_x', 'corr_y'):
v = [(m['t'], m[c]) for m in ms if m[c] is not None]
if len(v) < 20: continue
noise = statistics.median(abs(v[i+1][1]-v[i][1]) for i in range(len(v)-1))
for i, (t, x) in enumerate(v):
nb = [y for _, y in v[max(0, i-N):i] + v[i+1:i+1+N]]
d = (x - statistics.median(nb)) / noise if noise else 0
if abs(d) > K:
flags.setdefault(t, []).append(f"{s}:{c[-1]}{d:+.0f}")
for t in sorted(flags):
cov = [i for a, b, i, f in labs if a <= t <= b]
print(data.iso(t), len(flags[t]), ' '.join(flags[t]), '| ' + (','.join(cov) if cov else 'UNCOVERED'))