180 lines
18 KiB
Markdown
180 lines
18 KiB
Markdown
# Modification
|
||
|
||
**Verdict**: changed
|
||
**Changed**: scripts/visibility.py, thresholds.md
|
||
|
||
## Diagnosis
|
||
|
||
LENZSPITZE, 2026-10-16T02:35Z → 2026-10-23T23:55Z (checks on 2026-10-16 → 2026-10-24), cadence 5 min; 31 targets, 8 references.
|
||
|
||
| Family | labelled | found | flagged | wrongly |
|
||
|---|---|---|---|---|
|
||
| Displacement | 0 | 0 | 2 | 2 |
|
||
| No data | 6 | 6 | 6 | 2 |
|
||
| Obstruction | 15 | 13 | 51 | 37 |
|
||
| Perturbation | 1 | 0 | 12 | 12 |
|
||
| Thermal displacement | 7 | 7 | 1 | 0 |
|
||
| Visibility | 17 | 14 | 26 | 0 |
|
||
|
||
(Before. A label is found when an event of its family covers at least one of its instants. An event is wrongly flagged when none of its instants is in a label of its family. LENZSPITZE-90 starts at the last instant of the range and is not counted.)
|
||
|
||
- **No data**, LENZSPITZE-2, 3, 7, 20, 21, 22: correct. The 22:55 → 04:00 event on 10-15/16 starts before the range, in the history. The 2 "wrongly" events are holes, which count only their bounds.
|
||
- **Thermal displacement**, LENZSPITZE-4, 10, 17, 23, 29, 32, 36: found 1009/1009, but by a single "Camera thermal movement" event running 10-13 15:35 → 10-23 23:45. That makes 1279 wrong instants: every night and the whole of 18 October. Cause: `thermal_displacement.py`. On this station, neither the corrected wave nor the raw wave has a cycle on enough targets: only 1020 repeats day after day (likeness 0.78; the next targets are 0.5 or less, and the R² of every target is under 0.3). So the detector falls back to `slides()`. Slides fire during the rainy nights as well, and slides less than a day apart are chained into one episode. Shortening the chaining gap was tried and regresses (see Not fixed).
|
||
- **Obstruction, extra**, inside Visibility LENZSPITZE-1, 73, 76, 78, 26, 87, 30, 34, 35, 38: about 300 wrong instants, from about 35 events. Cause: `visibility.py` rule 2, the "rejected alone" branch (`strong`). In night mist or rain, the distant references 8011–8014 and the distant targets 101B, 102H, 201B, 202H are rejected in turn. Each rejection becomes a Brief obstruction, and `categories.py` chains the instants of the same sensor (MERGE) into events lasting hours (10-16 22:30 → 10-17 04:50, 10-22 20:20 → 10-23 04:00, …). The labels say Visibility: a reference at its threshold with nothing in front of it.
|
||
- **Obstruction, correct**: LENZSPITZE-72, 9, 14, 19, 24, 25, 28, 31, 39 (passages of the even-numbered group), 120 and 85 (a reference hidden).
|
||
- **Obstruction, partly found or missing**: LENZSPITZE-74 (1/9), 75 (4/10), 86 (0/3), 89 (0/2). In these, targets are partly covered and lose light without being rejected. Their error_value barely moves, so they show only as jumps (Perturbation) or not at all.
|
||
- **Visibility, correct**: LENZSPITZE-1, 6, 73, 18, 38 (≥ 85 %). The extra Poor visibility and Heat shimmer events all fall inside Visibility labels. In the rain, Heat shimmer also fires at night: it is the same family, so this is an alternative reading.
|
||
- **Visibility, partly found**: rain episodes LENZSPITZE-13 (18/79), 76 (73/98), 78 (150/280), 26 (51/96), 87 (101/129), 30 (113/228), 35 (71/131), heat shimmer 33 (53/92), night mist 34 (64/108). Cause: `visibility.py`. Over the missed hours, the error_value is barely above its median (median z often under 1, a few high sensors). The light returned (flux) is clearly low (0.45 to 0.8 of its median), but `visibility.py` does not read flux. In part of LENZSPITZE-78 (10-18 22:00 → 10-19 07:00) both signals are back to normal.
|
||
- **Visibility, missing**: LENZSPITZE-77 (distant targets shifting before dawn), 83 (1013–1023 losing light before dawn), 37 (four targets dimming for half an hour). Here a few targets lose light without being rejected. The detectors show only jumps (Perturbation) or nothing.
|
||
- **Perturbation, extra** (149 instants): jumps back to normal inside the rain labels that no detected Visibility episode covers, so nothing absorbs them (10-17 10:25 → 11:45, 16:10 → 17:50, 10-18 05:20 → 09:45, 10-20 17:15 → 19:05, …). Same cause as the partly found Visibility.
|
||
- **Perturbation, missing**: LENZSPITZE-84 (camera jolt, one measurement): no jump is flagged. It lies under the thermal event, and the score does not see jumps in the thermal family.
|
||
- **Displacement, extra**: 10-23 21:00 and 22:55 → 23:50, "Jump, not back yet", inside the rain label LENZSPITZE-38. The range ends before the targets come back, and only jumps already back are absorbed by a Visibility episode.
|
||
|
||
## What changed
|
||
|
||
All changes are in `scripts/visibility.py` (and `thresholds.md`). They come from the pruning of the detector the diagnosis blames most.
|
||
|
||
- **S1** (f4cf05d): rule 1, high measurement. Removed the condition `x > FACTOR * med`, so a measurement is high when it is more than K_MAD MAD above its sensor's median. `FACTOR` (2) stays for the "rejected alone" branch. Docstring, constant comment and the `FACTOR` line of `thresholds.md` updated.
|
||
- **S2** (0bd560f): rule 4, diffuse nuisance. Removed the condition "unless within heat shimmer or another Poor visibility" and the `hosts` list it needed: a diffuse run of at least RUN_MIN instants is always a Poor visibility "reduced". The heat shimmer is computed in the `return`. 3 code lines fewer.
|
||
- **S3** (fc422f1): rule 3, Poor visibility. The runs of a sensor no longer exclude the instants of a salient brief obstruction, and the `briefs` set is removed.
|
||
- **S4** (ec3958c): rule 2, brief obstruction. Removed the constant `BRIEF_MIN` (3 sensors) and its line in `thresholds.md`. The condition `n(t) >= BRIEF_MIN` becomes `n(t)`: at least one high sensor, still SALIENCE times more than at each neighbouring instant.
|
||
|
||
Complexity: 613 code lines and 47 constants → 609 and 46.
|
||
|
||
## Why
|
||
|
||
- S1: the factor on the median was added to drop sensors with a near-zero MAD. K_MAD MAD above the median already plays that role. Without the factor, sensors whose error_value is usually high, but which rise far above their noise in fog or rain, count again. This raises Visibility "found" on the Total by 1 point.
|
||
- S2: the condition only kept a diffuse Poor visibility from showing inside another Visibility episode. That changes no family and no instant. Without it, the rain episodes carry the sensors they really touch (29 to 39 instead of 3 to 10 on this station).
|
||
- S3: the brief instants were cut out of the Poor visibility runs, which split a sensor's run around a passage. Including them changes almost nothing (NIEDERHORN Visibility found +5 points) and removes a set.
|
||
- S4: salience (3 times the neighbouring instants) is what recognises a passage. The minimum of 3 sensors only dropped passages that hide one or two targets, which are Obstruction too. Total Obstruction found +2 points.
|
||
|
||
## Checks
|
||
|
||
- **events** (LENZSPITZE): more sensors on the rain Poor visibility events (S2). One new Poor visibility event on 10-22 08:00 → 11:55 and one on 10-23 23:25 → 23:35, both in Visibility labels. Single-instant Brief obstructions of 1–3 sensors added (S4), mostly inside rain. The 10-22 20:20 → 10-23 04:00 Obstruction is split in three. Details in "Before / after on the range". No `skipped` line.
|
||
- **sensors**: the same changes, sensor by sensor (`sensors-S4.txt`).
|
||
- **range**: Visibility 971 → 974 found, 980 → 983 flagged. Obstruction flagged 352 → 363 (correct 7 → 6 %). Other families unchanged.
|
||
- **benchmark**: 0 regressions at each step (compare against the previous committed state: `benchmark-S1.txt` … `benchmark-S4.txt`) and in the whole against `benchmark-before.txt`.
|
||
|
||
## Pruning
|
||
|
||
`visibility.py`, each rule removed on its own copy and benchmarked against the last committed state:
|
||
|
||
- `x > FACTOR * med` in a high measurement: removed, S1 (f4cf05d).
|
||
- "not within another Visibility" for the diffuse nuisance: removed, S2 (0bd560f).
|
||
- brief instants excluded from the Poor visibility runs: removed, S3 (fc422f1).
|
||
- `BRIEF_MIN` (3 sensors): removed, S4 (ec3958c).
|
||
- `x > FACTOR * med` for a rejected sensor: kept. Its removal makes Total Obstruction correct 28 → 25 % (631 wrong instants added).
|
||
- the "rejected alone" branch (`strong`): kept. Removal: Total Obstruction found 40 → 28 %, NORDEND 40 → 30 %, WILDSTRUBEL 35 → 20 %, NIEDERHORN 55 → 35 %.
|
||
- `SALIENCE`: kept. Removal: Total Visibility found 56 → 48 % (LENZSPITZE, NORDEND, NIEDERHORN), Perturbation found and correct down.
|
||
- zones of at least two sensors: kept. Removal: CLARIDEN Visibility correct 100 → 2 %, Total 69 → 59 %.
|
||
- the diffuse nuisance (rule 4): kept. Removal: FLORIDA Visibility found 70 → 34 %, JUNGFRAU 62 → 55 %, Total 56 → 51 %.
|
||
- `RUN_MIN` of the diffuse nuisance: kept. Removal: Total Perturbation found 8 → 6 %.
|
||
- `RUN_MIN` of the Poor visibility runs (tried after S4): kept. Removal: CLARIDEN Visibility correct 100 → 3 %, Total 69 → 58 %.
|
||
- heat shimmer, error_value at RATIO: kept. Removal: Total Visibility correct 69 → 46 % (six stations).
|
||
- heat shimmer, SHARE of agitated sensors (tried after S4): kept. Removal: NIEDERHORN Visibility correct 81 → 64 %, Total 69 → 68 %.
|
||
|
||
## Before / after on the range
|
||
|
||
Events check, changed lines (`events-before.txt` → `events-S4.txt`, truncated):
|
||
|
||
```
|
||
< 10-16T06:30 → 06:30 Obstruction Brief obstruction 4 sensors > 5 sensors
|
||
> 10-16T11:00 → 11:00 Obstruction Brief obstruction 1 sensors (new)
|
||
< 10-16T11:30 → 15:25 Visibility Poor visibility 2 sensors > 3 sensors
|
||
> 10-16T18:05 → 18:05 Obstruction Brief obstruction 2 sensors (new)
|
||
< 10-17T11:55 → 12:10 Obstruction Brief obstruction 19 sensors > 15 sensors
|
||
< 10-17T12:05 → 12:25 Visibility Poor visibility > 10-17T11:55 → 12:25
|
||
< 10-18T13:05 → 22:00 Visibility Poor visibility 3 sensors > 29 sensors
|
||
< 10-19T08:00 → 08:00 Obstruction Brief obstruction 11 sensors > 10-19T08:00 → 08:15
|
||
> 10-19T14:55 → 14:55 Obstruction Brief obstruction 1 sensors (new)
|
||
< 10-19T15:55 → 15:55 Obstruction Brief obstruction 5 sensors > 6 sensors
|
||
< 10-21T02:55 → 11:00 Visibility Poor visibility 31 sensors > 35 sensors
|
||
< 10-21T13:00 → 13:50 Perturbation 31 sensors > 2 sensors, and
|
||
> 10-21T13:35 → 13:35 Obstruction Brief obstruction 31 sensors (new)
|
||
< 10-21T17:20 → 19:45 Visibility Poor visibility 10 sensors > 35 sensors
|
||
> 10-22T07:35 → 07:35 Obstruction Brief obstruction 2 sensors (new)
|
||
> 10-22T08:00 → 11:55 Visibility Poor visibility 2 sensors (new)
|
||
> 10-22T10:20, 11:30 Obstruction Brief obstruction 3 sensors (new)
|
||
< 10-22T20:20 → 10-23T04:00 Obstruction 11 sensors > 20:20 → 22:15 (2), 20:50 (1), 22:20 → 04:00 (11)
|
||
< 10-23T06:35 → 12:05 Visibility Poor visibility 33 sensors > 06:35 → 12:10, 34 sensors
|
||
< 10-23T15:20 → 16:35 Visibility Poor visibility 33 sensors > 39 sensors
|
||
< 10-23T18:30 → 20:20 Visibility Poor visibility 6 sensors > 34 sensors
|
||
> 10-23T23:25 → 23:35 Visibility Poor visibility 24 sensors (new)
|
||
```
|
||
|
||
Range score, before → after:
|
||
|
||
| Family | found | correct |
|
||
|---|---|---|
|
||
| Displacement | — | 0/14 → 0/14 |
|
||
| No data | 16/16 → 16/16 | 16/33 → 16/33 |
|
||
| Obstruction | 23/42 → 23/42 | 23/352 (7 %) → 23/363 (6 %) |
|
||
| Perturbation | 0/1 → 0/1 | 0/149 → 0/149 |
|
||
| Thermal displacement | 1009/1009 → 1009/1009 | 1009/2288 → 1009/2288 |
|
||
| Visibility | 971/1561 → 974/1561 (62 %) | 971/980 → 974/983 (99 %) |
|
||
|
||
## Benchmark
|
||
|
||
```
|
||
ALASKA Perturbation found 6 → 5 % (1 instants lost)
|
||
ALASKA Perturbation correct 80 → 79 % (0 instants lost)
|
||
ALASKA Visibility found 87 → 100 %
|
||
ALASKA Visibility correct 33 → 36 %
|
||
BREITHORN Obstruction correct 55 → 54 % (1 instants lost)
|
||
CLARIDEN Obstruction correct 11 → 7 % (6 instants lost)
|
||
FLORIDA Visibility found 70 → 76 %
|
||
LENZSPITZE Visibility correct 99 → 98 % (7 instants lost)
|
||
NIEDERHORN Obstruction found 55 → 56 %
|
||
NIEDERHORN Obstruction correct 38 → 37 % (9 instants lost)
|
||
NIEDERHORN Visibility found 42 → 55 %
|
||
NIEDERHORN Visibility correct 78 → 81 %
|
||
NORDEND Obstruction found 40 → 43 %
|
||
NORDEND Obstruction correct 47 → 48 %
|
||
NORDEND Perturbation found 4 → 0 % (1 instants lost)
|
||
NORDEND Perturbation correct 5 → 0 % (0 instants lost)
|
||
SNCF01 Obstruction found 76 → 95 %
|
||
SNCF01 Obstruction correct 2 → 3 %
|
||
Total Obstruction found 40 → 42 %
|
||
Total Perturbation found 8 → 7 % (3 instants lost)
|
||
Total Visibility found 56 → 57 %
|
||
WYOMING Obstruction correct 100 → 21 % (11 instants lost)
|
||
WYOMING Perturbation found 86 → 79 % (1 instants lost)
|
||
WYOMING Perturbation correct 57 → 61 %
|
||
|
||
0 regression(s); complexity: 613 code lines, 47 constants → 609 code lines, 46 constants
|
||
```
|
||
|
||
## For the user to decide
|
||
|
||
- S4 (no minimum of sensors for a salient brief obstruction) adds one- to three-sensor Brief obstructions. On this range they add 11 wrong Obstruction instants, mostly inside rain (Visibility labels LENZSPITZE-30, 33, 34, 18). WYOMING Obstruction correct falls 100 → 21 % (11 instants) and CLARIDEN 11 → 7 % (6 instants). All of this is under the noise thresholds, and Total Obstruction found rises 2 points. Kept as a pruning without a regression.
|
||
- The rejected distant references at night (LENZSPITZE-1, 73, 34, 35: Visibility, the far end of the scene in mist) look the same in the measurements as a cobweb thread over one reference (NORDEND-231, 236, 239: Obstruction, seen on the thumbnails). A sensor is rejected alone, at its threshold, while a Poor visibility episode is running. The detectors keep reading both as Obstruction, which follows the NORDEND labels. Reading them as Visibility would cost NORDEND Obstruction found 40 → 33 % (212 instants, a regression).
|
||
|
||
## Not fixed
|
||
|
||
- The Obstruction events in the night mist (about 300 wrong instants on the range). I tried leaving a sensor rejected alone to the Visibility episode it falls in: (a) any Visibility episode, (b) Poor visibility only, (c) Poor visibility counting that same sensor. On the range this raises Obstruction correct from 7 % to 30 % (a) or 9 % (c). On the benchmark it costs NORDEND Obstruction found 7 points (212 instants) and Total Obstruction found 3 to 8 points: a regression each time (see "For the user to decide").
|
||
- The thermal event running over the whole range (1279 wrong instants). Chaining slides at most 3 h or 12 h apart instead of a day: LENZSPITZE Thermal found 92 → 65 % or 81 %, WYOMING 50 → 28 % or 33 %, Total 81 → 77 % or 79 %, which is a regression. The thermal cycle of this station lives on one target (1020), below the SHARE of targets the wave needs.
|
||
- Rain hours with error_value barely raised (LENZSPITZE-13, 26, 30, 35, 78) and the Perturbations they leave unabsorbed. A condition "more than half of the sensors at half their usual flux or less" added to the diffuse nuisance earns only 10 instants on the range. Not worth a constant, so it was not committed.
|
||
- LENZSPITZE-84 (camera jolt), LENZSPITZE-77 and 83 (targets dimming before dawn), the partial passages LENZSPITZE-74, 75, 86, 89: see Limits.
|
||
- The two "Jump, not back yet" events inside LENZSPITZE-38: an artefact of the range's end (14 instants). Absorbing every jump into Visibility would also hide a real displacement during rain.
|
||
|
||
## Limits
|
||
|
||
- LENZSPITZE-77 (2026-10-18T05:05Z → 06:35Z, Visibility), LENZSPITZE-83 (2026-10-20T05:00Z → 06:25Z, Visibility), LENZSPITZE-37 (2026-10-23T14:01Z → 14:30Z, Visibility) and the partial passages LENZSPITZE-74 (2026-10-17T09:00Z → 09:45Z), 75 (10:00Z → 10:55Z), 86 (2026-10-20T15:00Z → 15:20Z), 89 (2026-10-23T13:30Z → 13:45Z), all Obstruction. A few targets lose light without being rejected. Only the flux shows the cause. Flux is read only by recent cameras, and among the labelled stations only LENZSPITZE has it. A flux rule could be validated on more than one station only once others have such cameras.
|
||
- The rain hours whose error_value stays near its median (LENZSPITZE-13, 26, 30, 35, 78): the same, the flux sees them (0.45 to 0.8 of its median). In LENZSPITZE-78, 10-18 22:00 → 10-19 07:00, neither error_value nor flux differs from a calm night. Only the corrected curves (or an image) could say it is still raining.
|
||
- Mist on the distant references against a cobweb over a reference (see "For the user to decide"): only the image tells them apart.
|
||
- No label of the range is said to be wrong by the report. It notes that LENZSPITZE-81 and 82 are the same effect on either side of the noise threshold (only 82 kept).
|
||
|
||
## Tools
|
||
|
||
- `sessions/LENZSPITZE_2026-10-16T0235_2026-10-23T2355_20261118T1434Z/tools/perlabel.py <detectors> <station> <labels.jsonl> <from> <to>`: per label, its instants found by its family and the other families there; per event, its instants and how many are wrong. Worth keeping (the event-by-event diagnosis).
|
||
- `…/tools/table.py <perlabel output>`: the table labelled / found / flagged / wrongly per family. Worth keeping with perlabel.py.
|
||
- `…/tools/prune.py <detectors> <tools> <work> [variant …]`: one copy of the detectors per rule of `visibility.py` removed (string replacements); fails if a rule's text changed. Worth keeping as a pattern; the list of variants is specific to `visibility.py`.
|
||
- `…/tools/slides.py <detectors> <station> <from> <to>`: the camera-slide instants of `thermal_displacement.slides` per day, and the runs they make for several chaining gaps. Useful for a station that falls back to slides.
|
||
- `…/tools/wave.py <detectors> <station> <from> <to> [history]`: per target and axis, the day likeness and the 24 h R² of `thermal_displacement._wave`. Useful to see why a wave is not found.
|
||
- `…/tools/diffuse.py <detectors> <station> <from> <to> <show from> <show to>`: hour by hour, median z of error_value, high and rejected counts, median flux ratio. Useful for Visibility.
|
||
|
||
## Difficulties
|
||
|
||
- `bench/sensors.py` has no "before" file. I ran it (and the events check) at the start: `events-before.txt`, `sensors-before.txt`.
|
||
- One small edit to `tools/prune.py` (adding two variants) was made with an inline Python heredoc instead of the Edit tool. The resulting file is the one listed above.
|