Files
aimsight-labeling/auto/revue-croisee/2026-11-04/finition/wildstrubel/outils/cycle_chiffres.py
T
maximeandClaude Opus 5.5 14ad6ea3f9 Auto labels reviewed per station and cross-reviewed; all labeling knowledge in labeling/ (D-130)
- Every station's auto labels reviewed by an analyst (/review-auto-labels), then a
  cross-review per family across all stations (new skill /cross-review-labels),
  a finishing pass, and descriptions rewritten in words (no numeric values).
- The three never-labeled ranges (WILDSTRUBEL 07/09-01/10, NORDEND 16/08-01/10)
  labeled and reviewed: 991 auto labels on 11 stations, labeling/controle.py at 0 errors.
- Labeling knowledge gathered in labeling/: regles-d-etiquetage.md (new), familles.md
  (settled boundaries), connaissances/ (notes moved from docs/, links updated),
  the label map rebuilt from reviewed labels, events and cases; events tied to their
  stations (PS_DES_COUDRES is JUNGFRAU). The labeler and reviewers read only labeling/.
- labels-map reads auto labels and events; decision D-130; living plan points 73-75.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:21:57 +01:00

48 lines
3.2 KiB
Python

"""Les chiffres du cycle de la pose, jour par jour, pour écrire les descriptions des étiquettes Thermal displacement.
Repos : nuit 00:00-03:00 (septembre, 01/10) ; sinon le repos de l'après-midi, 13:30 → dernière mesure du jour ;
le 09/10 (pas d'après-midi), celui du 08/10.
Tilt : pic et creux (valeurs brutes, heure), première mesure à plus de 0,01° du repos (et la mesure d'avant),
retour : première mesure après le creux d'où le tilt reste à moins de 0,01° du repos pendant 3 mesures.
Pan, rotation : min et max de 03:00 à 13:30 (heure). Échelle : max (heure) et retour à moins d'un quart
de son écart maximal. Température du boîtier (médiane des sensor_*_deg_c, à l'heure).
Usage : cycle_chiffres.py"""
import sys, statistics as st
from datetime import datetime, timedelta
sys.path.insert(0, sys.path[0])
from donnees import pose, temperature, etiquettes
P, T = pose(), temperature()
dt = lambda s: datetime.fromisoformat(s[:16])
rep_prec = None
for eid, e in etiquettes():
if e['categorie'] != 'Thermal displacement':
continue
a, b = dt(e['debut']), dt(e['fin'])
j = a.replace(hour=0, minute=0)
jour = sorted(t for t in P if j + timedelta(hours=3) <= t <= j + timedelta(hours=20))
nuit = [t for t in P if j <= t < j + timedelta(hours=3)]
apm = [t for t in jour if t >= j + timedelta(hours=13, minutes=30)]
rep = nuit if len(nuit) >= 6 else (apm if len(apm) >= 3 else rep_prec)
nom = 'nuit' if rep is nuit else ('après-midi' if rep is apm else 'après-midi du 08/10')
rep_prec = apm if len(apm) >= 3 else rep_prec
R = [st.median(P[t][k] for t in rep) for k in range(4)]
tl = [(t, P[t][1]) for t in jour]
pic = max(tl, key=lambda x: x[1]); creux = min((x for x in tl if x[0] > pic[0]), key=lambda x: x[1])
prem = next((k for k, (t, v) in enumerate(tl) if abs(v - R[1]) > .01), None)
ret = next((tl[k][0] for k in range(tl.index(creux), len(tl) - 2) if all(abs(v - R[1]) < .01 for _, v in tl[k:k + 3])), None)
matin = [t for t in jour if t <= j + timedelta(hours=13, minutes=30)]
def mm(k):
lo = min(matin, key=lambda t: P[t][k]); hi = max(matin, key=lambda t: P[t][k])
return f'min {P[lo][k]:+.4f} à {lo:%H:%M}, max {P[hi][k]:+.4f} à {hi:%H:%M} (repos {R[k]:+.4f})'
sc = [(t, P[t][3] - R[3]) for t in jour]
smax = max(sc, key=lambda x: x[1])
sret = next((t for t, v in sc if t > smax[0] and v < smax[1] / 4), None)
th = {t: v for t, v in T.items() if j <= t <= j + timedelta(hours=20)}
tmax = max(th, key=th.get)
print(f'\n{eid} {a:%d/%m %H:%M}->{b:%H:%M} ; repos {nom} ; première mesure {jour[0]:%H:%M}, dernière {jour[-1]:%H:%M}')
print(f' tilt repos {R[1]:.3f} ; au début {P.get(a, (0, float("nan")))[1]:.3f} ; pic {pic[1]:.3f} à {pic[0]:%H:%M} ; creux {creux[1]:.3f} à {creux[0]:%H:%M} ; 1re > 0,01 : {tl[prem][0]:%H:%M} (avant {tl[max(prem-1,0)][0]:%H:%M}) ; retour {ret and f"{ret:%H:%M}"} ; à la fin {P.get(b, (0, float("nan")))[1]:.3f}')
print(f' pan {mm(0)}')
print(f' rot {mm(2)}')
print(f' échelle max +{smax[1]*1e6:.0f}e-6 à {smax[0]:%H:%M}, retour au quart à {sret and f"{sret:%H:%M}"}')
print(f' temp. : {" ".join(f"{t:%H}h {v:.0f}" for t, v in sorted(th.items()) if 3 <= t.hour <= 17)} ; max {th[tmax]:.1f} à {tmax:%H}h')