sessions of 2026-11-18 (the optimization campaign; three runs without summary, interrupted and rerun)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-18 17:47:59 +01:00
1 parent 8a81c53cd9
commit 0cfbd1b7bc
363 files changed
+30822

No files matched your search

@@ -0,0 +1,21 @@
# Prints, for some sensors of a station over [FROM, TO), each error_value with its MAD score and whether visibility.py counts it high (K_MAD and FACTOR). Args: <station folder> <from ISO> <to ISO> SENSOR...
import sys
from datetime import datetime
sys.path[:0] = ["/home/maxime/aimsight-detectors/scripts", "/home/maxime/aimsight-tools/scripts"]
from data import load # noqa: E402
from episodes import level # noqa: E402
import visibility as v # noqa: E402
folder, a, b, *sensors = sys.argv[1:]
a, b = (datetime.fromisoformat(x.replace("Z", "+00:00")) for x in (a, b))
ms = load(folder)
for s in sensors:
e = [m["error_value"] for m in ms[s] if m["error_value"] is not None]
med, mad = level(e)
print(s, f"median {med:.3g} MAD {mad:.3g} threshold {ms[s][0]['error_threshold']}")
for m in ms[s]:
if a <= m["t"] < b and m["error_value"] is not None:
x = m["error_value"]
high = x > med + v.K_MAD * mad and x > v.FACTOR * med
print(" ", m["t"].strftime("%m-%d %H:%M"), f"{x:.3g}", f"{(x - med) / mad:5.1f} MAD", "HIGH" if high else "")