thermal_displacement: the camera moving with the cold, partial days, DAY_MATCH and MIN_WARM_HOURS removed
Removed (their benchmark contribution, each alone): the cold rule with COLD, which needed the station temperature and camera pose (Thermal found -64 at CLARIDEN and -19 at BREITHORN, 27 and 4 instants; Totals unchanged), so categories.py no longer reads them; PARTIAL days (Thermal found -1, correct -1); DAY_MATCH, every day of a cycle gets its episodes (Thermal found +8, correct -2); MIN_WARM_HOURS (none). The 24 h sinusoid by projection instead of least squares (same figures). The event sentences of the thermal varieties are now the episodes' texts. Benchmark Totals (from the previous commit): Thermal displacement found 74 -> 80 %, correct 75 -> 72 %; the other families unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fb32143722
commit
fe1adac89a
2 files changed
+102
-229
No files matched your search
+3
-10
@@ -28,7 +28,6 @@ Usage: python3 scripts/categories.py <station folder> (one line per event: fam
|
||||
classified alone, with the days of history before it if they exist; only the events touching the chunk are
|
||||
shown; "nothing" for a quiet chunk)
|
||||
"""
|
||||
import functools
|
||||
import importlib
|
||||
import sys
|
||||
from datetime import datetime, timedelta, timezone
|
||||
@@ -38,17 +37,11 @@ from pathlib import Path
|
||||
# sibling of this one (one copy of each repository in the home directory).
|
||||
HERE = Path(__file__).resolve().parent
|
||||
sys.path[:0] = [str(HERE), str(HERE.parents[1] / "aimsight-tools" / "scripts")]
|
||||
from data import iso, load, load_camera, load_temperature # noqa: E402
|
||||
from data import iso, load # noqa: E402
|
||||
|
||||
DETECTORS = ("displacement", "no_data", "target_issue", "thermal_displacement", "visibility") # modules next to this file
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def _station(folder):
|
||||
"""What thermal_displacement reads besides the measurements (D-124): temperature, camera pose; once per folder."""
|
||||
return {"temperature": load_temperature(folder), "camera": load_camera(folder)} if folder else {}
|
||||
|
||||
|
||||
# The families, in the order of the timeline rows; ignore: greyed zone (None: as its episodes
|
||||
# say: a total loss of visibility, strong heat shimmer); process: Images button, nothing, or Images and a link to
|
||||
# Diagnosis.
|
||||
@@ -182,12 +175,12 @@ def classify(episodes, references=frozenset()):
|
||||
|
||||
def events(measurements, end=None, folder=None):
|
||||
"""Measurements (data.load) -> events of all detectors: what the page receives. end: the end of the window read
|
||||
(batch run), for a hole touching it; folder: the station folder, for the temperature and the camera pose. A detector
|
||||
(batch run), for a hole touching it; folder: unused, kept for the callers. A detector
|
||||
that fails is skipped with a message (a broken detector does not block the page)."""
|
||||
episodes = []
|
||||
for name in DETECTORS:
|
||||
try:
|
||||
kw = {"end": end} if name == "no_data" else _station(folder) if name == "thermal_displacement" else {}
|
||||
kw = {"end": end} if name == "no_data" else {}
|
||||
episodes += importlib.import_module(name).detect(measurements, **kw)
|
||||
except Exception as e: # noqa: BLE001
|
||||
print(f"Detectors: {name} skipped ({type(e).__name__}: {e})", file=sys.stderr)
|
||||
|
||||
Reference in new issue
Block a user