Files
Support-Agent/labeling/auto/etiqueteur/BREITHORN_2026-10-01/outils/table.py
T
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

15 lines
936 B
Python

"""Table corr_x/corr_y (ou autre colonne) de tous les capteurs sur une fenêtre. usage: table.py DEBUT FIN [colonne]"""
import csv, glob, sys
D="data/BREITHORN"; a,b=sys.argv[1],sys.argv[2]; cols=sys.argv[3].split(",") if len(sys.argv)>3 else ["corr_x","corr_y"]
v={}; S=[]
for f in sorted(glob.glob(f"{D}/displacement/*.csv")):
for r in csv.DictReader(open(f)):
k=r["time_utc"][:16].replace(" ","T")
if a<=k<=b:
if r["sensor_name"] not in S: S.append(r["sensor_name"])
rej=float(r["error_value"])>float(r["error_threshold"])
v.setdefault(k,{})[r["sensor_name"]]=[("R" if rej and c.startswith("corr") else (f"{float(r[c]):+.3f}" if r[c] else "-")) for c in cols]
for c_i,c in enumerate(cols):
print(f"== {c}"); print("instant "+" ".join(f"{s[:8]:>8}" for s in S))
for k in sorted(v): print(k[5:]," "+" ".join(f"{v[k].get(s,['?']*len(cols))[c_i]:>8}" for s in S))