17 lines
1.2 KiB
Python
17 lines
1.2 KiB
Python
"""Relit fig/rigide_<jour>.txt (écrits par rigide_jours.py) : extrêmes de ty, tx, rot_deg, echelle du mouvement
|
|||
|
|
d'ensemble des cibles, sans les pas où une cible s'écarte de plus de 1 px du bloc (cib_max > 1 : passages,
|
||
|
|
voitures garées). Usage : rigide_resume.py"""
|
||
|
|
import glob
|
||
|
|
W = 'labeling/auto/revue-croisee/2026-11-04/finition/wildstrubel'
|
||
|
|
for f in sorted(glob.glob(f'{W}/fig/rigide_*.txt')):
|
||
|
|
l = open(f).read().split("Mouvement d'ensemble ajusté")[1].splitlines()
|
||
|
|
tete = [x for x in l if x.startswith('instant')][0].split()
|
||
|
|
rows = [x.split() for x in l if x[:4] == '2026' and len(x.split()) == len(tete)]
|
||
|
|
rows = [r for r in rows if float(r[tete.index('cib_max')]) <= 1]
|
||
|
|
out = []
|
||
|
|
for c in ('ty', 'tx', 'rot_deg', 'echelle'):
|
||
|
|
i = tete.index(c)
|
||
|
|
lo = min(rows, key=lambda r: float(r[i])); hi = max(rows, key=lambda r: float(r[i]))
|
||
|
|
out.append(f'{c} {float(lo[i]):+.3g} ({lo[0][11:16]}) à {float(hi[i]):+.4g} ({hi[0][11:16]})')
|
||
|
|
cm = sorted(float(r[tete.index('cib_med')]) for r in rows)
|
||
|
|
print(f[-14:-4], ' | '.join(out), f'| cib_med médiane {cm[len(cm)//2]:.3f}, 90e {cm[int(.9*len(cm))]:.3f} px ({len(rows)} pas)')
|