26 lines
984 B
Python
26 lines
984 B
Python
"""Table par instant et par capteur d'une colonne de l'export advanced (lot). Usage: table.py COLONNE"""
|
|||
|
|
import csv, glob, sys
|
||
|
|
col = sys.argv[1]
|
||
|
|
D, F = "2026-10-20", "2026-11-01"
|
||
|
|
rows = {}
|
||
|
|
sensors = []
|
||
|
|
for f in sorted(glob.glob("data/BREITHORN/displacement/BREITHORN_advanced_*.csv")):
|
||
|
|
for r in csv.DictReader(open(f)):
|
||
|
|
t = r["time_utc"][:16]
|
||
|
|
if not (D <= t < F):
|
||
|
|
continue
|
||
|
|
s = r["sensor_name"]
|
||
|
|
if s not in sensors:
|
||
|
|
sensors.append(s)
|
||
|
|
v = r[col]
|
||
|
|
rej = float(r["error_value"]) > float(r["error_threshold"])
|
||
|
|
txt = "" if v == "" else f"{float(v):.3f}"
|
||
|
|
if rej:
|
||
|
|
txt += "*"
|
||
|
|
if col == "error_value" or True:
|
||
|
|
if r["inlier"] == "0.0":
|
||
|
|
txt += "o"
|
||
|
|
rows.setdefault(t, {})[s] = txt
|
||
|
|
print("instant " + " ".join(f"{s[:8]:>8}" for s in sensors))
|
||
|
|
for t in sorted(rows):
|
||
|
|
print(t + " " + " ".join(f"{rows[t].get(s, '-'):>8}" for s in sensors))
|