32 lines
4.0 KiB
Python
32 lines
4.0 KiB
Python
"""Build labels.jsonl from existing.jsonl: keep, correct (bounds/description, review dropped), add."""
|
|
import json, sys
|
|
D = sys.argv[1]
|
|
ex = [json.loads(l) for l in open(f"{D}/work/existing.jsonl")]
|
|
corr = {
|
|
"CLARIDEN-25": {"start": "2026-10-20T20:40Z", "end": "2026-10-20T21:40Z"},
|
|
"CLARIDEN-26": {"end": "2026-10-22T08:50Z"},
|
|
"CLARIDEN-28": {"start": "2026-10-22T08:50Z"},
|
|
"CLARIDEN-33": {"end": "2026-10-26T15:10Z"},
|
|
"CLARIDEN-38": {"start": "2026-10-29T23:50Z", "end": "2026-10-30T00:10Z"},
|
|
"CLARIDEN-39": {"end": "2026-10-30T17:50Z", "description": "Four measurements are missing in less than an hour, for all sensors: the curves have a gap. The station's own record stops too: its minute-by-minute synchronizations are missing over the same half hour, while the 17:00 image exists and the voltage stays normal before and after, so it is not a lack of energy. The other stations measuring at that time (ALASKA, FLORIDA, JUNGFRAU, LENZSPITZE, NADELHORN, NORDEND, SNCF01, WYOMING) have their measurements: the cause is specific to the station, not established. The curves are missing over the range; nothing to do unless it repeats."},
|
|
"CLARIDEN-40": {"start": "2026-10-31T13:50Z"},
|
|
"CLARIDEN-41": {"start": "2026-10-31T18:40Z"},
|
|
"CLARIDEN-42": {"start": "2026-10-31T22:20Z"},
|
|
}
|
|
add = [
|
|
{"start": "2026-10-25T19:10Z", "end": "2026-10-29T04:00Z", "family": "Displacement", "description": "After their rise in jolts of the 24th and 25th, the left targets of row A slowly go back down vertically from the 26th to the 29th, back to about their level from before the jolts: D-304-A, D-303-A, D-302_A and D-301-A above all, P-299-A and P-298-A less; their horizontal stays shifted. Their position in the image comes back with their curves, relative to the other targets; no camera step, ordinary recognition error. Same dates as the partial return of D-304-C and D-303-C, labeled separately. This is the return of the agitation of the 24th and 25th, labeled separately. Cause not established, in a tunnel under construction: a movement of these targets is not excluded. To be checked against the other measurements of the site; monitor this row."},
|
|
{"start": "2026-10-30T18:10Z", "end": "2026-10-30T18:30Z", "family": "Displacement", "description": "For the duration of one measurement, the left targets of row A (D-300-A, D-301-A, D-302_A, D-303-A, D-304-A, P-299-A, P-298-A) and PR-283, PR-284 jump together horizontally, then return at the next measurement; D-303-C and D-304-C move a little the other way. Their raw positions in the image do not move: it is the reference PR-291 that shifts alone horizontally for this measurement, its recognition error rising a little without reaching its threshold, and the compensation passes its shift into the targets. No image at that minute; nothing in front of the scene on the 18:00 and 19:00 images. Cause not established. Not a movement of the structure: point to ignore."},
|
|
{"start": "2026-10-31T09:20Z", "end": "2026-10-31T15:00Z", "family": "Thermal displacement", "description": "The camera housing temperature rises a little in the late morning of the 31st, and the camera scale rises with it while the pan goes down, until early afternoon; they come back when the housing cools, mostly during the view obstruction of the early afternoon, labeled separately. The compensation absorbs most of it, but a few corrected curves follow a little over these hours and come back with it: D-301-C horizontally, D-304-C, D-303-C and D-304-B vertically. Only a light at the far end of the tunnel on the 12:00 image, nothing in front of the targets. Camera movement by thermal effect, deduced from its pose against the housing temperature; normal, nothing to do."},
|
|
]
|
|
out = []
|
|
for l in ex:
|
|
l = dict(l); lid = l.pop("id")
|
|
if lid in corr:
|
|
l.update(corr[lid]); l.pop("review", None)
|
|
out.append(l)
|
|
out += add
|
|
out.sort(key=lambda d: (d["start"], d["end"]))
|
|
with open(f"{D}/labels.jsonl", "w") as f:
|
|
for l in out: f.write(json.dumps(l, ensure_ascii=False) + "\n")
|
|
print(len(out))
|