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,30 @@
"""Per sensor of a station on a range: noise (median step), MAD, range of corr_x/corr_y, and the K-noise jumps of displacement.py.
Usage: python3 series.py <station folder> <from YYYY-MM-DD> <to YYYY-MM-DD> [sensor ...] (with sensors: prints their series)
"""
import statistics
import sys
from datetime import datetime, timezone
from pathlib import Path
ROOT = Path("/home/maxime/aimsight-optimizer")
sys.path[:0] = [str(ROOT / "detectors" / "scripts"), str(ROOT / "tools" / "scripts")]
from data import load, is_reference # noqa: E402
from episodes import noise # noqa: E402
folder, a, b = sys.argv[1:4]
show = sys.argv[4:]
day = lambda d: datetime.strptime(d, "%Y-%m-%d").replace(tzinfo=timezone.utc) # noqa: E731
ms_all = load(folder)
for s, ms in sorted(ms_all.items()):
ms = [m for m in ms if day(a) <= m["t"] < day(b)]
for ax in ("corr_x", "corr_y"):
v = [m[ax] for m in ms if m[ax] is not None]
if len(v) < 3:
continue
med = statistics.median(v)
mad = statistics.median(abs(x - med) for x in v)
print(f"{s:12} ref={is_reference(ms)!s:5} {ax} n={len(v)} noise={noise(v):.4f} mad={mad:.4f} "
f"min={min(v):.3f} max={max(v):.3f}")
if s in show:
for m in ms:
print(" ", m["t"].strftime("%m-%dT%H:%M"), m["corr_x"], m["corr_y"], m["error_value"], m["error_threshold"])