"""Builds labels.jsonl from work/requalify_input.jsonl: removes, rewrites (dropping review), keeps the rest as is.""" import json, sys D = sys.argv[1] REMOVE = {'NORDEND-154', 'NORDEND-295', 'NORDEND-301'} END_SUN = "The structure does not move: nothing to do; do not trust the curves at those measurements of sunny afternoons." NEW = { 'NORDEND-291': "At night, the spots of a few faint targets shrink on the images, without any obstacle in front and without a veil over the rest of the scene. PR07, in the middle of the group, moves first: its spot is smaller on the 19:15, 20:15 and 21:15 thumbnails than at 18:30, whole again at 22:30; its error_value rises, its corr_x leaves its level at 19:00, makes a strong jump at 19:15, then keeps dipping and coming back, with one measurement rejected at 21:00, and is back at its level in the second half of the evening. At the jump of 19:15, PR16 departs with it on corr_x, clearly, and only comes back three measurements later, PR15 a little for one measurement. Later in the evening CTR01 and PR09, on the left edge of the group, fade the same way (21:15 and 22:30 thumbnails) and are rejected for a while, without moving the other curves. Cause not established (a poorer view at night of these faint spots, as on other October nights). This is not a movement: do not trust the points of PR07 and PR16 over the range.", 'NORDEND-292': "Before dawn, PR07, a faint target in the middle of the group, jumps strongly on corr_x for one measurement, and PR16 dips clearly on corr_y at the same measurement; PR07 is then rejected for one measurement, again at daybreak, and comes back with another strong jump on corr_x. Meanwhile PR09 and CTR01, on the left edge of the group, are rejected at times, then almost continuously until the morning, their error_value high all the while; PR09 departs a little on corr_x between its rejections. On the images the spots of these faint targets fade (PR07 almost gone at 03:30, PR09 and CTR01 very faint at 07:30), without a visible obstacle or a veil over the rest of the scene. The common jump of the targets of the right part of the group at daybreak is labelled apart. Cause not established (a poorer view at night of these faint spots, moisture or mist possible). This is not a movement: do not trust the points of PR07 and PR16 at those measurements.", 'NORDEND-296': "In mid-afternoon, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), as bright as their spots, which drown in it (15:30 thumbnail). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises clearly): the compensation shifts and the targets depart together at some measurements, clearly at the end of the episode (PR13, PR10 and PR15 on corr_x, PR12 on corr_y); the corr_y of PR02, next to CTR01, dips and that of PR01 rises during the hour. CTR01 itself is rejected for an hour. " + END_SUN, 'NORDEND-297': "In mid-afternoon, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), as bright as their spots, which drown in it (15:15 thumbnail). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises clearly): the compensation shifts and the targets depart together at some measurements, clearly in the second half of the episode on corr_x (PR01, PR10, PR14 and PR18 above all); the corr_y of PR02, next to CTR01, dips and that of PR01 rises for a measurement or two. CTR01 itself is rejected for an hour. " + END_SUN, 'NORDEND-298': "In mid-afternoon, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), as bright as their spots, which drown in it (15:15 and 15:30 thumbnails; at 13:30 and at 17:00, the rock is in shadow and the spots sharp). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises clearly): the compensation shifts and the targets depart together a little on corr_y at some measurements, clearly for a few (PR05 rises, PR18 and PR11 dip); at the end the corr_y of PR02, next to CTR01, dips and that of PR01 rises, and PR16 and PR09 depart a little on corr_x for one measurement. CTR01 itself is rejected for an hour. " + END_SUN, 'NORDEND-299': "In mid-afternoon, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), as bright as their spots, which drown in it (14:15 and 15:15 thumbnails). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises clearly from the start of the afternoon): the camera pose jumps in tilt and the targets jump together, clearly at a few measurements (PR02, PR09 on corr_y, PR13, PR12 and PR08 on corr_x above all), back at the next one; the corr_y of PR02 dips in the second half of the episode. CTR01 itself is rejected for a few measurements. " + END_SUN, 'NORDEND-304': "In mid-afternoon, between clouds, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), their spots drowning in it (14:45 and 15:30 thumbnails; at 15:00, in shadow). CTR02 and CTR03 stay under their threshold but are seen less well: the camera pose jumps in tilt and the targets jump together a little on corr_y at those measurements. At the same time all the spots of the group are smaller than before and after (15:15 to 15:45 thumbnails): PR16 jumps strongly on corr_x and comes back gradually, PR15 jumps strongly on corr_y and clearly on corr_x for one measurement, the corr_y of PR08 rises clearly and that of PR18 dips clearly. CTR01 is rejected for a few measurements and PR07 for one. " + END_SUN, 'NORDEND-306': "In mid-afternoon, between clouds, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), their spots drowning in it (15:00 and 15:30 thumbnails; at 15:15, in shadow). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises): at each of these two measurements, the camera pose jumps in tilt and almost all the targets jump together on corr_y, clearly (PR01, PR02, PR07, PR14 above all), then come back at the next one. CTR01 itself is rejected for one measurement. " + END_SUN, 'NORDEND-308': "In the afternoon, the sun lights the rock behind the references CTR02 and CTR03 and behind CTR01 (local reference, treated as a target), as bright as their spots, which drown in it (15:30 and 16:00 thumbnails). CTR02 and CTR03 stay under their threshold but are seen less well (the error_value of CTR03 rises): the targets jump together a little on corr_y at some measurements, PR01 clearly on both corr_x and corr_y in the second half of the episode, and all of them clearly at the last one, when the camera pose jumps in tilt (PR01, PR02, PR10, PR11 drop), back at the next measurement. CTR01 itself is rejected for a few measurements. " + END_SUN, } out = [] for line in open(D + '/work/requalify_input.jsonl'): lab = json.loads(line); i = lab.pop('id') if i in REMOVE: continue if i in NEW: lab['description'] = NEW[i]; lab.pop('review', None) out.append(lab) with open(D + '/labels.jsonl', 'w') as f: for lab in out: f.write(json.dumps(lab, ensure_ascii=False) + '\n') print(len(out), 'labels')