Clean the journal curves, unfold its timeline and sort it in batches (D-056)

Plan points 18 to 26, 30, 39, 40 and the point 37 housekeeping:
- greyed zones per target, vertical scale without the zones to ignore, Fit all,
  mm by default with a px switch, Support view, Expand (one row per category);
- cleaned curves: cut in the zones to ignore, raw data kept there in thin grey;
- target02 to target05 count as targets; smoothing questions answered;
- categories.py sorts in slices with 3 days of history by default;
- the pumping script points to ~/monitoring-dashboard and skips diff images;
- CLAUDE.md back under 200 lines; a case page is named after its case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-10-24 14:31:42 +02:00
1 parent 86547f089b
commit 955566d86f
14 files changed
+303 -98

No files matched your search

+10 -6
View File
@@ -3,7 +3,7 @@ spec : vues-deplacements/maquette/spec.md.
Lit l'export « advanced » d'un dossier de station avec l'outil donnees.py de l'agent (positions, error_value) et son
export horaire (déplacements en mm), liste les images et les captures de la plateforme, puis remplit
explore_template.html. Écrit out/vues_deplacements_<STATION>.html et l'ouvre dans le navigateur.
explore_template.html. Écrit out/vues_deplacements_<STATION>.html (<cas> pour un dossier de cas) et l'ouvre dans le navigateur.
Usage : python3 vues-deplacements/maquette/explore.py [dossier de station] (défaut : le cas NORDEND d'octobre 2026)
"""
import csv
@@ -57,7 +57,7 @@ def hourly(path):
names = sorted(c[:-len("_vertical_displacement")] for c in rows[0] if c.endswith("_vertical_displacement"))
times = [datetime.fromisoformat(r["timestamp"]).replace(tzinfo=HOURLY_TZ) for r in rows]
return {"times": [donnees.iso(t) for t in times],
"sensors": {n: {"h": [num(r[f"{n}_horizontal_displacement"]) for r in rows],
"sensors": {n.strip(): {"h": [num(r[f"{n}_horizontal_displacement"]) for r in rows], # NIEDERHORN : « …_C09\r »
"v": [num(r[f"{n}_vertical_displacement"]) for r in rows]} for n in names}}
@@ -184,8 +184,9 @@ def build(folder):
minute = lambda t: t.replace(second=0, microsecond=0) # noqa: E731 (instants à la minute, comme donnees.iso)
instants = sorted({minute(m["t"]) for ms in mesures.values() for m in ms})
col = {t: j for j, t in enumerate(instants)}
order = lambda s: (KINDS.index(mesures[s][0]["pattern_type"]) if mesures[s][0]["pattern_type"] in KINDS # noqa: E731
else len(KINDS), s)
# les cibles d'un autre motif (target02 à target05 à PS des Coudres) sont des cibles comme les autres (point 39)
kind = lambda s: "target" if mesures[s][0]["pattern_type"].startswith("target") else mesures[s][0]["pattern_type"] # noqa: E731
order = lambda s: (KINDS.index(kind(s)) if kind(s) in KINDS else len(KINDS), s) # noqa: E731
sensors = []
for name in sorted(mesures, key=order):
ms = mesures[name]
@@ -194,7 +195,7 @@ def build(folder):
for c in row:
row[c][col[minute(m["t"])]] = m[c]
xs, ys = [v for v in row["x"] if v is not None], [v for v in row["y"] if v is not None]
sensors.append({"name": name, "kind": ms[0]["pattern_type"], "threshold": ms[0]["error_threshold"],
sensors.append({"name": name, "kind": kind(name), "threshold": ms[0]["error_threshold"],
"x": row["x"], "y": row["y"],
"home": [statistics.median(xs), statistics.median(ys)] if xs and ys else None,
"values": {c: row[c] for c in COLUMNS}})
@@ -235,7 +236,10 @@ def page(folder):
text = text.replace("/*DATA*/null", json.dumps(data).replace("</", "<\\/"))
text = text.replace("/*AUTOSCALE*/", AUTOSCALE_Y_JS.replace("'{plot_id}'", "plotId")) # ordonnée recalée (D-013)
OUT.mkdir(exist_ok=True)
out = OUT / f"vues_deplacements_{Path(folder).resolve().name}.html"
# nom du dossier, ou du cas pour un dossier de vues-deplacements/cas/<cas>/<STATION> : data/NORDEND et le cas
# 2026-10_NORDEND n'écrivent plus la même page (point 37 du plan)
d = Path(folder).resolve()
out = OUT / f"vues_deplacements_{d.parent.name if d.parent.parent.name == 'cas' else d.name}.html"
out.write_text(text)
return out