"""Builds labels.jsonl: the existing labels kept as they are (review included, id removed), the corrected ones rewritten (review removed), the removed one dropped, the added ones; sorted by start.""" import json, os O = os.path.join(os.path.dirname(__file__), '..') REMOVED = {'LENZSPITZE-40'} CORRECTED = { 'LENZSPITZE-41': {"start": "2026-10-25T17:30Z", "end": "2026-10-26T09:20Z", "family": "Visibility", "description": "From nightfall, before the first rejections, the corr_x of the nearby target 1024 shifts strongly and stays shifted, while the light of 1024, 1002 and 1004 fades and the corr_x of 1002, 1004 and of the reference 8014 drifts slowly; 1002 is rejected from late evening. Then, the worst night of the batch: the flux of almost all the references and of the distant targets falls to nothing, their image becomes blurred and ambiguous, and that of the nearby targets also drops; the references 8012, 8014, 92H, 8011, 8013, 8004 then 8002 are rejected one after the other. Only 8017 and 8019 stay well seen all night, with their light; but two references are not enough: from the end of the night until dawn, the compensation retains none, the registration error is no longer computed and the corr of 8017 and 8019 stay frozen. About twenty targets are rejected (the distant 101B, 102H, 201B, 202H, 7013H, 8003, 8010, 1002, 1004, then at dawn the nearby 1001, 1003, 1005, 1007, 1008, 1011, 1013 as well); the curves that remain jump and drift together, mostly in corr_x, without movement of their own. On the 22:01 image, the distant spots in the middle of the field are paler than at nightfall; on the 04:01 image they have almost all disappeared, while they are sharp on a calm night; nothing in front of the lens; at 06:01, clear dawn against the light. Probable cause: night mist or dampness, not established. The references return from sunrise, with their light, the rejections stop in the morning, the curves stay agitated until mid-morning. Without references, no measurement is possible: the measurements of the range are invalid; this is not a movement."}, 'LENZSPITZE-64': {"start": "2026-10-31T07:40Z", "end": "2026-11-01T06:55Z", "family": "Thermal displacement", "description": "Thermal cycle of the day, in overcast weather (12:00 image): 1007, 1002 and 1005 rise a little, 1020 goes down a little until late morning, then everything stays at the same level until late afternoon, like the housing temperature; the camera rotates slightly. In late afternoon, the housing temperature drops sharply: the targets return from the wave of the day then go beyond their level (the corr_x of 1015, 1020, 1011, 1007 and 8002 go down together, the corr_y of 1020 rises, those of 1007, 1005 and 1002 go down, the camera rotates in pan); in the first half of the night, while the housing temperature rises a little, they partly return toward their level, without quite regaining it; before dawn the housing temperature drops again and the pan drifts back up with it, without a rest, until the cycle of the next morning (separate label). Cause deduced: the movement follows the housing temperature, which rises with the day then drops, and the camera pose moves with it; it comes back every day the temperature rises. Normal, nothing to do."}, 'LENZSPITZE-68': {"start": "2026-11-01T06:55Z", "end": "2026-11-01T11:40Z", "family": "Thermal displacement", "description": "Thermal cycle of the day, in the sun (07:00 image: the sun rises in the field; 09:00 and 11:00 images: full sun on the track, sharp shadows), cut by the end of the range. At sunrise the housing temperature rises at once and the camera moves at once: the pan drops clearly, the tilt rises (the camera noses down) and the scale rises; the corr_y of many targets sinks from sunrise. Later, the tilt drops all at once at 11:05, the pan drops all at once at 11:15, then the rotation rises gradually; the scale stays roughly stable. All the targets and the references move together in the image. The corr_y of many targets returns toward its night level from 11:00, in a step then slowly (1020, 1019, 1018, 1016, 1008, 1024, 1023, 1021): the compensation leaves a remainder of these camera movements. Cause deduced: the pose follows the housing temperature, as on every sunny day at this station, and the curves return with it in the afternoon. Normal, nothing to do. The sun in the field and the trembling image of the morning, the 11:00 train, the reference 8012 that lights up at 11:15 and the image that trembles at 11:20 are labeled separately."}, } ADDED = [ {"start": "2026-10-23T23:55Z", "end": "2026-10-24T12:35Z", "family": "Visibility", "description": "Continuation of the reduced visibility of the evening before (labeled until the start of the range): the error_value of most targets stays high and the light returned by the targets (their flux) stays low over a large part of the scene, unevenly: the odd-numbered 1009, 1017, 1013, 1015 and the neighbours 1012, 1010, 1011 almost extinguished, the references and the large nearby spots 1019 to 1024 less affected; the large nearby spots 1019 to 1024 jump between two positions and the corrected curves are noisy and jump; 1011, 1013 and 1015 keep a corr_x shift as long as their flux stays low. After a lull in the middle of the night, where only 1012 and 1015 stay weak, the light drops again from the end of the night over almost all the nearby targets, the jumps of 1020, 1021, 1022 and 1023 grow, and 1008 is rejected most of the morning; in mid-morning the odd-numbered targets go out almost completely again for a few measurements, then the light comes back progressively and the shifted curves return in the late morning. 04:00 image: night, nothing in front of the lens; 09:00 and 10:01 images: overcast sky, nothing in front of the targets. Light rain measured by MeteoSwiss at Pully during the night. Reduced visibility over the whole scene, cause not established (rain or water on the lens or prisms possible): this is not a movement, do not trust the curves of the range. The passage of 09:00 and the reference 8014 rejected at 05:50 are labeled separately."}, {"start": "2026-10-24T05:45Z", "end": "2026-10-24T05:55Z", "family": "Obstruction", "description": "For the duration of a single measurement, during the reduced visibility of the night, the flux of the distant reference 8014 falls to almost nothing while the other references keep their light: 8014 is rejected, the basis of the compensation changes and the corr of the distant targets 102H, 201B and 101B jump a little, then everything returns at the next measurement. No image at that moment (images on the hour). A brief occultation of the reference, deduced from its cut light, the object not seen (an insect or a bird is possible). Point to ignore, nothing to do."}, {"start": "2026-10-24T08:55Z", "end": "2026-10-24T09:05Z", "family": "Obstruction", "description": "At the measurements of 09:00 and 09:01, in the middle of the reduced visibility: at 09:00 the flux of 1012, 1022, 1024, 1020, 1014, 1018, 1016, 7013B, 7013H and of the references 8019, 92H and 8002 falls clearly, 1012 is rejected and 1020, 1022 and 1024 stay under their threshold with a false point; at 09:01 it is 8010 that goes out and is rejected, 8003 drops; the basis changes with the hidden references and the corr_x of 1022, 1020 and 1019, the corr_y of 1023 make a large jump, then everything returns at 09:05 to the agitation of the reduced visibility. The 09:00 image shows nothing in front of the targets: the passage is not seen. The signature of the passages of the group of even-numbered targets, deduced. Points to ignore, nothing to do."}, {"start": "2026-10-24T09:20Z", "end": "2026-10-24T22:15Z", "family": "Thermal displacement", "description": "Weak thermal cycle of the day, under an overcast sky (10:01 image): the housing temperature rises a little from the morning to the afternoon, then stays there until the evening; the camera rotates slowly in pan until mid-afternoon, its scale rises until late afternoon, the tilt moves a little in late morning; then the pan and the scale return to their night level in the late evening. The compensation absorbs most of it: the corr_y of 1007 and 1005 go down a little in the afternoon and evening, the other targets barely move apart from the reduced visibility of the morning (separate label). Cause deduced: the pose follows the housing temperature. Normal, nothing to do."}, {"start": "2026-10-24T13:00Z", "end": "2026-10-24T13:15Z", "family": "Obstruction", "description": "In the early afternoon, the flux of 1006 and 1016 drops clearly for one measurement, the other targets keep their light: the corr_y of 1006 makes a clear jump, those of 1014 and 1002 and the corr_x of 1016 smaller ones, then everything returns; 1014 stays a little shifted at the next measurement. No image at that moment (images on the hour). Partial occultation of these targets deduced from their light, cause not seen. Points to ignore, nothing to do."}, {"start": "2026-10-24T20:55Z", "end": "2026-10-24T21:05Z", "family": "Obstruction", "description": "For the duration of a single measurement, at night, the flux of all the even-numbered targets from 1002 to 1022, of 7013B, 7013H, 8010 and of the references 8002, 8004, 8019 and 92H falls to almost nothing, that of 8003 and 1024 drops strongly, while the odd-numbered targets keep their light: it is this group that is hidden; their measurements rise almost to 1 and are rejected, 8003 included, their points are missing; 1020 and 1024, also hidden, stay under their threshold: their point at that moment is false; the basis changes with the four hidden references and the targets that stayed accepted make a clear common jump (1023, 1009, 1019, 1015 above all), then everything returns at the next measurement. The 21:01 image, a minute later, shows nothing in front of the targets. Something passing in front of this part of the scene (railway, neighboring work site) is the most probable, not seen. Point to ignore, nothing to do."}, {"start": "2026-10-24T21:15Z", "end": "2026-10-25T03:35Z", "family": "Visibility", "description": "In the evening, the corr_x of 1002 and 1004 drifts slowly while their light fades; the odd-numbered 1013, 1005 and 1009 jump at the start of the evening; from late evening the flux of 1004, 1002, 1010, 1012, 1006 and 1008 drops strongly, then, before midnight, that of almost all the nearby targets: 1008 is rejected for half an hour around midnight; the corr_x of 1010, 1012, 1013, 1011, 1005 and 1019 shift together, those of 1020, 1022 and 1015 the other way, while the references keep their light and all stay retained. The light comes back progressively in the second half of the night, 1005 the last, and the curves return to their level before dawn. 21:01 image: night, nothing in front of the lens. Light rain measured by MeteoSwiss at Pully in the evening and the night. Reduced visibility of the nearby part of the scene, cause not established (rain or water on the lens or prisms possible): this is not a movement, do not trust the curves of the range."}, {"start": "2026-10-25T02:20Z", "end": "2026-10-25T18:30Z", "family": "Thermal displacement", "description": "Thermal cycle of the day, under an overcast sky (10:01 and 13:00 images): the housing temperature starts rising before dawn and rises clearly until early afternoon, then drops in the evening; the camera follows it: the pan and the scale leave their night level from the second half of the night, the pan drops clearly until midday and stays low until late afternoon, the scale rises until mid-afternoon, the tilt dips in the early afternoon; then the pan and the scale return in the evening. In the morning the reference 8004 is lost for an hour in the reduced visibility (separate label) and the rotation of the camera dips with it: this is the change of basis, not the temperature. The corrected curves of the day are dominated by the reduced visibility; the cycle stops in the evening when the reference 8014 starts drifting in the loss of visibility of the night (separate label). Cause deduced: the pose follows the housing temperature. Normal, nothing to do."}, {"start": "2026-10-25T05:05Z", "end": "2026-10-25T05:15Z", "family": "Displacement", "description": "At night, for the duration of a single measurement, the corr_x of the nearby target 1022 makes a clear jump alone, then returns at the next measurement; its light and its error_value do not change, the references and the other targets stay calm, the camera does not move. No image at that moment. Cause not established. The tracks do not move: point to ignore."}, {"start": "2026-10-25T05:55Z", "end": "2026-10-25T06:30Z", "family": "Visibility", "description": "At the end of the night, for half an hour, the flux of 1006 drops strongly, that of 1002, 1008 and 1018 clearly, without going out, the other targets keep their light: the corr_y of 1023, 1008 and 1006, the corr_x of 1008, 1002, 1004 and 1018 jump from one measurement to the next, 1023 almost reaching its threshold, then everything returns as the light of these targets comes back. On the 06:01 thumbnails, the spots of 1018 and of the neighbours of 1006 are smaller and fainter than at 05:01, nothing in front of them. Part of the nearby scene loses its light at the end of the night, cause not established. This is not a movement: do not trust these curves over the range."}, {"start": "2026-10-25T07:55Z", "end": "2026-10-25T17:40Z", "family": "Visibility", "description": "On most targets, the error_value rises clearly and the light returned by the targets (their flux) drops strongly over almost the whole scene, unevenly: the odd-numbered 1001 to 1017 almost extinguished, 1008, 1010, 1012 and the references 8002, 8004 and 8011 very weak, the large nearby spots 1019 to 1024 less affected; the reference 8004 is rejected for an hour in mid-morning and again a few times around midday, the basis changes and the camera rotation dips with it; 1008 is rejected all morning, 8003 several times, 1001, 1012 and 8010 a few times. The corr_x of 1020, 1021, 1022 and 1024 shift strongly the other way from those of 1010, 1011, 1012, 1013 and 1019, the nearby spots jump between two positions, the curves are noisy until the late afternoon, then return as the light comes back, 1013 and 1009 the last. 10:01 and 13:00 images: overcast and hazy sky, nothing in front of the targets. Rain measured by MeteoSwiss at Pully from mid-morning to early afternoon, very humid air. Reduced visibility over the whole scene, cause not established (rain or water on the lens or prisms probable): this is not a movement, do not trust the curves of the range."}, {"start": "2026-10-26T09:50Z", "end": "2026-10-26T10:00Z", "family": "Obstruction", "description": "For the duration of a single measurement, in the morning, the flux of the reference 92H falls to nothing, the other sensors keep their light: 92H is rejected, the basis changes and most targets make a small common jump in corr_x (7013H, 1020, 1016, 1023, 1014, 1018), then everything returns at the next measurement. No image at that moment; the 10:01 image shows nothing in front of the scene. A brief occultation of the reference, deduced from its cut light, as on other days with the work-site machine, not seen this time. Point to ignore, nothing to do."}, {"start": "2026-10-26T13:00Z", "end": "2026-10-26T13:15Z", "family": "Obstruction", "description": "In the early afternoon, for one measurement, the flux of 1012 and 1016 drops strongly, that of 1024, 1008 and 1022 less, the other targets keep their light: these targets are partly hidden; none is rejected, and the corr_x of 1022 and 1020 make a large jump, those of 1012, 1016, 1019 and 1021 clear ones, then everything returns at the next measurement but one. The 13:01 thumbnails show nothing in front of these targets, a few minutes before. Cause not seen. Points to ignore, nothing to do."}, {"start": "2026-10-26T14:01Z", "end": "2026-10-26T14:15Z", "family": "Obstruction", "description": "In the afternoon, for one measurement, the flux of 1017 drops clearly, that of 1015, 1023 and 1019 less, the other targets keep their light: these targets are partly hidden; none is rejected, and the corr_x of 1019 makes a large jump, those of 1015, 1007 and 1011 and the corr_y of 1017 clear ones; 1019 and 1017 return only at the next measurement but one. The 14:00 image shows nothing in front of these targets, a few minutes before. Cause not seen. Points to ignore, nothing to do."}, {"start": "2026-10-28T15:00Z", "end": "2026-10-28T15:15Z", "family": "Displacement", "description": "In the afternoon, for two measurements, the distant reference 8012 is measured shifted alone in the image, its light a little weaker, its error_value not rising; all the references stay retained: the basis changes and the corr_x of the targets shift a little according to their place in the image (1017, 1018, 1009, 102H, 201B one way, 1022 the other), then everything returns. No image at that moment. Cause not established. It is not a movement of the structure: points to ignore."}, {"start": "2026-10-29T06:01Z", "end": "2026-10-29T06:10Z", "family": "Displacement", "description": "Before dawn, for the duration of a single measurement, the distant reference 8012 is measured shifted alone in the image, its light and its error_value a little up; all the references stay retained: the basis changes and the corr_x of several targets jump a little (1017 one way, 1001, 1003 and 8003 the other), then everything returns at the next measurement. No image at that moment. Cause not established. It is not a movement of the structure: point to ignore."}, {"start": "2026-10-29T06:55Z", "end": "2026-10-29T07:20Z", "family": "Visibility", "description": "At daybreak, for a few measurements, the flux of 1011 drops strongly, that of 1005, 1009 and 1001 clearly, without going out, the other targets keep their light: the corr_x of 1011 and 1009, the corr_y of 1011, 1001, 1005 and 1009 jump from one measurement to the next, then everything returns. The 07:01 thumbnails show nothing in front of these targets. A few nearby targets lose part of their light at the change from night to day, cause not established. This is not a movement: do not trust these curves over the range."}, {"start": "2026-10-29T11:20Z", "end": "2026-10-29T11:35Z", "family": "Displacement", "description": "Around midday, for two measurements, the distant reference 8012 is measured shifted alone in the image, its light and its error_value a little up; all the references stay retained: the basis changes and most targets jump a little together, the corr_x of 1001, 1003, 1021 and 8003 one way, 1017 the other, the corr_y of 1006; then everything returns. No image at that moment. Cause not established. It is not a movement of the structure: points to ignore."}, {"start": "2026-10-29T14:30Z", "end": "2026-10-29T14:50Z", "family": "Obstruction", "description": "In the afternoon, for three measurements, the flux of 1022 and 1009 drops a little, the other targets keep their light: the corr_x of 1022 and 1009 and the corr_y of 1020 jump clearly, then return. No image at that moment. Partial occultation probable, cause not seen. Points to ignore, nothing to do."}, {"start": "2026-10-30T20:00Z", "end": "2026-10-30T20:10Z", "family": "Obstruction", "description": "At night, for the duration of a single measurement, the flux of 1021 and 1019 drops clearly, the other targets keep their light: these targets are partly hidden; none is rejected, and the corr_x of 1019 and 1021, the corr_y of 1021 make a large jump, then everything returns at the next measurement. No image at that moment; the 20:01 image is a few minutes before. Cause not seen. Point to ignore, nothing to do."}, {"start": "2026-10-31T04:35Z", "end": "2026-10-31T04:50Z", "family": "Obstruction", "description": "At night, for one measurement then a smaller one, the flux of 1006 drops clearly, that of 1022, 1023 and 1018 less, the other targets keep their light: the corr_y of 1022, 1023 and 1018, the corr_x of 1016 and 1006 make a clear jump, then at the next measurement the corr_y of 1014 and 1004, then everything returns. No image at that moment. Partial occultation of these nearby targets, cause not seen. Points to ignore, nothing to do."}, {"start": "2026-10-31T05:05Z", "end": "2026-10-31T05:15Z", "family": "Obstruction", "description": "At night, for the duration of a single measurement, the flux of 1018 and 1020 drops a little, the other targets keep their light: the corr of 1020 and 1002 and the corr_x of 1018 make a clear jump, then everything returns at the next measurement. No image at that moment. Partial occultation probable, cause not seen. Point to ignore, nothing to do."}, {"start": "2026-10-31T06:01Z", "end": "2026-10-31T06:10Z", "family": "Obstruction", "description": "At the end of the night, for the duration of a single measurement, the flux of 1006 drops strongly, the other targets keep their light: 1006 is partly hidden, without rejection; the corr_x of 1004, 1006 and 1002 make a clear jump, then everything returns at the next measurement. The 06:00 thumbnails show nothing in front of 1006, a few minutes before. Cause not seen. Point to ignore, nothing to do."}, {"start": "2026-11-01T05:05Z", "end": "2026-11-01T05:15Z", "family": "Obstruction", "description": "At night, for the duration of a single measurement, the flux of 1006 falls to almost nothing, that of 1018 and 1004 drops, the other targets keep their light: 1006 is hidden, without rejection, and its corr_x makes a large jump, that of 1018 a clear one, then everything returns at the next measurement. The 05:00 thumbnails show nothing in front of 1006, a few minutes before. Cause not seen. Point to ignore, nothing to do."}, {"start": "2026-11-01T06:55Z", "end": "2026-11-01T07:15Z", "family": "Visibility", "description": "At sunrise, the sun enters the field near the far end of the track (seen on the 07:00 image, with a large glare): the distant target 202H, in the middle of the field, loses its light and is rejected at 07:00 and 07:05; between the two, at 07:01, it stays under its threshold with a false point that jumps strongly in corr_x and corr_y; at 07:10 its light comes back halfway and its corr_y still jumps, then it returns. Around it, the corr_y of 1006 and 8010 jump at 07:00 and 07:01. The sun in the field behind the target, seen on the image. This is not a movement: ignore 202H over the range."}, {"start": "2026-11-01T07:15Z", "end": "2026-11-01T11:40Z", "family": "Visibility", "description": "From sunrise until the end of the range, sunny morning: the image of almost all the sensors is less sharp and more ambiguous (a second pattern appears in it, the signal stands out less from the background), while their light rises; the corr_x of the references jump from one measurement to the next in opposite directions, the distant 8012 above all, 8019, 8002, 8013 and 8017 too, the basis changes at each measurement and the corr of the targets follow (1011, 1020, 1001, 1018, 1021 the most). 07:00 and 08:00 images: the sun is in the field, with a large glare, first near the far end of the track then at the top right; 09:00 image: the sun has left the field, full sun on the scene. Sunshine measured by MeteoSwiss at Pully all morning. The sun in the field, then the image that trembles in the sun (turbulence above the sunny track probable), deduced from the image quality and seen on the images. This is not a movement: do not trust the detail of the curves over the range. The 202H lost at sunrise, the 11:00 train, the reference 8012 that lights up at 11:15, the stronger trembling of 11:20 and the thermal cycle are labeled separately."}, ] out = [] for l in open(os.path.join(O, 'work', 'existing.jsonl')): d = json.loads(l) i = d.pop('id') if i in REMOVED: continue out.append(CORRECTED[i] if i in CORRECTED else d) out += ADDED out.sort(key=lambda d: (d['start'], d['end'])) with open(os.path.join(O, 'labels.jsonl'), 'w') as f: for d in out: f.write(json.dumps(d, ensure_ascii=False) + '\n') print(len(out), 'labels;', len(ADDED), 'added;', len(CORRECTED), 'corrected;', len(REMOVED), 'removed')