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,23 @@
"""Prints why thermal_displacement._wave accepts or rejects a station window: axes, concerned share, sine R2 share, wave profile. Args: <detectors> <station folder> <from> <to>"""
import statistics
import sys
from datetime import datetime, timedelta, timezone
from pathlib import Path
det = Path(sys.argv[1]).resolve()
sys.path[:0] = [str(det / "scripts"), str(det.parents[0] / "aimsight-tools" / "scripts")]
from data import load, is_reference # noqa
import thermal_displacement as T # noqa
day = lambda d: datetime.strptime(d, "%Y-%m-%d").replace(tzinfo=timezone.utc)
a, b = day(sys.argv[3]) - timedelta(days=3), day(sys.argv[4])
ms = {s: [m for m in v if a <= m["t"] < b] for s, v in load(sys.argv[2]).items()}
for cols in (("corr_x", "corr_y"), ("x", "y")):
targets = {s: v for s, v in ms.items() if not is_reference(v)}
axes = [(s, c, *r) for s, v in targets.items() for c in cols if (r := T._axis(v, c))]
conc = [x for x in axes if x[3] and statistics.median(x[3].values()) >= T.REPRO]
print(cols, "axes", len(axes), "targets", len({x[0] for x in axes}), "concerned targets", len({x[0] for x in conc}))
for x in axes:
print(" ", x[0], x[1], "days", len(x[3]), "median likeness %.2f" % (statistics.median(x[3].values()) if x[3] else 0))
r2 = {s: [r for c in cols if (r := T._sine_r2(v, c)) is not None] for s, v in targets.items()}
r2 = {s: v for s, v in r2.items() if v}
print(" R2>=%.1f:" % T.R2_MIN, sum(max(v) >= T.R2_MIN for v in r2.values()), "of", len(r2),
" ".join(f"{s}:{max(v):.2f}" for s, v in sorted(r2.items())))