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,44 @@
"""Per-day figure: corr_x, corr_y of targets (accepted), error_value of all, pose, temperature; existing labels shaded."""
import sys, json, os
from datetime import datetime, timedelta, timezone
sys.path.insert(0, 'tools/scripts')
import data
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
F = 'data/FLORIDA'; D = sys.argv[1]; out = sys.argv[2]
labels = [json.loads(l) for l in open(sys.argv[3])]
M = data.load(F); cam = data.load_camera(F); tem = data.load_temperature(F)
t0 = data.parse_time(sys.argv[4]); t1 = data.parse_time(sys.argv[5])
tg = ['Sellette 4', 'Sellette 5', 'Sellette 6', 'Massif 2', 'Pont Ernen', 'Sellette 3']
col = dict(zip(tg + ['p1_r', 'r1_r'], ['C0','C1','C2','C3','C4','C5','k','C6']))
fig, ax = plt.subplots(6, 1, figsize=(14, 16), sharex=True)
for s in tg:
ms = [m for m in M[s] if t0 <= m['t'] <= t1]
for i, c in enumerate(['corr_x', 'corr_y']):
v = [m[c] for m in ms if m[c] is not None]
if not v: continue
med = sorted(v)[len(v)//2]
ax[i].plot([m['t'] for m in ms], [m[c] - med if m[c] is not None else None for m in ms], '.-', ms=3, lw=.7, color=col[s], label=s)
for s in tg + ['p1_r', 'r1_r']:
ms = [m for m in M[s] if t0 <= m['t'] <= t1]
ax[2].plot([m['t'] for m in ms], [m['error_value'] for m in ms], '.-', ms=2, lw=.6, color=col[s], label=s)
ax[2].axhline(.7, color='r', ls=':')
cs = [p for p in cam if t0 <= p['t'] <= t1]
for c, a in [('pan', 3), ('tilt', 3), ('rotation', 4), ('scale', 4)]:
v = [p[c] for p in cs]
if c == 'scale': v = [(x - 1) * 50 if x is not None else None for x in v]
ax[a].plot([p['t'] for p in cs], v, '.-', ms=2, lw=.6, label=c if c != 'scale' else '(scale-1)*50')
ts = [(t, v) for t, v in tem if t0 <= t <= t1]
ax[5].plot([t for t, v in ts], [v for t, v in ts], 'o-')
for a, n in zip(ax, ['corr_x - median', 'corr_y - median', 'error_value', 'pan, tilt', 'rot, scale', 'housing T']):
a.set_ylabel(n); a.grid(alpha=.3); a.legend(fontsize=6, ncol=4)
ax[0].set_ylim(-.4, .4); ax[1].set_ylim(-.3, .3)
cols = {'Visibility':'yellow','Thermal displacement':'orange','No data':'grey','Displacement':'red','Target issue':'none','Obstruction':'blue'}
for l in labels:
a_, b_ = data.parse_time(l['start']), data.parse_time(l['end'])
if b_ < t0 or a_ > t1 or l['family'] == 'Target issue': continue
for a in ax: a.axvspan(max(a_, t0), min(b_, t1), color=cols[l['family']], alpha=.2)
ax[0].text(max(a_, t0), .35, l.get('id', l['family'][:4]), fontsize=7)
import matplotlib.dates as md
ax[-1].xaxis.set_major_locator(md.HourLocator(interval=2)); ax[-1].xaxis.set_major_formatter(md.DateFormatter('%d %Hh'))
fig.tight_layout(); fig.savefig(out, dpi=80); print(out)
@@ -0,0 +1,30 @@
"""Hourly median of Sellette 4/5 corr against housing temperature and pose, whole range, labels shaded."""
import sys, json, statistics
sys.path.insert(0, 'tools/scripts')
import data
import matplotlib; matplotlib.use('Agg'); import matplotlib.pyplot as plt, matplotlib.dates as md
F='data/FLORIDA'; out=sys.argv[1]; labels=[json.loads(l) for l in open(sys.argv[2])]
t0,t1=data.parse_time('2026-10-21T18:00Z'),data.parse_time('2026-11-01T00:00Z')
M=data.load(F); cam=[p for p in data.load_camera(F) if t0<=p['t']<=t1]; tem=[x for x in data.load_temperature(F) if t0<=x[0]<=t1]
def hourly(pts):
by={}
for t,v in pts: by.setdefault(t.replace(minute=0,second=0,microsecond=0),[]).append(v)
k=sorted(by); return k,[statistics.median(by[t]) for t in k]
fig,ax=plt.subplots(5,1,figsize=(18,13),sharex=True)
for i,(s,c) in enumerate([('Sellette 5','corr_y'),('Sellette 5','corr_x'),('Sellette 4','corr_x'),('Sellette 4','corr_y')]):
a=ax[0] if c=='corr_y' else ax[1]
pts=[(m['t'],m[c]) for m in M[s] if t0<=m['t']<=t1 and m[c] is not None]
k,v=hourly(pts); med=statistics.median(v); a.plot(k,[x-med for x in v],'.-',label=f'{s} {c}')
for c in ('rotation',):
k,v=hourly([(p['t'],p[c]) for p in cam if p[c] is not None]); ax[2].plot(k,v,'.-',label=c)
for c in ('pan','tilt'):
k,v=hourly([(p['t'],p[c]) for p in cam if p[c] is not None]); ax[3].plot(k,v,'.-',label=c)
ax[4].plot([t for t,v in tem],[v for t,v in tem],'o-',ms=3)
cols={'Visibility':'yellow','Thermal displacement':'orange','No data':'grey','Displacement':'red','Obstruction':'blue'}
for l in labels:
if l['family'] not in cols: continue
for a in ax: a.axvspan(data.parse_time(l['start']),data.parse_time(l['end']),color=cols[l['family']],alpha=.25)
for a in ax: a.grid(alpha=.3); a.legend(fontsize=7)
ax[0].set_ylim(-.2,.2); ax[1].set_ylim(-.2,.2)
ax[-1].xaxis.set_major_locator(md.HourLocator(byhour=[0,12])); ax[-1].xaxis.set_major_formatter(md.DateFormatter('%d %Hh'))
fig.tight_layout(); fig.savefig(out,dpi=70); print(out)
@@ -0,0 +1,28 @@
"""Per-instant table: corr of targets minus a fixed baseline (median over a calm window), error_value of refs, pose."""
import sys
sys.path.insert(0, 'tools/scripts')
import data
F = 'data/FLORIDA'
t0, t1 = data.parse_time(sys.argv[1]), data.parse_time(sys.argv[2])
b0, b1 = data.parse_time(sys.argv[3]), data.parse_time(sys.argv[4])
M = data.load(F); cam = {p['t'].replace(second=0, microsecond=0): p for p in data.load_camera(F)}
tg = ['Sellette 4', 'Sellette 5', 'Pont Ernen', 'Sellette 3', 'Sellette 6', 'Massif 2']
base = {}
for s in tg:
for c in ('corr_x', 'corr_y'):
v = sorted(m[c] for m in M[s] if b0 <= m['t'] <= b1 and m[c] is not None)
base[s, c] = v[len(v)//2] if v else 0
idx = {s: {m['t'].replace(second=0, microsecond=0): m for m in M[s]} for s in M}
times = sorted(t for t in idx['p1_r'] if t0 <= t <= t1)
print('time ' + ' '.join(f'{s[:2]+s[-1]:>5}x {s[:2]+s[-1]:>5}y' for s in tg) + ' p1ev r1ev pan tilt rot scale')
for t in times:
row = []
for s in tg:
m = idx[s].get(t)
for c in ('corr_x', 'corr_y'):
v = m[c] if m else None
row.append(f'{v-base[s,c]:+6.3f}' if v is not None else ' R')
p = cam.get(t)
pe = idx['p1_r'][t]['error_value']; re_ = idx['r1_r'][t]['error_value']
ps = f"{p['pan']:+.4f} {p['tilt']:+.4f} {p['rotation']:+.4f} {p['scale']:.5f}" if p else 'no pose'
print(t.strftime('%d %H:%M ') + ' '.join(row) + f' {pe:.2f} {re_:.2f} ' + ps)