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>
21 lines
1023 B
Python
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))
|