auto: the analysts verified the labels of 32 periods (11 stations, up to 14 days each): 710 labels -> 835, 587 unchanged; one analysis folder per period with its report (section Verification)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 15:13:44 +01:00
1 parent df979301b5
commit 2a5d87659b
279 files changed
+10758 -710

No files matched your search

@@ -0,0 +1,52 @@
"""Builds labels.jsonl from work/existing.jsonl: kept labels unchanged (review included, id dropped), corrected ones
replaced (review dropped), added ones appended; sorted by start. Checks the bounds are measurement instants."""
import json, os, sys
sys.path.insert(0, "tools/scripts")
import data
HERE = os.path.join(os.path.dirname(__file__), "..")
RAIN = "deduced from the nearby MeteoSwiss weather station (Nyon / Changins, a few km away), which measures rain at the same hours"
CORRECTED = {
"JUNGFRAU-67": {"start": "2026-10-21T12:45Z", "end": "2026-10-21T14:45Z", "family": "Visibility", "description":
"The reference basis hesitates in the early afternoon, during rain: from one measurement to the next, the corrections of all the targets, and those of the references, switch together between two levels, mostly in corr_x (BJ_G, PBJ_C, BL_G, BJ_D), then calm down. The error_value of REF_G rises a little at times, that of REF_CT and of most targets a little too, without rejection. Thumbnails of 12:00 and 14:00: spot of REF_G whole on a light daytime background, nothing in front. Cause: rain likely, " + RAIN + "; no drop is seen on the images. This is not a movement; small deviations not to be trusted."},
"JUNGFRAU-69": {"start": "2026-10-21T16:45Z", "end": "2026-10-21T19:45Z", "family": "Visibility", "description":
"At nightfall, during rain, the error_value of REF_G rises in jolts, under its threshold, and the corr_y of most targets (BJ_C, BJ_D, BJ_G, PM_C) jumps from one measurement to the next, in one direction then the other, until early evening. 18:00 thumbnail: spot of REF_G whole, nothing in front. Cause: rain likely, " + RAIN + ". This is not a movement; small deviations not to be trusted."},
"JUNGFRAU-70": {"start": "2026-10-22T00:15Z", "end": "2026-10-22T02:45Z", "family": "Visibility", "description":
"REF_G poorly seen at night, and REF_D a little, during rain: their error_value rises clearly, far from the threshold, none is discarded; the targets and REF_CT do not move in error_value. Seen on the 01:30 and 02:15 thumbnails: the spot of REF_G shrinks and pales, that of REF_D a little, with no visible obstacle or veil on the background; that of REF_CT is intact. The camera registration degrades and the corrections of several targets slip slightly (corr_x of BJ_G, PBJ_C, BL_G), then return within two measurements when REF_G becomes sharp again, around 02:30, when the rain stops. Cause: rain likely, " + RAIN + "; the two references are in the open, off the bridge. The structure does not move; it is the reference basis that is disturbed, nothing to do."},
"JUNGFRAU-75": {"start": "2026-10-23T07:15Z", "end": "2026-10-23T12:15Z", "family": "Visibility", "description":
"Drop in visibility in the morning, during rain: the error_value of most targets and of REF_G rises from early morning until late morning, PM_C is rejected three times. The 09:00 image shows a grey scene without shadows and a wet road; on the thumbnails nothing is in front of the targets, and their spots look as they do after the episode. The corrections of most targets and of the references first jump together several times from one measurement to the next; then BJ_G and BJ_D move apart in corr_x in opposite directions, the corr_y of BJ_D sinks and BL_G, PBL_C, PBJ_C stay shifted in corr_x, until late morning; everything comes back when the error_value returns to its level. The drop in corr_y of the morning warming (separate label) is mixed in. Cause: rain, deduced from the wet road on the image and from the rain measured at the nearby MeteoSwiss weather station at the same hours. The structure does not move; curves of the morning not to be trusted, nothing to do."},
"JUNGFRAU-77": {"start": "2026-10-23T21:45Z", "end": "2026-10-23T23:45Z", "family": "Visibility", "description":
"The reference REF_G is seen slightly less well in late evening, during rain: its error_value rises in jolts, under its threshold, that of most targets a little, and the corr_x of most targets (BL_G, BJ_G, BJ_C, BL_D) makes small common jumps in one direction then the other, with the corrections of the references, then calms down before midnight. On the 22:45 thumbnail the spot of REF_G is a little smaller than at 21:00 and at midnight, nothing in front; REF_CT and BL_D unchanged. Cause: rain likely, " + RAIN + ". This is not a movement; small deviations not to be trusted."},
"JUNGFRAU-78": {"start": "2026-10-24T03:00Z", "end": "2026-10-24T12:45Z", "family": "Visibility", "description":
"Slight drop in visibility in the morning, during light rain: the error_value of REF_G rises in jolts, that of several targets (PM_C, PM_D, PBL_C, BL_C) a little; no measurement rejected besides PM_G, references all kept. The corrections of most targets make small common jumps from one measurement to the next all morning, then calm down in the early afternoon. Seen on the 08:00 thumbnail: REF_G sharp, nothing in front. Cause: rain likely, " + RAIN + " all morning. The structure does not move; small deviations not to be trusted, nothing to do."},
"JUNGFRAU-81": {"start": "2026-10-25T16:45Z", "end": "2026-10-26T10:00Z", "family": "Thermal displacement", "description":
"Cooling of the evening and the night: when visibility returns, the corr_y of the bridge targets (BJ_D, BJ_C, PM_D, BJ_G) rises all night and until mid-morning of 26/10, while the camera tilt already goes down; BJ_D goes back down in corr_x; the loss of REF_G during the night (separate label) is superimposed. Deduced from the curves and the camera housing temperature, which drops until morning. The bridge rises as it cools: normal, nothing to do."},
}
REMOVED = set()
ADDED = [
{"start": "2026-10-24T06:30Z", "end": "2026-10-24T17:00Z", "family": "Thermal displacement", "description":
"Weak warming of a rainy day: the corr_y of the bridge targets goes down from the morning until late afternoon (PBJ_C above all, PM_D, PM_C, BL_D), while the camera housing temperature rises a little in the morning then stays flat; the camera pan rises a little from late morning. The drop in visibility of the morning (separate label) is superimposed until the early afternoon. Deduced from the curves, the housing temperature and the same cycle on the other days of the week. The bridge expands: normal, nothing to do."},
{"start": "2026-10-24T17:00Z", "end": "2026-10-25T00:15Z", "family": "Thermal displacement", "description":
"Cooling of the evening: the corr_y of the bridge targets (PBJ_C, PM_D, BL_D, PBL_D) rises from late afternoon until midnight, while the camera housing temperature drops; the rain disturbance from late evening (separate label) is superimposed, and after midnight the thermal part can no longer be separated from it. Deduced from the curves and the housing temperature. The bridge rises as it cools: normal, nothing to do."},
]
existing = [json.loads(l) for l in open(os.path.join(HERE, "work", "existing.jsonl")) if l.strip()]
out = []
for e in existing:
if e["id"] in REMOVED:
continue
out.append(CORRECTED.get(e["id"]) or {k: v for k, v in e.items() if k != "id"})
out += ADDED
out.sort(key=lambda d: (d["start"], d["end"]))
S = data.load("data/JUNGFRAU")
instants = {data.iso(m["t"].replace(second=0, microsecond=0)) for m in S["REF_G"]}
for d in out:
for k in ("start", "end"):
assert d[k] in instants, (d[k], "not a measurement instant")
assert d["start"] < d["end"]
with open(os.path.join(HERE, "labels.jsonl"), "w") as f:
for d in out:
f.write(json.dumps(d, ensure_ascii=False) + "\n")
print(len(out), "labels;", len(existing) - len(CORRECTED) - len(REMOVED), "kept,", len(CORRECTED), "corrected,", len(REMOVED), "removed,", len(ADDED), "added")
@@ -0,0 +1,40 @@
"""Per-instant table of one column for all sensors, plus pose and number of references kept.
usage: python3 q.py START END COLUMN [delta] (delta: print difference from previous measurement)"""
import sys, pickle, os
sys.path.insert(0, "tools/scripts")
import data
CACHE = os.path.join(os.path.dirname(__file__), "..", "work", "cache.pkl")
if os.path.exists(CACHE):
S, P = pickle.load(open(CACHE, "rb"))
else:
a, b = data.parse_time("2026-10-20T00:00Z"), data.parse_time("2026-11-02T00:00Z")
S = {s: [dict(m, t=m["t"].replace(second=0, microsecond=0)) for m in ms if a <= m["t"] <= b] for s, ms in data.load("data/JUNGFRAU").items()}
P = {p["t"].replace(second=0, microsecond=0): p for p in data.load_camera("data/JUNGFRAU") if a <= p["t"] <= b}
pickle.dump((S, P), open(CACHE, "wb"))
start, end, col = data.parse_time(sys.argv[1]), data.parse_time(sys.argv[2]), sys.argv[3]
delta = len(sys.argv) > 4
names = [s for s in S if s != "PM_G"]
refs = ["REF_CT", "REF_D", "REF_G"]
order = refs + sorted(n for n in names if n not in refs)
print("time " + " ".join(f"{n[:7]:>7}" for n in order) + " tilt pan rot scale sig0 nref")
prev = {}
by = {s: {m["t"]: m for m in S[s]} for s in order}
times = sorted({t for s in order for t in by[s] if start <= t <= end})
for t in times:
row = []
for s in order:
m = by[s].get(t)
v = m.get(col) if m else None
rej = m and data.rejected(m)
if v is None:
row.append(f"{'r' if rej else '-':>7}")
continue
out = v - prev[s] if delta and s in prev else (v if not delta else 0.0)
prev[s] = v
row.append(f"{out:7.3f}" + ("" if not rej else ""))
p = P.get(t)
nref = sum(1 for r in refs if by[r].get(t) and by[r][t].get("inlier") == 1)
pose = f"{p['tilt']:7.4f} {p['pan']:7.4f} {p['rotation']:6.3f} {p['scale']:.5f} {p['sigma0'] if p['sigma0'] is not None else float('nan'):5.2f}" if p else " no pose"
print(t.strftime("%d %H:%M") + " " + " ".join(row) + " " + pose + f" {nref}")
@@ -0,0 +1,30 @@
"""Median corr_x, corr_y of the targets (own level removed), smoothed over 5 measurements, with the housing temperature,
the tilt and the pan, one line per measurement (every N): to read the turning points of the thermal cycles.
usage: python3 turn.py START END [every]"""
import sys, pickle, os, statistics
sys.path.insert(0, "tools/scripts")
import data
S, P = pickle.load(open(os.path.join(os.path.dirname(__file__), "..", "work", "cache.pkl"), "rb"))
T = {t.replace(minute=0, second=0, microsecond=0): v for t, v in data.load_temperature("data/JUNGFRAU")}
start, end = data.parse_time(sys.argv[1]), data.parse_time(sys.argv[2])
every = int(sys.argv[3]) if len(sys.argv) > 3 else 1
targets = [s for s in S if not s.startswith("REF") and s != "PM_G"]
lvl = {(s, c): statistics.median([m[c] for m in S[s] if m[c] is not None]) for s in targets for c in ("corr_x", "corr_y")}
times = sorted({m["t"] for s in targets for m in S[s]})
med = {}
for t in times:
for c in ("corr_x", "corr_y"):
v = [m[c] - lvl[(s, c)] for s in targets for m in [next((m for m in S[s] if m["t"] == t), None)] if m and m[c] is not None]
med[(t, c)] = statistics.median(v) if v else None
sel = [t for t in times if start <= t <= end]
for i, t in enumerate(sel):
if i % every:
continue
j = times.index(t)
w = [times[k] for k in range(max(0, j - 2), min(len(times), j + 3))]
sm = {c: statistics.median([med[(u, c)] for u in w if med[(u, c)] is not None]) for c in ("corr_x", "corr_y")}
p = P.get(t)
temp = T.get(t.replace(minute=0))
print(t.strftime("%d %H:%M"), f"cx {sm['corr_x']:+.3f} cy {sm['corr_y']:+.3f}",
f"T {temp:5.1f}" if temp else "T - ", f"tilt {p['tilt']:.4f} pan {p['pan']:.4f}" if p else "no pose")