"""Build labels.jsonl from work/existing.jsonl: keep, correct, add (verification of the range).""" import json, pathlib D = pathlib.Path(__file__).resolve().parent.parent existing = [json.loads(l) for l in open(D / "work/existing.jsonl")] TH_END = ("Deduced cause: the pose follows the housing temperature, and the quarry's rock face does not move " "with temperature. The structure is not moving, nothing to do.") corrected = { "NORDEND-216": dict(end="2026-11-07T14:00Z", description=( "After the rain, new marks of drops remain on the window (blurred discs visible every night from the 26/10 03:00 " "image, absent on 22/10, still there on 02/11 22:00), including one on the left part of the group, near CTR02, " "PR09, PR10 and PR11. Since then, the sigma0 of the registration is higher, the corrections of the references " "CTR02, CTR03 and CTR04 have changed level, and the corr of PR09, PR10 and PR11 stay offset (PR10 mostly on " "corr_y, PR09 on corr_x and corr_y, PR11 on both), with a slightly higher error_value; the other targets move " "little. The offset does not come back until the end of the range: the night levels of PR09, PR10 and PR11 in " "November are still those of the end of October. Cause seen on the images: the window is dirty. This is not a " "movement; clean the window, do not read these plateaus as a displacement.")), "NORDEND-228": dict(end="2026-11-01T06:00Z", description=( "Camera thermal cycle: in the morning, when the housing heats up in the sun (markedly, highest around 12:00), " "the camera turns: the pan drops markedly, the tilt rises by the same amount, the scale increases; then it comes " "back in the afternoon, the evening and all night, as the housing cools, with no rest until the turn of the next " "morning (01/11 06:00), when the next cycle starts. The compensation absorbs it poorly: the corr_x of PR16 and " "PR18 dips markedly around noon and comes back by 14:00; PR15 and PR17 follow more weakly; the corr_y of PR18 " "rises a little, that of PR10 drops markedly; the references CTR02 and CTR03 move away a little. " + TH_END)), "NORDEND-229": dict(start="2026-11-03T23:00Z", description=( "Camera thermal cycle of 04/11, which starts during the night: after the cooling of the evening of 03/11, the " "housing temperature rises again slowly from late evening, all night, then by day (highest around 14:00), and " "the camera turns: the pan drops markedly until early afternoon, the tilt rises markedly, the rotation drops a " "little, the scale increases; then from the evening, as the housing cools, it comes back, the pan rises " "markedly, the tilt drops by the same amount, the scale drops; it does not rest before the morning of 05/11. " "The compensation absorbs it poorly: the corr_y of PR12, PR05, PR10, PR06, PR01, PR03 and PR11, dropped the " "evening before, come back up through the morning; around 14:00 the corr_x of PR18, PR16, PR14, PR15 and PR13 " "dips a little and that of PR04 rises a little; at night the targets on the right edge (PR18, PR16, PR15, PR13) " "rise back in corr_x and the corr_y of PR16 and PR17 drops a little. Cobweb threads lit by the infrared cross " "the group of targets at night (04/11 02:00 thumbnail) without rejecting them. The jumps at 01:00, 01:15 and " "03:30 on 05/11 come from the reference CTR03 (separate labels). " + TH_END)), "NORDEND-230": dict(start="2026-11-01T00:00Z", description=( "CTR01 (local reference, read as a target) stays right at its threshold throughout the range, continuing its " "regime since 16/10 (labelled separately until 01/11): rejected for a large part of the time, almost without " "interruption from the morning of 01/11 to the afternoon of 02/11, then during much of the nights and the days " "until 04/11, almost all night from 04 to 05/11, then mostly by day, every morning until early afternoon; its " "curve is missing a large part of the time and its kept points are very noisy. It does not enter the " "compensation: its rejections do not make the other targets jump. On the thumbnails, its spot is small at night " "and almost invisible by day, while that of PR17 stays sharp (05/11 10:00, 06/11 11:00, 07/11 12:00). Cause not " "established: state of the prism, or of the window in front of it, to be checked. Ignore its curve; act on the " "target.")), } added = [ dict(start="2026-10-28T11:30Z", end="2026-10-28T12:00Z", family="Visibility", description=( "PR04 is rejected for one measurement at 11:45, markedly above its threshold, on a sunny day: one point is " "missing, its neighbours PR03 and PR05 stay measured and the next point is back. Its spot, weak as usual, is " "barely visible on the 12:00 thumbnail, without any obstacle, while those of PR05, PR16 and PR17 stay sharp. " "Cause not established: a weak target poorly seen in this light. Ignore this point; nothing to do.")), dict(start="2026-11-01T06:00Z", end="2026-11-02T06:30Z", family="Thermal displacement", description=( "Camera thermal cycle without a return at night: in the morning the housing warms up markedly (highest in " "early afternoon) and the camera turns: the pan drops strongly until late morning, the tilt rises markedly, the " "rotation drops, the scale increases; in the afternoon and the evening the pose comes back only a little, then " "stays at this level all night, because the housing stays warm until the next morning instead of cooling as on " "the nights before. The compensation absorbs it poorly: the corr_x of PR18 dips markedly in late morning and " "comes back only partly, that of PR13 dips markedly and stays lower all night, PR17, PR16 and PR15 a little; " "the corr_x of PR04 rises markedly; the corr_y of PR04 rises markedly, that of PR13, PR17, PR18 and PR15 a " "little, PR13 and PR15 staying up at night. The pose and the curves come back when the housing cools again, " "on the evening of 03/11 (separate labels). " + TH_END)), dict(start="2026-11-02T06:30Z", end="2026-11-03T07:00Z", family="Thermal displacement", description=( "Weak camera thermal cycle, on a day when the housing stays warm: its temperature rises only a little (highest " "around 14:00 to 15:00); the pan drops a little until mid-afternoon, the tilt rises a little, the scale " "increases slightly; then the camera comes back in the evening and stays there all night. The compensation " "absorbs it poorly: around 14:00 the corr_x of PR18 dips markedly, PR17, PR16 and PR15 a little, and that of " "PR04 rises markedly; the corr_y of PR04 rises markedly, PR09 and PR17 a little; the curves come back in the " "evening. The rejections of PR07 and the shifts of PR08 at night come from a cobweb thread (separate label). " + TH_END)), dict(start="2026-11-02T19:15Z", end="2026-11-03T06:00Z", family="Obstruction", description=( "Cobweb threads stretched in front of the lens, lit by the infrared, cross the group of targets that night; a " "bright knot of threads sits between PR07, PR06 and PR08 (02/11 22:00 image), and the spot of PR07 is barely " "visible on the 20:00 and 04:00 thumbnails, while PR06 and PR13 stay sharp. PR07 is rejected for a large part " "of the night, from 19:30 to 04:30, and between the rejections its kept points are wrong: its corr_x jumps up " "at 23:30, then slides down strongly through the second half of the night and its corr_y drops a little, until " "05:30. From 20:15 the error_value of PR08 rises and its corr_x drops by steps, markedly, its corr_y a little, " "without rejection, until 05:45. Both come back at 06:00. The other targets do not move. Cause seen on the " "images. Ignore the curves of PR07 and PR08 over the range; the structure is not moving. The threads have to " "be removed from the window.")), dict(start="2026-11-03T07:00Z", end="2026-11-03T23:00Z", family="Thermal displacement", description=( "Camera thermal cycle, with a return beyond the starting position: in the morning the housing warms a little " "(highest around noon) and the pan drops a little, the tilt rises a little, until late morning; around midday " "the pose fluctuates from one measurement to the next (jolts at 12:30 and 13:30, the second labelled " "separately); then from early afternoon the housing cools markedly, for the first time in three days, and the " "camera comes back beyond its morning position: the pan rises markedly, the tilt drops markedly, the scale " "drops, until late evening, when the housing starts warming again and the next cycle starts. The compensation " "absorbs it poorly: in the afternoon and the evening, as the camera comes back, the corr_y of PR12, PR05, PR10, " "PR06, PR01, PR03 and PR11 drops clearly, that of PR15, PR14 and PR16 a little, and they stay low until the next " "cycle brings them back; the corr_x of PR09 rises a little from the morning and stays raised, that of PR18 dips " "a little in late morning and rises above its level in the evening. Cobweb threads lit by the infrared cross " "the group of targets at night, one with a halo over PR18 (20:00 thumbnail), without rejection. " + TH_END)), dict(start="2026-11-03T13:15Z", end="2026-11-03T13:45Z", family="Displacement", description=( "For the duration of one measurement, at 13:30, in the middle of the camera thermal cycle (labelled " "separately), the pose makes a jolt: the tilt and the rotation jump then come back at the next measurement, " "and the raw positions of the sensors jump together in the image then come back. The compensation does not " "quite erase it: the corr_y of PR01 drops markedly, PR12, PR16, PR15, PR02 and PR05 a little; everything comes " "back at 13:45, as the afternoon return of the camera begins. No reference is lost (all three stay in the " "compensation) and no target is rejected apart from CTR01, rejected as usual; there is no image at 13:30. A " "smaller jolt of the pose at 12:30 leaves almost nothing on the curves. Cause not established: a jolt of the " "camera or of its mount, deduced from the pose, as on 05/11 at 12:00 (separate label). This is not a movement " "of the structure; points to ignore, the camera is to be watched if it repeats.")), dict(start="2026-11-01T00:00Z", end="2026-11-07T14:00Z", family="Obstruction", description=( "PR17, continuation of the mark on the window labelled until 01/11: its curves stay at the level reached after " "the rain of 24 to 25/10, its corr_x higher than at the beginning of October and its corr_y neither at its " "plateau of September nor at its level from before 05/09, until the end of the range, while its neighbours " "keep their levels; its error_value stays at its usual level from before the mark. On the night thumbnails a " "pale blurred area still lies under its spot (04/11 03:00), and cobweb threads lit by the infrared pass over " "it at times (02/11 03:00). From 05/11 its curves also carry the cycles and the spikes of the separate labels. " "Cause seen on the images; the exact nature of the mark is not established. This is not a movement of PR17; " "ignore its level over the range, clean the window.")), ] out = [] for e in existing: lid = e.pop("id") if lid in corrected: e.pop("review", None) e.update(corrected[lid]) out.append(e) out += added out.sort(key=lambda d: (d["start"], d["end"])) with open(D / "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), "kept,", len(corrected), "corrected,", len(added), "added")