Files
Support-Agent/labeling/auto/etiqueteur/JUNGFRAU_2026-09-30/outils/temperatures.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

21 lines
1023 B
Python

"""Températures horaires (et tension, courant) de la station sur le lot, en table.
Usage : python3 <ce fichier> data/JUNGFRAU 2026-09-30 2026-10-05
"""
import csv, glob, sys
from datetime import date, timedelta
dossier, d0, d1 = sys.argv[1], date.fromisoformat(sys.argv[2]), date.fromisoformat(sys.argv[3])
noms = ["sensor_A0_deg_c", "sensor_CPU_deg_c", "sensor_GPU_deg_c", "sensor_PLL_deg_c", "sensor_thermal_deg_c", "BusVoltage", "BusCurrent", "Power"]
table = {}
d = d0
while d <= d1:
j = d.strftime("%Y_%m_%d")
for n in noms:
for f in glob.glob(f"{dossier}/metrics/*_{n}_{j}_00_00 to {j}_23_00.csv"):
for r in csv.DictReader(open(f)):
table.setdefault(r["time_utc"][:16], {})[n] = r["metric"]
d += timedelta(days=1)
print("instant " + " ".join(f"{n.replace('sensor_','').replace('_deg_c',''):>8}" for n in noms))
for t in sorted(table):
print(t, " ".join(f"{float(table[t][n]) if table[t].get(n) not in (None, '') else float('nan'):8.2f}" for n in noms))