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>
This commit is contained in:
1 parent
2bba388290
commit
6fbd7510b7
112 files changed
+8951
-6
No files matched your search
@@ -0,0 +1,49 @@
|
||||
"""Médiane des cibles de corr_x, corr_y face à la température (A0, thermal, horaire), écart brut REFG43N-REF42, error_value médiane."""
|
||||
import csv, glob, statistics as st
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
import matplotlib
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
D = "data/MICHIGAN"
|
||||
OUT = "labeling/auto/etiqueteur/MICHIGAN_2026-10-20/temperature_corr.png"
|
||||
T0, T1 = "2026-10-17", "2026-11-03"
|
||||
rows = defaultdict(dict)
|
||||
for f in sorted(glob.glob(f"{D}/displacement/*.csv")):
|
||||
for r in csv.DictReader(open(f)):
|
||||
if T0 <= r["time_utc"] <= T1:
|
||||
rows[r["time_utc"][:16]][r["sensor_name"]] = r
|
||||
P = lambda t: datetime.strptime(t, "%Y-%m-%d %H:%M")
|
||||
ts, cx, cy, dref_x, dref_y, ev = [], [], [], [], [], []
|
||||
for t in sorted(rows):
|
||||
s = rows[t]
|
||||
ok = [r for r in s.values() if r["pattern_type"] == "target" and r["corr_x"]]
|
||||
ts.append(P(t))
|
||||
cx.append(st.median(float(r["corr_x"]) for r in ok))
|
||||
cy.append(st.median(float(r["corr_y"]) for r in ok))
|
||||
dref_x.append(float(s["REFG43N"]["x"]) - float(s["REF42"]["x"]))
|
||||
dref_y.append(float(s["REFG43N"]["y"]) - float(s["REF42"]["y"]))
|
||||
ev.append(st.median(float(r["error_value"]) for r in s.values() if r["pattern_type"] == "target"))
|
||||
temp = {}
|
||||
for name in ("sensor_A0_deg_c", "sensor_thermal_deg_c", "sensor_CPU_deg_c"):
|
||||
pts = []
|
||||
for f in glob.glob(f"{D}/metrics/MICHIGAN_{name}_*.csv"):
|
||||
for r in csv.DictReader(open(f)):
|
||||
if T0 <= r["time_utc"] <= T1 and r["metric"]:
|
||||
pts.append((P(r["time_utc"][:16]), float(r["metric"])))
|
||||
temp[name] = sorted(pts)
|
||||
fig, ax = plt.subplots(5, 1, figsize=(15, 13), sharex=True)
|
||||
ax[0].plot(ts, cx, ".-"); ax[0].set_ylabel("corr_x médiane cibles")
|
||||
ax[1].plot(ts, cy, ".-"); ax[1].set_ylabel("corr_y médiane cibles")
|
||||
for n, p in temp.items():
|
||||
ax[2].plot([a for a, _ in p], [b for _, b in p], label=n)
|
||||
ax[2].legend(); ax[2].set_ylabel("°C")
|
||||
ax[3].plot(ts, [v - st.median(dref_x) for v in dref_x], ".-", label="x")
|
||||
ax[3].plot(ts, [v - st.median(dref_y) for v in dref_y], ".-", label="y")
|
||||
ax[3].legend(); ax[3].set_ylabel("REFG43N - REF42 brut [px]")
|
||||
ax[4].plot(ts, ev, ".-"); ax[4].set_ylabel("error_value médiane cibles")
|
||||
for a in ax:
|
||||
a.grid(alpha=.3)
|
||||
a.axvspan(P("2026-10-20 00:00"), P("2026-11-01 00:00"), color="y", alpha=.05)
|
||||
fig.tight_layout(); fig.savefig(OUT, dpi=80); print(OUT)
|
||||
@@ -0,0 +1,32 @@
|
||||
"""Table par instant : médiane des cibles de corr_x, corr_y, error_value ; REFPOU22 error ; température A0 et thermal."""
|
||||
import csv, glob, statistics as st, sys
|
||||
from collections import defaultdict
|
||||
|
||||
D = "data/MICHIGAN"
|
||||
deb, fin = sys.argv[1], sys.argv[2] # 'AAAA-MM-JJ HH'
|
||||
rows = defaultdict(dict)
|
||||
for f in sorted(glob.glob(f"{D}/displacement/*.csv")):
|
||||
for r in csv.DictReader(open(f)):
|
||||
t = r["time_utc"][:16]
|
||||
rows[t][r["sensor_name"]] = r
|
||||
temp = {}
|
||||
for name in ("sensor_A0_deg_c", "sensor_thermal_deg_c"):
|
||||
for f in glob.glob(f"{D}/metrics/MICHIGAN_{name}_*.csv"):
|
||||
for r in csv.DictReader(open(f)):
|
||||
temp[(name, r["time_utc"][:13])] = r["metric"]
|
||||
print("instant cx_med cy_med ev_med ev_max(cible) POU22_ev rej A0 therm")
|
||||
for t in sorted(rows):
|
||||
if not (deb <= t <= fin):
|
||||
continue
|
||||
s = rows[t]
|
||||
cib = [r for n, r in s.items() if r["pattern_type"] == "target"]
|
||||
ok = [r for r in cib if r["corr_x"]]
|
||||
cx = st.median(float(r["corr_x"]) for r in ok) if ok else float("nan")
|
||||
cy = st.median(float(r["corr_y"]) for r in ok) if ok else float("nan")
|
||||
ev = st.median(float(r["error_value"]) for r in cib)
|
||||
mx = max(cib, key=lambda r: float(r["error_value"]))
|
||||
p = s.get("REFPOU22")
|
||||
pe = float(p["error_value"]) if p else float("nan")
|
||||
rej = "R" if p and pe > float(p["error_threshold"]) else "-"
|
||||
h = t[:13]
|
||||
print(f"{t} {cx:6.3f} {cy:6.3f} {ev:.3f} {float(mx['error_value']):.3f} {mx['sensor_name']:10s} {pe:.3f} {rej} {temp.get(('sensor_A0_deg_c', h), ''):5s} {temp.get(('sensor_thermal_deg_c', h), '')}")
|
||||
Reference in new issue
Block a user