Files
aimsight-labeling/auto/analyses/LENZSPITZE_2026-10-16T0235_2026-10-23T2355/scripts/build.py
T

50 lines
12 KiB
Python

"""Build labels.jsonl: existing labels kept as they are (id dropped), corrected ones rewritten (review dropped), added ones."""
import json
A = 'labeling/auto/analyses/LENZSPITZE_2026-10-16T0235_2026-10-23T2355'
old = {d['id']: d for d in map(json.loads, open(A + '/work/existing.jsonl'))}
C = {} # id -> (start, end, description); family unchanged
C['LENZSPITZE-5'] = ('2026-10-16T07:30Z', '2026-10-16T08:00Z', "For the duration of a single measurement, the flux of 8003 and 8010, two targets of the group affected by passages, falls to almost nothing, the other targets keep their light: they are hidden; their measurements rise almost to 1 and are rejected, their points are missing. At the same measurement, the corr_x of 1008 rises and the corr_y of 1010 sinks clearly, and the two stay shifted for four measurements after 8003 and 8010 have come back, then return in two steps, halfway at the fifth measurement and back at the sixth. No image at that moment; something passing in front of these targets, then staying near 1008 and 1010 for a few minutes, probable, not seen. Points to ignore, nothing to do.")
C['LENZSPITZE-8'] = ('2026-10-16T22:25Z', '2026-10-17T05:05Z', None)
C['LENZSPITZE-11'] = ('2026-10-17T09:00Z', '2026-10-17T09:45Z', "For the duration of a single measurement, the flux of 8003 and 8010, two targets of the group affected by passages, falls to almost nothing, the other targets keep their light: they are hidden; their measurements rise almost to 1 and are rejected, their points are missing; they return at the next measurement. At the same measurement, 1022 jumps strongly in corr_x and corr_y and stays shifted for about forty minutes, a little less from the middle of the range, without being rejected: its light stays a little lower and its image changes (the second pattern in its window weakens), as if something partly covered its spot; it returns all at once, with its light and its image of before. The image of the minute before shows nothing in front of the targets; passage probable, then a partial cover of 1022, not seen. Points to ignore, those of 1022 included, nothing to do.")
C['LENZSPITZE-12'] = ('2026-10-17T10:00Z', '2026-10-17T10:55Z', "For a quarter of an hour, the flux of 1008, 1010, 1012 and of the reference 8014 falls to almost nothing, that of 1014 drops, the other targets keep their light: these targets are hidden; their error_value rises, 1008 is rejected three measurements in a row, its points are missing; the reference 8014 is rejected for one measurement; 1004, 1006, 1010, 1012, 1014 and 1016 jump. Their light then comes back only in part: 1008, 1012 and 1016 return slowly to their level over half an hour, while 1010 and 1014, whose light stays clearly lower than before, stay shifted in corr_x and corr_y into the reduced visibility that follows (separate label). The 10:01 image, just before, shows nothing in front of these targets. Something in front of this part of the track, established by their light being cut, of a nature not seen. This is not a movement: ignore these targets over the range.")
C['LENZSPITZE-15'] = ('2026-10-17T17:30Z', '2026-10-18T01:30Z', None)
C['LENZSPITZE-16'] = ('2026-10-18T08:00Z', '2026-10-19T07:10Z', None)
C['LENZSPITZE-27'] = ('2026-10-21T01:00Z', '2026-10-21T11:35Z', None)
# corrected descriptions where only the bounds moved: the old text, with a sentence fixed where it gave the bound
fix = {
'LENZSPITZE-8': ("Everything returns at daybreak.", "Everything returns at daybreak, 8013 last, still rejected at the measurement of the passage that follows (separate label)."),
'LENZSPITZE-15': ("At night, repeated jumps", "From late afternoon, 1002, 1003, 1004 and 102H already leave their level, before the whole scene jumps; at night, repeated jumps"),
'LENZSPITZE-16': ("and only return on the morning of the 19th, with their light.", "and only return on the morning of the 19th, with their light, 1015 and 1013 in two measurements at daybreak."),
'LENZSPITZE-27': ("From the end of the night to late morning, the strongest episode of the week:", "From the middle of the night, with the light of 101B, 102H, 1004 and 1009 dropping, 201B, 101B, 102H, 7013H and the references 8014, 8017 and 8019 leave their level, and the scene goes on darkening; from the end of the night to late morning, the strongest episode of the week:"),
}
for i, (a, b) in fix.items():
d = old[i]['description']; assert a in d, i
C[i] = (C[i][0], C[i][1], d.replace(a, b, 1))
C['LENZSPITZE-27'] = (C['LENZSPITZE-27'][0], C['LENZSPITZE-27'][1], C['LENZSPITZE-27'][2].replace("1013 and 1015 shifted; the housing", "1013 and 1015 shifted, 1013 the last to come back, just before noon; the housing"))
assert "1013 the last" in C['LENZSPITZE-27'][2]
ADD = [
('2026-10-18T05:05Z', '2026-10-18T06:35Z', 'Visibility', "At the end of the night, before daybreak: the distant targets 101B, 102H, 201B, 202H and 7013H, with the distant references 8014 and 8017, leave their level together in corr_x and corr_y, 101B and 102H the most; the light of the distant targets and references drops a little for half an hour, that of the nearby targets stays whole, nothing is rejected; 101B and 201B are the last to come back, at daybreak. The 05:01 and 06:01 images show nothing in front of the lens; the 06:01 image is the first lit by the dawn. Light missing on the distant part of the scene, as on the misty nights before, night mist or dampness probable, not established. This is not a movement: do not trust the curves of these targets over the range."),
('2026-10-19T05:45Z', '2026-10-19T05:55Z', 'Obstruction', "For the duration of a single measurement, during the reduced visibility, the flux of the distant reference 8014 alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it, the targets hardly move; it returns at the next measurement. No image at that moment; something passing in front of this reference probable, not seen. Point to ignore, nothing to do."),
('2026-10-19T07:35Z', '2026-10-19T07:45Z', 'Obstruction', "For the duration of a single measurement, at the start of the morning turbulence, the flux of the distant reference 8014 alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it, the targets move only with the turbulence; it returns at the next measurement. No image at that moment; something passing in front of this reference probable, not seen. Point to ignore, nothing to do."),
('2026-10-19T12:55Z', '2026-10-19T13:05Z', 'Obstruction', "For the duration of a single measurement, the flux of the reference 92H alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it, the targets do not jump; it returns at the next measurement. No image at that moment; the 12:01 and 14:00 images show nothing in front of it. Something passing in front of this reference probable, not seen. Point to ignore, nothing to do."),
('2026-10-19T13:45Z', '2026-10-19T13:55Z', 'Obstruction', "For the duration of a single measurement, the flux of the distant reference 8014 alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it, the targets do not jump; it returns at the next measurement. No image at that moment; the 14:00 image shows nothing in front of it. Something passing in front of this reference probable, not seen. Point to ignore, nothing to do."),
('2026-10-20T05:00Z', '2026-10-20T06:25Z', 'Visibility', "At night, before daybreak: the light of 1015 falls to a small part of its usual value, that of 1013, 1021, 1023 and 1007 drops, the other targets and the references keep theirs; nothing is rejected. At once, the corr_x and corr_y of 1015, 1013, 1021, 1023, 1011 and 1007 jump and wander while the light comes back progressively over half an hour; then 1013 stays shifted in corr_x until the short measurement gap and is back at the first measurement after it. The 05:01 image, just before, and the 06:00 image show nothing in front of these targets; the camera does not move. Part of the scene, the targets in the middle of the group, loses its light for a while without a visible obstacle; cause not established (condensation, an insect or dampness near the lens possible). This is not a movement: do not trust these curves over the range."),
('2026-10-20T11:10Z', '2026-10-20T11:20Z', 'Displacement', "For the duration of a single measurement, during the thermal cycle of the day: the rotation of the camera jumps and its registration error rises, then both come back at the next measurement; the compensation leaves a remainder and many targets jump together, 7013H, 7013B, 1013 and 1019 in corr_x and 1020 in corr_y the most, then return. Their light stays whole and nothing is rejected: the image is not degraded, it is the camera that turns for a moment. Cause of this jolt not established. It is not a movement of the structure: point to ignore; the camera is to be monitored if it repeats."),
('2026-10-20T13:25Z', '2026-10-20T13:50Z', 'Obstruction', "For four measurements, the flux of the reference 92H alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it: the basis changes and almost all the targets shift together in corr_x, 102H also in corr_y, then everything returns when 92H comes back. No image during the range; the 13:01 and 14:01 images show nothing in front of it. Something staying in front of this reference for about twenty minutes (work site, passage) probable, not seen. This is not a movement: ignore the curves over the range."),
('2026-10-20T15:00Z', '2026-10-20T15:20Z', 'Obstruction', "For the duration of a single measurement, the light of 1013, 1015, 1019 and 1009 drops to about half, the other targets keep theirs: these targets are partly hidden; they jump in corr_x and corr_y, 1013, 1015 and 1019 strongly, without being rejected, so their points at that moment are false; 1019, whose image stays changed, stays shifted for two more measurements, then everything returns. The 15:01 image, just before, shows nothing in front of the targets. Something passing partly in front of these targets probable, not seen. Points to ignore, nothing to do."),
('2026-10-21T11:35Z', '2026-10-21T11:45Z', 'Obstruction', "For the duration of a single measurement, just after the reduced visibility of the morning, the flux of the reference 92H alone falls to nothing, the other sensors keep their light: it is hidden; it is rejected and the compensation runs without it, the targets hardly move; it returns at the next measurement. No image at that moment; the 11:01 and 12:01 images show nothing in front of it. Something passing in front of this reference probable, not seen. Point to ignore, nothing to do."),
('2026-10-23T13:30Z', '2026-10-23T13:45Z', 'Obstruction', "For the duration of a single measurement, between two episodes of reduced visibility, the light of 1008, 1012, 1022, 1010 and 1024, in the group affected by passages, drops a little, the other targets keep theirs: they are partly hidden; 1022 jumps strongly in corr_x and corr_y and keeps a little of it at the next measurement, 1008, 1012, 1014 and 1024 jump a little, nothing is rejected, so these points are false; then everything returns. No image at that moment. Something passing partly in front of this part of the scene (railway, neighbouring work site) probable, not seen. Points to ignore, nothing to do."),
]
out = []
for i, d in old.items():
if i in C:
s, e, desc = C[i]
out.append({'start': s, 'end': e, 'family': d['family'], 'description': desc or d['description']})
else:
out.append({k: v for k, v in d.items() if k != 'id'})
out += [{'start': s, 'end': e, 'family': f, 'description': t} for s, e, f, t in ADD]
out.sort(key=lambda d: (d['start'], d['end']))
with open(A + '/labels.jsonl', 'w') as f:
for d in out: f.write(json.dumps(d, ensure_ascii=False) + '\n')
print(len(out), 'labels;', len(old) - len(C), 'kept,', len(C), 'corrected, 0 removed,', len(ADD), 'added')