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

26 lines
1.4 KiB
Python

"""Signature des nuits froides : température, échelle, rotation, et corr_y de COLH20, REFPOU22, COLI21, POUI24 (moins médiane glissante ±1 j)."""
import csv, glob, statistics as st
D="data/BREITHORN"; S=["COLH20","REFPOU22","COLI21","POUI24","COLI24"]
temp={}
for f in glob.glob(f"{D}/metrics/*sensor_thermal_deg_c*.csv"):
for r in csv.DictReader(open(f)):
if r["metric"]: temp[r["time_utc"][:13]]=float(r["metric"])
cam={}
for f in glob.glob(f"{D}/camera/*.csv"):
for r in csv.DictReader(open(f)): cam[r["time_utc"][:16]]=(float(r["median_scale"]),float(r["median_rotation"]))
v={}
for f in sorted(glob.glob(f"{D}/displacement/*.csv")):
for r in csv.DictReader(open(f)):
if r["sensor_name"] in S and float(r["error_value"])<=float(r["error_threshold"]):
v.setdefault(r["sensor_name"],{})[r["time_utc"][:16]]=float(r["corr_y"])
ks=sorted(k for k in cam if "2026-10-03"<=k<="2026-11-01 00:00")
def dev(s,i):
k=ks[i]
if k not in v[s]: return " R "
w=[v[s][x] for x in ks[max(0,i-6):i+7] if x in v[s]]
return f"{v[s][k]-st.median(w):+.3f}"
print("instant T scale rot | "+" ".join(f"{s:>8}" for s in S))
for i,k in enumerate(ks):
t=temp.get(k[:13]); flag=" *" if t is not None and t<26.5 else ""
print(k[5:], f"{t if t is not None else float('nan'):5.2f} {cam[k][0]:.5f} {cam[k][1]:.4f} |", " ".join(f"{dev(s,i):>8}" for s in S), flag)