toolbox: projection rendering + world-frame check; gel centre fix
Browse files- toolbox/calib_epoch.py +31 -10
toolbox/calib_epoch.py
CHANGED
|
@@ -82,6 +82,8 @@ EPOCH_DIRS = {
|
|
| 82 |
# identical gel-to-rigid transform, so the two disagree only about where the
|
| 83 |
# cameras were. Re-check with the projection comparison if the previews ever
|
| 84 |
# look off.
|
|
|
|
|
|
|
| 85 |
CALIB_SESSIONS = {
|
| 86 |
("motherboard", "2026-05-10"): "2026-05-12",
|
| 87 |
("motherboard", "2026-05-11"): "2026-05-12",
|
|
@@ -98,24 +100,43 @@ CALIB_SESSIONS = {
|
|
| 98 |
("pushT", "2026-09-10"): "2026-09-09",
|
| 99 |
("pushT", "2026-09-11"): "2026-09-09",
|
| 100 |
("pushT", "2026-09-12"): "2026-09-09",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
}
|
| 102 |
|
| 103 |
|
| 104 |
def session_epoch(task: str, date: str) -> str:
|
| 105 |
-
"""The epoch a recording session
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
"""
|
| 111 |
try:
|
| 112 |
return CALIB_SESSIONS[(task, date)]
|
| 113 |
except KeyError:
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
|
| 121 |
|
|
|
|
| 82 |
# identical gel-to-rigid transform, so the two disagree only about where the
|
| 83 |
# cameras were. Re-check with the projection comparison if the previews ever
|
| 84 |
# look off.
|
| 85 |
+
CURRENT_EPOCH = "2026-09-09"
|
| 86 |
+
|
| 87 |
CALIB_SESSIONS = {
|
| 88 |
("motherboard", "2026-05-10"): "2026-05-12",
|
| 89 |
("motherboard", "2026-05-11"): "2026-05-12",
|
|
|
|
| 100 |
("pushT", "2026-09-10"): "2026-09-09",
|
| 101 |
("pushT", "2026-09-11"): "2026-09-09",
|
| 102 |
("pushT", "2026-09-12"): "2026-09-09",
|
| 103 |
+
# rope's sessions, same epoch: the operator confirms the cameras were not
|
| 104 |
+
# moved between the 2026-09-09 measurement and the 2026-09-14 session.
|
| 105 |
+
# Declared, not inferred -- five days apart says nothing on its own, as
|
| 106 |
+
# pushT's 2026-06-18 belonging to the June-26 solve shows.
|
| 107 |
+
("rope", "2026-09-11"): "2026-09-09",
|
| 108 |
+
("rope", "2026-09-14"): "2026-09-09",
|
| 109 |
}
|
| 110 |
|
| 111 |
|
| 112 |
def session_epoch(task: str, date: str) -> str:
|
| 113 |
+
"""The epoch a recording session was made through.
|
| 114 |
+
|
| 115 |
+
An explicit declaration always wins. Failing that, a session dated ON OR
|
| 116 |
+
AFTER `CURRENT_EPOCH` gets it — the operator's standing decision
|
| 117 |
+
(2026-09-15), and not the inference this module forbids: the live recorder
|
| 118 |
+
resolves its own overlay through `current_epoch()`, so a recording made
|
| 119 |
+
after the solve was made THROUGH that solve. That is a fact about how the
|
| 120 |
+
rig ran, not a guess from the calendar.
|
| 121 |
+
|
| 122 |
+
A session dated BEFORE the current solve still has to declare. For those
|
| 123 |
+
the calendar genuinely says nothing — pushT's 2026-06-18 belongs to the
|
| 124 |
+
June-26 solve, measured eight days LATER — and a task-level fallback is
|
| 125 |
+
how a session once shipped through another session's extrinsics with
|
| 126 |
+
nobody noticing.
|
| 127 |
"""
|
| 128 |
try:
|
| 129 |
return CALIB_SESSIONS[(task, date)]
|
| 130 |
except KeyError:
|
| 131 |
+
pass
|
| 132 |
+
if date >= CURRENT_EPOCH:
|
| 133 |
+
return CURRENT_EPOCH
|
| 134 |
+
known = sorted(d for t, d in CALIB_SESSIONS if t == task)
|
| 135 |
+
raise KeyError(
|
| 136 |
+
f"{task}: session {date!r} predates the current epoch "
|
| 137 |
+
f"{CURRENT_EPOCH} and does not declare one. Declared sessions: "
|
| 138 |
+
f"{known}. Add it to calib_epoch.CALIB_SESSIONS — for a session older "
|
| 139 |
+
f"than the current solve the date decides nothing.")
|
| 140 |
|
| 141 |
|
| 142 |
|