Files
maximeandClaude Opus 5.5 6fbd7510b7 Etiqueteur: October labels for 8 stations; its folder moves to labeling/auto/etiqueteur/, analyses and scripts versioned (D-126)
Labels for CLARIDEN, FLORIDA, JUNGFRAU (gaps 06-20.10, 26.10-01.11), LENZSPITZE,
NIEDERHORN, NORDEND, SNCF01, WILDSTRUBEL. Figures and tool outputs stay out of git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:33:41 +01:00

31 lines
1.3 KiB
Python

"""Grappes d'instants où une référence, Sellette 4 ou Sellette 5 est rejetée, ou sans pose ; écart max 1 h. Bornes : pas d'avant, pas d'après."""
import csv, glob, sys
from collections import defaultdict
from datetime import datetime, timedelta
D='data/FLORIDA'; P=lambda s: datetime.fromisoformat(s[:16].replace(' ','T'))
gap=timedelta(minutes=int(sys.argv[1]) if len(sys.argv)>1 else 60)
inst=set(); rej=defaultdict(set)
for f in sorted(glob.glob(f'{D}/displacement/*.csv')):
for r in csv.DictReader(open(f)):
t=P(r['time_utc'])
if t.month!=10: continue
inst.add(t)
if float(r['error_value'])>float(r['error_threshold']): rej[t].add(r['sensor_name'])
pose=set()
for f in sorted(glob.glob(f'{D}/camera/*.csv')):
for r in csv.DictReader(open(f)): pose.add(P(r['time_utc']))
T=sorted(inst)
flag=[t for t in T if t not in pose or rej[t]&{'p1_r','r1_r','Sellette 4','Sellette 5'}]
cl=[]
for t in flag:
if cl and t-cl[-1][-1]<=gap: cl[-1].append(t)
else: cl.append([t])
for c in cl:
i=T.index(c[0]); j=T.index(c[-1])
a=T[i-1] if i else c[0]; b=T[j+1] if j+1<len(T) else c[-1]
who=defaultdict(int)
for t in c:
for s in rej[t]: who[s]+=1
np_=sum(1 for t in T[i:j+1] if t not in pose)
print(f"{a:%m-%d %H:%M} -> {b:%m-%d %H:%M} ({len(c)} pas marqués, sans pose {np_}) ", dict(who))