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,13 @@
#!/bin/bash
# Runs the four checks of the session (events, sensors, range, benchmark) on the live detectors, writes <check>-S<n>.txt and compares with the previous state.
# Usage: bash checks.sh <n> <previous suffix, e.g. S2 or before> (run from the Optimizer root)
S=sessions/ALASKA_2026-11-04T2358_2026-11-16T1217_20261118T0951Z
n=$1; prev=$2
python3 detectors/scripts/categories.py data/ALASKA --from 2026-11-04 --to 2026-11-17 > $S/events-S$n.txt 2>&1
python3 detectors/bench/sensors.py data/ALASKA --from 2026-11-04 --to 2026-11-17 > $S/sensors-S$n.txt 2>&1
python3 detectors/bench/score.py data/ALASKA --labels labeling/auto/ALASKA.jsonl --from 2026-11-04 --to 2026-11-17 > $S/range-S$n.txt 2>&1
python3 detectors/bench/regression.py --labels labeling/auto --data data > $S/benchmark-S$n.txt 2>&1
echo "== events"; diff $S/events-$prev.txt $S/events-S$n.txt
echo "== range"; diff $S/range-$prev.txt $S/range-S$n.txt
echo "== benchmark"; python3 detectors/bench/compare.py $S/benchmark-$prev.txt $S/benchmark-S$n.txt
echo "== skipped"; grep -c skipped $S/benchmark-S$n.txt $S/events-S$n.txt
@@ -0,0 +1,19 @@
# Lists the holes of a station with exactly N missing steps (rounded) and the labels touching each hole (id, family).
# Usage: python3 holes.py <station folder> <labels.jsonl> <N>
import json
import sys
from pathlib import Path
sys.path[:0] = [str(Path.home() / "aimsight-tools" / "scripts"), str(Path.home() / "aimsight-detectors" / "scripts")]
from data import iso, load # noqa: E402
from episodes import cadence # noqa: E402
ms = load(sys.argv[1])
labels = [json.loads(x) for x in open(sys.argv[2]) if x.strip()]
n = int(sys.argv[3])
step = cadence(ms)
ts = sorted({m["t"].replace(second=0, microsecond=0) for v in ms.values() for m in v})
for a, b in zip(ts, ts[1:]):
if round((b - a) / step) - 1 == n:
hit = [(x["id"], x["family"]) for x in labels if x["start"] <= iso(b) and x["end"] >= iso(a)]
print(iso(a), iso(b), hit)
@@ -0,0 +1,28 @@
# Prints, around given instants, each target's corr_x/corr_y jump from the median of the 4 previous measurements, in noises (median step) of the series.
# Usage: python3 jumps.py <station folder> <iso instant> [<iso instant> ...]
import statistics
import sys
from pathlib import Path
sys.path.insert(0, str(Path.home() / "aimsight-tools" / "scripts"))
from data import is_reference, load, parse_time # noqa: E402
ms = load(sys.argv[1])
for when in sys.argv[2:]:
t0 = parse_time(when)
print(when)
for s, rows in sorted(ms.items()):
if is_reference(rows):
continue
line = []
for col in ("corr_x", "corr_y"):
kept = [m for m in rows if m[col] is not None]
v = [m[col] for m in kept]
n = statistics.median(abs(b - a) for a, b in zip(v, v[1:]))
i = next((k for k, m in enumerate(kept) if abs((m["t"] - t0).total_seconds()) < 420), None)
if i is None or i < 4:
line.append(f"{col}: -")
continue
base = statistics.median(v[i - 4:i])
line.append(f"{col}: {(v[i] - base) / n:+6.1f}n")
print(f" {s:10} " + " ".join(line))