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>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 23:58:00 +01:00
1 parent c779de7720
commit ddb17c2189
321 files changed
+18464 -3426

No files matched your search

@@ -0,0 +1,83 @@
"""For each label of a jsonl: per target, the largest deviation of corr_x, corr_y (accepted measurements) inside
[start, end], in own noises, against (a) the window level (median), (b) the level of the preceding night 20-03 UTC,
(c) for short labels (<= 4 steps), the jump against the mean of the measurement before and after the label.
Usage: python3 check_labels.py <labels.jsonl> [--sensors A,B]"""
import json
import statistics
import sys
from datetime import timedelta
sys.path.insert(0, "tools/scripts")
import data # noqa: E402
import common # noqa: E402
FOLDER = "data/WILDSTRUBEL"
W0 = data.parse_time("2026-09-01T00:00Z")
W1 = data.parse_time("2026-09-09T21:45Z")
by = data.load(FOLDER)
targets = [s for s, ms in by.items() if not data.is_reference(ms)]
series = {}
noise = {}
for s in targets:
ms = [m for m in by[s] if W0 - timedelta(days=1) <= m["t"] <= W1]
for c in ("corr_x", "corr_y"):
pts = [(m["t"].replace(second=0, microsecond=0), m[c]) for m in ms if m[c] is not None]
series[(s, c)] = pts
noise[(s, c)] = common.own_noise([v for t, v in pts if t >= W0])
def night_level(s, c, t):
d = t - timedelta(hours=t.hour, minutes=t.minute)
if t.hour < 20:
d -= timedelta(days=1)
a, b = d + timedelta(hours=20), d + timedelta(hours=27)
v = [x for tt, x in series[(s, c)] if a <= tt <= b]
return statistics.median(v) if v else None
def report(lab):
a, b = data.parse_time(lab["start"]), data.parse_time(lab["end"])
rows = []
for s in targets:
for c in ("corr_x", "corr_y"):
pts = series[(s, c)]
n = noise[(s, c)]
inside = [(t, v) for t, v in pts if a < t < b] or [(t, v) for t, v in pts if a <= t <= b]
if not inside or not n:
continue
lvl = night_level(s, c, a)
dev_n = max(((v - lvl) / n, t) for t, v in inside) if lvl is not None else None
dev_n2 = min(((v - lvl) / n, t) for t, v in inside) if lvl is not None else None
jump = None
before = [v for t, v in pts if t <= a][-1:]
after = [v for t, v in pts if t >= b][:1]
if before and after and (b - a) <= timedelta(minutes=75):
ref = (before[0] + after[0]) / 2
jump = max(((v - ref) / n, t) for t, v in inside), min(((v - ref) / n, t) for t, v in inside)
rows.append((s, c, dev_n, dev_n2, jump))
return rows
def main():
path = sys.argv[1]
for line in open(path):
lab = json.loads(line)
print(f"== {lab.get('id','')} {lab['start']} {lab['end']} {lab['family']}")
for s, c, hi, lo, jump in report(lab):
parts = []
if jump:
(jh, th), (jl, tl) = jump
j = jh if abs(jh) >= abs(jl) else jl
tj = th if abs(jh) >= abs(jl) else tl
if abs(j) >= 3:
parts.append(f"jump {j:+.1f}n @{tj:%d %H:%M}")
if hi and lo:
d, t = hi if abs(hi[0]) >= abs(lo[0]) else lo
if abs(d) >= 5 and not jump:
parts.append(f"vs night {d:+.1f}n @{t:%d %H:%M}")
if parts:
print(f" {s:6} {c}: " + "; ".join(parts))
if __name__ == "__main__":
main()
@@ -0,0 +1,55 @@
"""Per day: the hourly median of each target's corr_x, corr_y minus its preceding night level (20-03 UTC), in own
noises (noise of the window at the native step), next to the hourly camera tilt (minus its night level, mdeg) and
the housing temperature. What the corrected curves keep of the slow morning wave, without the point-to-point agitation.
Usage: python3 thermal_check.py"""
import statistics
import sys
from datetime import timedelta
sys.path.insert(0, "tools/scripts")
import data # noqa: E402
import common # noqa: E402
F = "data/WILDSTRUBEL"
W0, W1 = data.parse_time("2026-08-31T20:00Z"), data.parse_time("2026-09-09T21:45Z")
by = data.load(F)
tg = [s for s, ms in by.items() if not data.is_reference(ms)]
cam = [p for p in data.load_camera(F) if W0 <= p["t"] <= W1]
temp = dict((t, v) for t, v in data.load_temperature(F) if W0 <= t <= W1)
noise = {}
ser = {}
for s in tg:
for c in ("corr_x", "corr_y"):
pts = [(m["t"], m[c]) for m in by[s] if W0 <= m["t"] <= W1 and m[c] is not None]
ser[(s, c)] = pts
noise[(s, c)] = common.own_noise([v for t, v in pts])
def med(pts, a, b):
v = [x for t, x in pts if a <= t < b]
return statistics.median(v) if v else None
day = data.parse_time("2026-09-01T00:00Z")
while day <= data.parse_time("2026-09-09T00:00Z"):
na, nb = day - timedelta(hours=4), day + timedelta(hours=3)
tilt = [(p["t"], p["tilt"]) for p in cam if p["tilt"] is not None]
tn = med(tilt, na, nb)
print(f"\n=== {day:%d/%m} columns: hour, tilt-night (mdeg), temp, then per target cx/cy in noises")
print("hh tilt temp " + " ".join(f"{s:>11}" for s in tg))
for h in range(3, 17):
a = day + timedelta(hours=h)
b = a + timedelta(hours=1)
tm = med(tilt, a, b)
te = temp.get(a)
cells = []
for s in tg:
out = []
for c in ("corr_x", "corr_y"):
lv = med(ser[(s, c)], na, nb)
m = med(ser[(s, c)], a, b)
out.append(" ." if lv is None or m is None else f"{(m - lv) / noise[(s, c)]:+4.0f}")
cells.append("/".join(out))
print(f"{h:02d} {1000 * (tm - tn) if tm is not None else float('nan'):+6.1f} {te if te else float('nan'):5.1f} "
+ " ".join(f"{c:>11}" for c in cells))
day += timedelta(days=1)