auto: labels requalified under the 5-noise rules (only what stands out from the noise): 32 analyses refined, the 6 paused periods verified, the long labels requalified with the fixes the period analysts found; 1153 -> 961 labels

- 32 analyses: each label kept, rewritten or removed by its analyst (section Requalification of the report; mm magnitudes where the targets have them)
- SNCF01 x3, WILDSTRUBEL 2026-09-01 -> 2026-10-06 x3: verified from their existing labels under the new rules
- long labels (no analysis): auto/analyses/long-labels/<STATION>/; NORDEND-169 and -195 run to 07/11, so NORDEND-283 and -284 (their continuation) are removed
- reading-rules.md, stations.md: the citations of removed or rewritten labels point to their successor, or to [expert]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 23:58:00 +01:00
1 parent c779de7720
commit ddb17c2189
321 files changed
+18464 -3426

No files matched your search

@@ -1,12 +1,12 @@
# Labels: JUNGFRAU, 2026-10-21T10:30Z → 2026-11-01T00:00Z (UTC)
Request: verify the 34 existing labels of the range (`work/existing.jsonl`): keep, correct, remove, add. DETECTORS: no.
Result: 36 labels in `labels.jsonl`: 27 kept, 7 corrected, 0 removed, 2 added. The spanning label JUNGFRAU-2 holds within the range.
Requalification of 2026-11-17 under the new rules (`labeling-rules.md`, section 1: only what stands out from the noise of the corrected curves, at least one target beyond 5 of its own noises): **36 labels, 36 kept as they are, 0 rewritten, 0 removed**. The detail is in "## Requalification" below. DETECTORS: no.
Previous pass (verification of the 34 labels then on the range): 36 labels, 27 kept, 7 corrected, 0 removed, 2 added; the spanning label JUNGFRAU-2 (PM_G rejected throughout) holds within the range. The table and section 1 below are that pass, unchanged. The old ids in the table (67, 69, 70, 75, 77, 78, 81) are now JUNGFRAU-114 to -119 and -122, and the two added labels are -120 and -121.
Weather: MeteoSwiss station Nyon / Changins (CGI), 2.0 km away, height 458 m, hourly (`data/JUNGFRAU/weather/`). Rain on 21/10 (to 10:00, then 13:00-18:00 and 20:00-02:00), 23/10 07:00-12:00 (up to 2.1 mm/h at 09:00), 15:00-16:00, 18:00-20:00, 22:00 → 24/10 01:00, 24/10 03:00-13:00 (light, 0.2-1 mm/h), 24/10 22:00 → 25/10 17:00 (up to 2.4 mm/h); dry from 25/10 18:00 to the end of the range. Sun (60 min/h) on 22/10 and 27/10 from 09:00 to 15:00, 29/10 15:00, 31/10 15:00. Nights of 26, 27 and 28/10: dry, humidity 85-95 %, wind below 10 km/h.
The station: a bridge, camera under the deck fixed to it, three references off the bridge in the open (REF_G on a tripod on the left slope, REF_D at the right fence, REF_CT at the abutment wall: located from their `x`, `y` on the 22/10 10:00 image). No image quality metrics (export columns peak to snr empty). Images every 15 min until 25/10 00:00, then hourly.
The station: a bridge, camera under the deck fixed to it, three references off the bridge in the open (REF_G on a tripod on the left slope, REF_D at the right fence, REF_CT at the abutment wall: located from their `x`, `y` on the 22/10 10:00 image). Target distances (`inventory.py`): PBJ_C 3.1 m (0.61 mm/px), BJ_C/BJ_D/BJ_G 8.1-8.6 m (1.6 mm/px), PM_C/PM_D 21.4-21.7 m (4.3 mm/px), BL_C/BL_D/BL_G 34.1-34.4 m (6.8-6.9 mm/px), PBL_C/PBL_D 39.1-39.3 m (7.8 mm/px). No image quality metrics (export columns peak to snr empty). Images every 15 min until 25/10 00:00, then hourly.
## Verdict per old id
| id | verdict | evidence |
@@ -133,6 +133,58 @@ Only the corrected and the added labels are detailed; the kept ones are justifie
- Rain hours without disturbance: 23/10 15:00-16:00 and 18:00-20:00 (0.3-0.7 mm/h): REF_G at its level, no common jump. Rain does not always disturb REF_G, hence "likely" and not "seen".
- From 28/10 the pose, sigma0 and the references are calmer than before (sigma0 of the pose about 0.0042 → 0.0035): dry weather, no step in the corrections, not a change of configuration.
### Requalification: labels removed
None. Every label of the range has at least one target beyond 5 of its own noises over its range (table in "## Requalification"); none rests only on missing points (the three reference losses 82, 86, 91 make all the targets jump by 20 to 50 noises); the two No data labels have no row for any sensor (26/10 14:30 and 14:45, 27/10 09:00, raw CSV). The labels closest to the threshold, kept: JUNGFRAU-89 (BL_G corr_x -6.8 noises at 15:15-15:30 with a rolling level of ±2 measurements, -5.8 at ±4; the other targets it names stay at 3 to 5 noises; about 0.3 mm), JUNGFRAU-116 (6.0 noises with a rolling level, 11.3 against the fixed level), JUNGFRAU-118 (6.1 with a rolling level, 9.3 against the fixed level), JUNGFRAU-72 (BL_G corr_x -9 to -10 noises at 15:30, PBL_C -5 to -7, BJ_G -6).
## Requalification
Method: one `ranges.py --k 5` per label, targets only (references excluded; PM_G is always rejected). Scripts in `scripts/requalify.py`, `scripts/requalify_vis.py` and `scripts/requalify_vis_mm.py`; outputs in `work/rq/`.
- Thermal labels: `ranges.py data/JUNGFRAU --columns corr_x,corr_y --k 5 --start <label start> --end <label end>` (level = median of the label's window). Against the night level, `days.py --columns corr_x,corr_y --night 0-4 --bounds --smoothing 5 --sensors <target>` one target at a time (`work/rq/days/`), for the weak days whose median of the targets stays under 5 noises (21/10, 30/10).
- Visibility labels (movements): `ranges.py --columns corr_x,corr_y --k 5 --start <start - 12 h> --end <end + 12 h> --outside <start>/<end> --rolling 4` (noise taken around the label, outside it), keeping only the ranges whose extreme falls inside the label. The ranges limited to the label alone gave a noise skewed by the episode itself (JUNGFRAU-72 came out with no range), so the wide window was used. For 72 and 89, the ±12 h window takes in the agitated reference-loss nights, which inflate the noise (BJ_G 0.047 px against 0.006 on a calm day), so they were rerun on a calm ±6 h window with `--rolling 2` and `--rolling 4` (`work/rq/JUNGFRAU-72_6h_*`, `JUNGFRAU-89_6h_*`).
- No data: raw `displacement/JUNGFRAU_advanced_20261026.csv` and `…20261027.csv`, rows per instant: 15 sensors at every quarter hour except 26/10 14:30, 14:45 and 27/10 09:00 (no row).
| id | bounds | family | largest target deviation (noises) | verdict |
|---|---|---|---|---|
| JUNGFRAU-66 | 21/10 10:30 → 16:30 | Thermal | window: PBJ_C cy +11.2, PM_C cx +11.1; night 21/10: PBL_C cx +12.9 at 11:30, BL_C cy +9.6 | kept |
| JUNGFRAU-114 | 21/10 12:45 → 14:45 | Visibility | BL_D cx +9.7, PM_C cx +8.9, BJ_C cx +8.6 (rolling) | kept |
| JUNGFRAU-68 | 21/10 16:30 → 22/10 07:30 | Thermal | PM_D cy +20.1, PBJ_C cy -16.5 | kept |
| JUNGFRAU-115 | 21/10 16:45 → 19:45 | Visibility | BL_G cx +9.3, PM_C cy -8.4 (rolling) | kept |
| JUNGFRAU-116 | 22/10 00:15 → 02:45 | Visibility | rolling: PM_C cy +6.0; fixed level: PBL_C cy -11.3, PBJ_C cx +10.5 | kept |
| JUNGFRAU-71 | 22/10 07:30 → 17:30 | Thermal | PM_D cy +27.5, BJ_G cy -25.0 | kept |
| JUNGFRAU-72 | 22/10 15:15 → 15:45 | Visibility | BL_G cx -10 (±2), -9 (±4); PBL_C cx -7; BJ_G cx -6 | kept |
| JUNGFRAU-73 | 22/10 17:30 → 23/10 07:00 | Thermal | PBJ_C cy -35.1, PM_D cy -32.7 | kept |
| JUNGFRAU-74 | 23/10 07:00 → 16:00 | Thermal | PBJ_C cy +14.8, BL_D cy +13.5 | kept |
| JUNGFRAU-117 | 23/10 07:15 → 12:15 | Visibility | rolling: BL_C cy -12.8, BL_G cx +11.8; fixed: BJ_G cx -23.4, BJ_D cx +21.2 | kept |
| JUNGFRAU-76 | 23/10 16:00 → 24/10 06:30 | Thermal | PM_D cy -25.8, PBJ_C cy -16.9 | kept |
| JUNGFRAU-118 | 23/10 21:45 → 23:45 | Visibility | rolling: BJ_C cx +6.1; fixed: BL_C cx +9.3, BL_G cx +8.6 | kept |
| JUNGFRAU-119 | 24/10 03:00 → 12:45 | Visibility | rolling: PM_C cy -11.7, PM_C cx +11.3, BL_C cx +10.2 | kept |
| JUNGFRAU-120 | 24/10 06:30 → 17:00 | Thermal | PBJ_C cy +19.7; median of the targets -14.5 against the night | kept |
| JUNGFRAU-121 | 24/10 17:00 → 25/10 00:15 | Thermal | PM_C cx +13.6, PBL_C cy +12.5 | kept |
| JUNGFRAU-79 | 24/10 21:00 → 25/10 17:15 | Visibility | rolling: PM_D cy -43.7, PM_C cx +22.5; fixed: BJ_C cy -39.4 | kept |
| JUNGFRAU-80 | 25/10 07:30 → 16:45 | Thermal | BJ_D cy -11.6 (11 measurements), PM_D cx +12.6 | kept |
| JUNGFRAU-122 | 25/10 16:45 → 26/10 10:00 | Thermal | PM_D cy -46.4, PBJ_C cx -39.5 | kept |
| JUNGFRAU-82 | 26/10 00:00 → 07:30 | Visibility | fixed: PM_C cx -47.9, BL_G cy +42.5; rolling: BL_G cx +31.0 | kept |
| JUNGFRAU-83 | 26/10 10:00 → 19:00 | Thermal | BJ_G cx -30.6, PM_D cy +30.1 | kept |
| JUNGFRAU-84 | 26/10 14:15 → 15:00 | No data | no row for any sensor at 14:30 and 14:45 | kept |
| JUNGFRAU-85 | 26/10 19:00 → 27/10 08:00 | Thermal | BL_D cy +41.3 (24 measurements); the larger peaks are the reference loss (86) | kept |
| JUNGFRAU-86 | 26/10 23:00 → 27/10 08:00 | Visibility | rolling: BJ_G cy +48.4, BL_G cy +48.1, PBJ_C cx -38.8 | kept |
| JUNGFRAU-87 | 27/10 08:00 → 16:30 | Thermal | PBL_C cx -31.1, BJ_G cx -27.1 | kept |
| JUNGFRAU-88 | 27/10 08:45 → 09:15 | No data | no row for any sensor at 09:00 | kept |
| JUNGFRAU-89 | 27/10 15:00 → 15:45 | Visibility | BL_G cx -6.8 (±2), -5.8 (±4) | kept |
| JUNGFRAU-90 | 27/10 16:30 → 28/10 08:00 | Thermal | PBJ_C cy +36.9 (21 measurements) | kept |
| JUNGFRAU-91 | 28/10 01:30 → 06:15 | Visibility | rolling: BL_G cy -42.1, PBJ_C cx +36.1 | kept |
| JUNGFRAU-92 | 28/10 08:00 → 16:15 | Thermal | BJ_C cy -43.0, BJ_G cx -40.3 | kept |
| JUNGFRAU-93 | 28/10 16:15 → 29/10 07:00 | Thermal | PM_D cy -29.4, PM_C cy +24.1 | kept |
| JUNGFRAU-94 | 29/10 07:00 → 16:00 | Thermal | PM_C cy +26.2, PM_D cy -21.5 | kept |
| JUNGFRAU-95 | 29/10 16:00 → 30/10 08:30 | Thermal | PBJ_C cy -42.2, BJ_C cy -34.9 | kept |
| JUNGFRAU-96 | 30/10 08:30 → 16:00 | Thermal | window: PBJ_C cy +16.8; night 30/10: PM_C cy -7.7, PBJ_C cy -7.5, PBL_D cx +6.5 (median of the targets -2.5 only) | kept |
| JUNGFRAU-97 | 30/10 16:00 → 31/10 08:00 | Thermal | window: PBJ_C cy -25.6; night: PBJ_C cy +8.5, PM_C cy +7.4, BL_D cy +7.0 | kept |
| JUNGFRAU-98 | 31/10 08:00 → 17:00 | Thermal | BJ_C cx +38.0, PM_D cy -28.1 | kept |
| JUNGFRAU-99 | 31/10 17:00 → 01/11 00:00 | Thermal | PM_D cy -20.9, PBJ_C cy -20.5 | kept |
The descriptions do not rest on what is no longer labelled: where they mention a rejection (PM_C in 117 and 79, REF_G in 82, 86, 91), it is the cause or a side fact of a movement that is beyond the threshold, so none was rewritten. In mm (`corr_x_mm`, `corr_y_mm`): thermal deviations from the day's median about 1 to 1.7 mm on the sunny days (PM_D corr_y -1.7 mm on 22/10, PBL_C corr_x +1.8 mm on 27/10 at 15:00), a few tenths of a mm on 30/10; rain episodes 0.3 to 1 mm (up to 3 mm on 25/10, PM_C); reference losses 2 to 3.5 mm (BL_G, PBL_C).
## 3. The documentation
- `families.md`, "Thermal displacement or Visibility" and the list of phenomena: decisive to keep the opposite movements of BJ_G and BJ_D at night in the thermal labels, and the REF_G episodes in Visibility.
@@ -141,6 +193,7 @@ Only the corrected and the added labels are detailed; the kept ones are justifie
- `reading-rules.md`, section 6 ("references that do not move in the rain do not contradict the rain") is the reverse case here: at JUNGFRAU the references are in the open and the targets under the deck, so rain shows first on the references, REF_G above all. Worth a line in `stations.md`.
- The old labels were written before the weather was read: every Visibility episode of the first week with "cause not established" (67, 69, 70, 75, 77, 78) falls in rain hours at Nyon; the nights of reference losses (82, 86, 91) are dry and calm: their cause stays not established (condensation possible, not seen).
- No quality metrics on this camera: occultation and veil rest on the thumbnails.
- Requalification: `labeling-rules.md`, section 1 (the 5-noise threshold, thermal kept only if the corrected curves keep it, missing points not labelled) was enough. Pitfall: `ranges.py` on the label's own window takes its noise from the episode itself and can hide a short jump (JUNGFRAU-72 came out with nothing); the noise has to be taken around the label (`--outside` on a wider, calm window). The median of the targets (`days.py --bounds`) can stay under 5 noises on a weak day (21/10, 30/10) while single targets are beyond it: the rule is per target.
- `precedents.py --exclude JUNGFRAU <start> <end>` still returns the other JUNGFRAU labels (outside the range): useful here.
## Difficulties
@@ -148,6 +201,8 @@ Only the corrected and the added labels are detailed; the kept ones are justifie
- No tool gives a per-instant table of one column for all sensors together with the pose; I wrote `scripts/q.py` (and `scripts/turn.py` for the smoothed median of the targets with the housing temperature).
## Sources read
- Requalification (2026-11-17): `instructions/analyst.md`, `work/requalify_input.jsonl`, the previous `analysis.md` and `report.md`, `labeling/labeling-rules.md` (sections 1 and 2), `tools/GUIDE.md` (ranges, days); `ranges.py` per label, `days.py --bounds` per target, `inventory.py`, raw displacement CSVs of 26 and 27/10
- Previous pass:
- `agents/agents/analyst.md`, `instructions/analyst.md`, `work/prompt.txt`, `work/existing.jsonl`, `work/spanning.jsonl`
- `tools/GUIDE.md`, `tools/DATA.md`; `labeling/families.md`, `labeling/labeling-rules.md`, `labeling/reading-rules.md`, `labeling/stations.md` (in full)
- `labeling/auto/JUNGFRAU.jsonl` (labels around the range: JUNGFRAU-58 to -99, and -2)
@@ -1,28 +1,28 @@
# JUNGFRAU: check of the labels of 21 to 31 October
# JUNGFRAU: requalification of the labels of 21 to 31 October
You asked to check the 34 labels already written from 21/10 10:30 to 01/11 00:00 (UTC): keep, correct, remove, add.
You asked to requalify the 36 labels of 21/10 10:30 to 01/11 00:00 (UTC) under the new rule: label only what stands out from the noise of the corrected curves.
## In short
The labels hold on the whole: 27 kept, 7 corrected, none removed, 2 added. The corrections: the cause of six episodes is now likely rain (measured by the weather station 2 km away), two have wrong start or end times, and one daily cycle ended an hour early. No real movement of the bridge is seen: what moves is the daily thermal cycle of the bridge, plus the reference REF_G disturbed by rain or lost at night.
All 36 labels stand out from the noise and stay as they were. Nothing is removed and nothing is rewritten. The curves cannot be trusted during the rain episodes and the three nights when references are lost. No real movement of the bridge is seen, only its daily thermal cycle.
## What happened
**The bridge moves with the temperature, every day.** It sinks as it warms during the day and rises as it cools at night, each target by its own amount. This is normal. One day had been left out: 24/10, a rainy day, still shows a weak cycle (the bridge sinks until late afternoon, then rises until midnight), so two labels were added. The cooling of the night of 25 to 26/10 went on until 10:00, not 09:00. Confirmed.
**The bridge moves with the temperature, every day.** It sinks as it warms and rises as it cools, each target by its own amount. On the sunny days (22 and 27/10) the curves swing by about 1 to 2 mm around their daily mean (PM_D, 22 m from the camera, sinks by 1.7 mm on 22/10). On the dull days of 21 and 30/10 the swing is a few tenths of a mm. That is still clearly above the noise for at least three targets, so these days keep their labels. This is normal. Confirmed.
![The weak cycle of 24/10](thermal_2026-10-24.png)
Look at the top panel: the top curve (PBJ_C) goes down from 07:00 to 17:00 on 24/10, then back up until midnight.
**Rain disturbs the reference REF_G.** The references stand in the open, off the bridge; the targets are sheltered under the deck. In the first week, every short episode where all the curves jump together at the same moment (21/10 early afternoon and evening, the night of 21 to 22/10, 23/10 morning and late evening, 24/10 morning, all of 25/10) falls during rain at the nearby weather station. The jumps are small. They are not a movement. The labels used to say "cause not established": they now say "rain, likely". On 23/10 morning the road is wet on the camera image, and the episode lasted longer than written: from 07:15 to 12:15 instead of 07:30 to 10:30. The episode of 23/10 evening started at 21:45, not 22:30. Cause likely; confirmed on 23/10 morning.
**Rain disturbs the references, which stand in the open.** The targets are sheltered under the deck. During rain at the MeteoSwiss station of Nyon / Changins, 2 km away, all the curves jump together from one measurement to the next. This happened on 21/10 afternoon and evening, the night of 21 to 22/10, 23/10 morning and late evening, 24/10 morning and all of 25/10. The false shifts are about 0.3 to 1 mm, and up to 3 mm on 25/10 (PM_C, rejected many times that day). The cause is likely rain. On 23/10 the wet road on the image confirms it. The two short jumps in the sun (22/10 and 27/10 around 15:15) are smaller, about 0.2 to 0.5 mm, but still above the noise on one or two far targets (BL_G, 34 m from the camera).
![23/10 morning](rain_morning_2026-10-23.png)
Look at the bottom panel: the error of the targets rises between 07:30 and 11:30, and the curves above jump and shift during the same hours.
**At night, REF_G (and on 27/10 REF_D too) loses its light and is dropped** (26, 27 and 28/10, all dry nights). The measurement then rests on two references, or on one, and the curves are not to be trusted. These three labels were right and are kept. Cause unknown.
**At night, REF_G loses its light and is dropped (26, 27 and 28/10, all dry nights), and on 27/10 REF_D too.** The measurement then rests on two references, or none. All the targets jump by 2 to 3.5 mm, far above the noise. The curves are not to be trusted. Cause unknown.
**Other labels kept**: two single jumps in the sun (22/10 and 27/10 afternoon), two gaps in the data shared with other stations (26/10 and 27/10), and PM_G, which is rejected at every measurement (its own label, which runs across the whole month).
**Two gaps in the data**, on 26/10 at 14:30–14:45 and on 27/10 at 09:00. No sensor is measured at all. The same gaps fall on other stations.
## What to do
@@ -30,23 +30,18 @@ Nothing on the bridge. If the reference losses at night keep coming back, check
## Not established
- Rain is measured 2 km away, not at the camera: the link is likely, not proven. It is not proven either because some rainy hours (23/10 afternoon and early evening) leave REF_G untouched.
- Why REF_G and REF_D lose their light on dry, humid nights (condensation on the prisms is possible): a look at the prisms, or a night image just before a loss, would settle it.
- Rain is measured 2 km away, not at the camera. The link is likely, not proven: some rainy hours (23/10 afternoon and early evening) leave the references untouched.
- Why REF_G and REF_D lose their light on dry, humid nights (condensation on the prisms is possible). A look at the prisms, or a night image just before a loss, would settle it.
## Verification
## Requalification
Kept 27, corrected 7, removed 0, added 2.
Kept 36, rewritten 0, removed 0.
- JUNGFRAU-67: description: cause "not established" → rain likely (rain at the weather station at the same hours).
- JUNGFRAU-69: description: cause "not established" → rain likely.
- JUNGFRAU-70: description: cause "not established" → rain likely (rain stops when REF_G becomes sharp again).
- JUNGFRAU-75: bounds 07:30–10:30 → 07:15–12:15 (the first jump is at 07:30; the curves come back only at 11:30–12:15); "in clear weather" was wrong (wet road, rain measured); cause → rain.
- JUNGFRAU-77: start 22:30 → 21:45 (first common jump at 22:00); images now looked at (REF_G a little smaller at 22:45); cause → rain likely.
- JUNGFRAU-78: description: cause "not established" → rain likely (light rain all morning).
- JUNGFRAU-81: end 09:00 → 10:00 (the bridge still rises until 10:00, where the next cycle starts; the hour in between had no label).
- Added: 24/10 06:30 → 17:00, thermal, warming of a rainy day (no thermal label on 24/10).
- Added: 24/10 17:00 → 25/10 00:15, thermal, cooling of the evening.
- JUNGFRAU-2 (spanning, PM_G rejected throughout): holds within the range, not changed.
No label was removed or rewritten. Every one has at least one target beyond 5 of its own noises over its range. The closest to the threshold:
- JUNGFRAU-89 (27/10 15:00–15:45, sun behind REF_G): BL_G in x reaches 6 to 7 noises (about 0.3 mm). Kept.
- JUNGFRAU-116 (22/10 night, rain): 6 noises against the local level, 11 against the fixed level. Kept.
- JUNGFRAU-118 (23/10 late evening, rain): 6 to 9 noises. Kept.
- JUNGFRAU-96 (30/10, weak warming): the average of the targets stays under the threshold, but PM_C and PBJ_C sink 7.5 to 7.7 noises below the night level. Kept.
## Labels
@@ -0,0 +1,32 @@
"""Run ranges.py --k 5 on each label of requalify_input.jsonl; report the max |deviation| in noises per target (refs excluded)."""
import json, subprocess, sys, re
D = sys.argv[1]
out = {}
for line in open(f"{D}/work/requalify_input.jsonl"):
L = json.loads(line)
fam = L["family"]
if fam == "No data":
continue
modes = [("plain", [])]
if fam != "Thermal displacement":
modes.append(("rolling4", ["--rolling", "4"]))
for name, extra in modes:
cmd = ["python3", "tools/scripts/ranges.py", "data/JUNGFRAU", "--columns", "corr_x,corr_y", "--k", "5",
"--start", L["start"], "--end", L["end"]] + extra
txt = subprocess.run(cmd, capture_output=True, text=True).stdout
open(f"{D}/work/rq/{L['id']}_{name}.txt", "w").write(" ".join(cmd) + "\n" + txt)
best = {}
col = None
for l in txt.splitlines():
m = re.match(r"(corr_[xy]): ranges", l)
if m: col = m.group(1); continue
if l.startswith("=="): col = None; continue
if col:
p = l.split()
if len(p) >= 8 and re.match(r"\d{4}-", p[1]) and not p[0].startswith("REF"):
try: z = float(p[5])
except ValueError: continue
k = (p[0], col)
if abs(z) > abs(best.get(k, (0,))[0]): best[k] = (z, p[6], int(p[3]))
top = sorted(best.items(), key=lambda kv: -abs(kv[1][0]))[:4]
print(L["id"], L["start"], L["end"], fam[:10], name, "|", "; ".join(f"{s} {c[-1]} {z:+.1f} @{t[11:16]} n={n}" for (s, c), (z, t, n) in top) or "none")
@@ -0,0 +1,30 @@
"""Visibility labels: ranges.py --k 5 --rolling R on label +-12 h, noise outside the label; keep the ranges overlapping the label (targets only)."""
import json, subprocess, sys, re
from datetime import datetime, timedelta
D = sys.argv[1]; R = sys.argv[2] if len(sys.argv) > 2 else "4"
f = lambda s: datetime.strptime(s, "%Y-%m-%dT%H:%MZ")
g = lambda d: d.strftime("%Y-%m-%dT%H:%MZ")
for line in open(f"{D}/work/requalify_input.jsonl"):
L = json.loads(line)
if L["family"] != "Visibility": continue
s, e = f(L["start"]), f(L["end"])
for name, extra in [("roll" + R, ["--rolling", R]), ("plain", [])]:
cmd = ["python3", "tools/scripts/ranges.py", "data/JUNGFRAU", "--columns", "corr_x,corr_y", "--k", "5",
"--start", g(s - timedelta(hours=12)), "--end", g(e + timedelta(hours=12)),
"--outside", f"{L['start']}/{L['end']}"] + extra
txt = subprocess.run(cmd, capture_output=True, text=True).stdout
open(f"{D}/work/rq/{L['id']}_wide_{name}.txt", "w").write(" ".join(cmd) + "\n" + txt)
best = {}; col = None
for l in txt.splitlines():
m = re.match(r"(corr_[xy]): ranges", l)
if m: col = m.group(1); continue
if l.startswith("=="): col = None; continue
p = l.split()
if col and len(p) >= 8 and re.match(r"\d{4}-", p[1]) and not p[0].startswith("REF"):
try: z = float(p[5]); t = f(p[6])
except ValueError: continue
if not (s <= t <= e): continue
k = (p[0], col)
if abs(z) > abs(best.get(k, (0,))[0]): best[k] = (z, p[6], int(p[3]))
top = sorted(best.items(), key=lambda kv: -abs(kv[1][0]))[:5]
print(L["id"], L["start"][5:], L["end"][5:], name, len(best), "|", "; ".join(f"{a} {c[-1]} {z:+.1f} @{t[11:16]} n={n}" for (a, c), (z, t, n) in top) or "none")
@@ -0,0 +1,30 @@
"""Visibility labels: ranges.py --k 5 --rolling R on label +-12 h, noise outside the label; keep the ranges overlapping the label (targets only)."""
import json, subprocess, sys, re
from datetime import datetime, timedelta
D = sys.argv[1]; R = sys.argv[2] if len(sys.argv) > 2 else "4"
f = lambda s: datetime.strptime(s, "%Y-%m-%dT%H:%MZ")
g = lambda d: d.strftime("%Y-%m-%dT%H:%MZ")
for line in open(f"{D}/work/requalify_input.jsonl"):
L = json.loads(line)
if L["family"] != "Visibility": continue
s, e = f(L["start"]), f(L["end"])
for name, extra in [("roll" + R, ["--rolling", R]), ("plain", [])]:
cmd = ["python3", "tools/scripts/ranges.py", "data/JUNGFRAU", "--columns", "corr_x_mm,corr_y_mm", "--k", "5",
"--start", g(s - timedelta(hours=12)), "--end", g(e + timedelta(hours=12)),
"--outside", f"{L['start']}/{L['end']}"] + extra
txt = subprocess.run(cmd, capture_output=True, text=True).stdout
open(f"{D}/work/rq/{L['id']}_wide_mm_{name}.txt", "w").write(" ".join(cmd) + "\n" + txt)
best = {}; col = None
for l in txt.splitlines():
m = re.match(r"(corr_[xy]_mm): ranges", l)
if m: col = m.group(1); continue
if l.startswith("=="): col = None; continue
p = l.split()
if col and len(p) >= 8 and re.match(r"\d{4}-", p[1]) and not p[0].startswith("REF"):
try: z = float(p[4]); t = f(p[6])
except ValueError: continue
if not (s <= t <= e): continue
k = (p[0], col)
if abs(z) > abs(best.get(k, (0,))[0]): best[k] = (z, p[6], int(p[3]))
top = sorted(best.items(), key=lambda kv: -abs(kv[1][0]))[:5]
print(L["id"], L["start"][5:], L["end"][5:], name, len(best), "|", "; ".join(f"{a} {c[-1]} {z:+.1f} @{t[11:16]} n={n}" for (a, c), (z, t, n) in top) or "none")