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,26 @@
"""For each label, the largest deviation (in noises) of a target on corr_x/corr_y
among the ranges.py ranges strictly inside the label's bounds, for each ranges file given."""
import json, re, sys
labels = [json.loads(l) for l in open(sys.argv[1])]
files = sys.argv[2:]
pat = re.compile(r'^(\S+)\s+(\S+Z)\s+(\S+Z)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+Z)\s+(\d+)')
def load(f):
out = []; col = None
for line in open(f):
if line.startswith('corr_x: ranges'): col = 'cx'
elif line.startswith('corr_y: ranges'): col = 'cy'
m = pat.match(line)
if m and col:
s, a, b, n, v, k, at, rej = m.groups()
if s.startswith('PR') or s == 'CTR01':
out.append((s, col, a, b, int(n), float(k), at))
return out
R = {f: load(f) for f in files}
for L in labels:
print(L.get('id'), L['start'], L['end'], L['family'])
for f in files:
hits = [r for r in R[f] if r[6] > L['start'] and r[6] < L['end']]
hits.sort(key=lambda r: -abs(r[5]))
tag = f.split('ranges_')[-1].replace('.txt', '')
top = ', '.join(f"{s} {c} {k:+.1f} @{at[5:16]} ({n})" for s, c, a, b, n, k, at in hits[:5])
print(f" {tag:10s} n={len(hits):3d} max={max([abs(r[5]) for r in hits], default=0):6.1f} {top}")
@@ -0,0 +1,61 @@
"""Thermal labels: deviation of each target's corr_x/corr_y from a night level (median 22:00-04:00 UTC of the
night before the label, then of the night at its end), in its own noise (ranges.py batch noise), on a
3-measurement running median, excluding the instants covered by the non-thermal labels of the batch (spikes of
lost references, fog, rain, cobweb nights) and, for PR04, its Target-issue label NORDEND-152 (to 26/10 20:45)."""
import json, re, sys, statistics as st
from datetime import timedelta
sys.path.insert(0, 'tools/scripts')
import data
labels = [json.loads(l) for l in open(sys.argv[1])]
noise = {}; col = None
for line in open(sys.argv[2]):
if line.startswith('== corr_x'): col = 'corr_x'
elif line.startswith('== corr_y'): col = 'corr_y'
elif line.startswith('corr_'): col = None
m = re.match(r'^(PR\d+|CTR01)\s+\d+\s+\S+\s+(\S+)\s', line)
if m and col: noise[(m.group(1), col)] = float(m.group(2))
P = data.parse_time
# whole windows: rain, fog, low sun, pose jolts; per target: the obstructions of single targets (and PR04's
# NORDEND-152); per instant: any measurement where a reference CTR02-04 is rejected or out of the compensation.
excl = [(P(l['start']), P(l['end'])) for l in labels
if l['id'] in ('NORDEND-215', 'NORDEND-222', 'NORDEND-227', 'NORDEND-289', 'NORDEND-243')]
per_target = {'PR04': [('2026-10-24T16:30Z', '2026-10-26T20:45Z'), ('2026-11-07T11:15Z', '2026-11-07T11:45Z')],
'PR07': [('2026-11-02T19:15Z', '2026-11-03T06:00Z'), ('2026-11-07T13:45Z', '2026-11-07T14:00Z')],
'PR08': [('2026-11-02T19:15Z', '2026-11-03T06:00Z')],
'PR09': [('2026-11-05T03:00Z', '2026-11-05T09:45Z'), ('2026-11-05T14:45Z', '2026-11-05T15:15Z')],
'PR10': [('2026-11-06T09:15Z', '2026-11-06T09:45Z')]}
per_target = {k: [(P(a), P(b)) for a, b in v] for k, v in per_target.items()}
meas = data.load('data/NORDEND')
bad_t = set()
for r in ('CTR02', 'CTR03', 'CTR04'):
for m in meas[r]:
if data.rejected(m) or (m.get('inlier') is not None and m['inlier'] != 1):
bad_t.add(m['t'])
def ok(sen, t):
return (t not in bad_t and not any(a < t < b for a, b in excl)
and not any(a < t < b for a, b in per_target.get(sen, [])))
for L in labels:
if L['family'] != 'Thermal displacement': continue
s, e = P(L['start']), P(L['end'])
for ref in ('night before', 'night after'):
d0 = (s if ref == 'night before' else e).replace(hour=0, minute=0)
if ref == 'night before' and s.hour >= 20: d0 += timedelta(days=1)
n0, n1 = d0 - timedelta(hours=2), d0 + timedelta(hours=4)
res = []
for sen, ms in meas.items():
if not sen.startswith('PR'): continue
for c in ('corr_x', 'corr_y'):
nz = noise.get((sen, c))
night = [m[c] for m in ms if n0 <= m['t'] <= n1 and m[c] is not None and ok(sen, m['t'])]
if not nz or len(night) < 5: continue
lvl = st.median(night)
pts = [m for m in ms if s < m['t'] < e and m[c] is not None and ok(sen, m['t'])]
best = (0, None)
for i in range(1, len(pts) - 1):
k = (st.median([pts[i-1][c], pts[i][c], pts[i+1][c]]) - lvl) / nz
if abs(k) > abs(best[0]): best = (k, pts[i]['t'])
if best[1]: res.append((abs(best[0]), sen, c, best[0], best[1]))
res.sort(reverse=True)
over = [r for r in res if r[0] > 5]
print(L['id'], L['start'][5:16], L['end'][5:16], f"{ref:12s} n={len(res):2d} >5: {len(over):2d} |",
'; '.join(f"{r[1]} {r[2][-1]} {r[3]:+.1f} @{data.iso(r[4])[5:16]}" for r in res[:6]))
@@ -0,0 +1,22 @@
"""Requalification 2026-11-17: write labels.jsonl from work/requalify_input.jsonl, removing the labels below the
threshold or of missing points only, rewriting two thermal descriptions that said the compensation absorbs the
cycle while the corrected curves keep it beyond the noise."""
import json, sys
D = sys.argv[1]
REMOVED = {'NORDEND-281', 'NORDEND-286', 'NORDEND-289', 'NORDEND-232', 'NORDEND-235', 'NORDEND-238',
'NORDEND-241', 'NORDEND-242'}
REWRITE = {
'NORDEND-218': "Weak camera thermal cycle: overcast day, the housing temperature rises only a little (highest around 14:00); the pan drops a little, the tilt rises by the same amount; but the camera does not come back overnight: on the morning of the 27th, the pan is even lower than the day before, by almost the whole of its daytime drop, after the rain of the 24th-25th and the marks it left on the window (separate label). The compensation does not quite absorb it: the corr_x of PR18 drops just beyond its noise from mid-morning to mid-afternoon and stays a little lower at night, with the camera; the corr_y of PR17 rises just beyond its noise in the afternoon; the other targets stay within or at the edge of their noise (PR04, hindered separately until the evening, apart). Deduced cause: the pose follows the housing temperature, and the quarry's rock face does not move with temperature. The structure is not moving, nothing to do.",
'NORDEND-220': "Camera thermal cycle: in the morning, when the housing warms up (markedly, highest around 13:00), the camera turns: the pan drops a little, the tilt rises less; then it comes back in the afternoon, until the night of degrading visibility, then fog, when the pose is distorted (separate label). The compensation absorbs it poorly: the corr_x of PR18 dips markedly from mid-morning to mid-afternoon (deepest in early afternoon); the corr_y of PR13 and PR06 drops a little around midday, that of PR10 from late morning to the end of the label; the other targets stay near their noise. Deduced cause: the pose follows the housing temperature, and the quarry's rock face does not move with temperature. The structure is not moving, nothing to do.",
}
out = []
for line in open(f'{D}/work/requalify_input.jsonl'):
L = json.loads(line)
i = L.pop('id')
if i in REMOVED: continue
if i in REWRITE:
L['description'] = REWRITE[i]; L.pop('review', None)
out.append(L)
with open(f'{D}/labels.jsonl', 'w') as f:
for L in out: f.write(json.dumps(L, ensure_ascii=False) + '\n')
print(len(out), 'labels written')