Files
aimsight-optimizer/sessions/LENZSPITZE_2026-10-23T2355_2026-11-01T1140_20261118T1049Z/modification.md
T

107 lines
13 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Modification
**Verdict**: changed
**Changed**: scripts/displacement.py, thresholds.md
## Diagnosis
LENZSPITZE, 2026-10-23 → 2026-11-02 (UTC), one measurement every 5 min (31 targets, 8 references).
| Family | labelled | found | flagged | wrongly |
|---|---|---|---|---|
| Displacement | 0 | 0 | 2943 → 27 | 2943 → 27 |
| No data | 6 | 4 | 4 | 0 |
| Obstruction | 58 | 17 | 486 | 469 |
| Perturbation | 6 | 1 | 426 | 425 |
| Thermal displacement | 1469 | 1342 | 2611 | 1269 |
| Visibility | 1166 | 817 | 875 | 58 |
- **Extra, the largest defect**: a Slow drift (Displacement, kept) on 1001 and 1010 covering the whole window read, 10-20 00:00 → 11-01 23:55, i.e. every instant of the range. There is no Displacement label on the range, and the report says no real movement of the structure is seen. Cause: the whole-window branch of `displacement.drift` (`_whole`) fires when the trend over the window reaches `SIZE` = 1 median daily amplitude. Here the trend is 1.0 amplitude (1001 corr_x, −0.08 px in 12 days) and 1.1 amplitudes (1010 corr_y, +0.05 px). The same mechanism shows up elsewhere: PR16 over the whole NORDEND window (1.0), and 1012/1016/1018 on the earlier LENZSPITZE range (1.0 to 1.9). None of these is labelled. The one labelled whole-window drift (WILDSTRUBEL-89, PB2_2) is 2.6 amplitudes.
- **Extra, Obstruction "Target obscured"** on 9 distant sensors, 10-26 00:00 → 10-27 ~08:30. These overlap the mist nights LENZSPITZE-101 and -44 (Visibility) and the day LENZSPITZE-42 in between. Cause: `target_issue` counts 2 UTC days rejected ≥ 25 % (two mist nights in a row) as a target hidden for a few days. It does not tell a rejection shared by much of the scene apart from one specific to the target. → Not fixed.
- **Wrong family / missed, the short partial occultations** (LENZSPITZE-89, 94, 49, 50, 59, 63, 109, 110, 111, 112, 113, 115; Obstruction): the detectors see a single-target "Sudden jump, back to normal" (Perturbation) or nothing. Only the flux of the hidden targets drops. Their `error_value` stays near its median (e.g. 1022 on 10-29 14:35: +3.9 MAD; 92H on 10-30 13:55: +6.2 MAD, under `K_MAD`) and they are not rejected, so `visibility`'s Brief obstruction cannot see them. → Limits.
- **Correct, the passages of the even group** (LENZSPITZE-39, 95, 102, 103, 104, 48, 54, 57, 60, 62, 65, 119, 67, 69): Brief obstruction at the right instant.
- **Wrong bounds, Thermal displacement** (all daily labels, 36, 93, 97, 42, 45, 52, 56, 61, 114, 117): found 91 % but correct 51 %. The corrected-curve wave fails at station level: 8 of the 31 targets have a reproducible cycle (`SHARE` 0.5), and no target has a 24 h sine above `R2_MIN`, the best being 1007 at 0.29. The camera wave on x, y fails too. The fallback "Camera thermal movement" (common slides) then makes one block 10-20 10:30 → 10-30 13:05, bridging the nights (`runs(..., DAY)`). → Not fixed.
- **Missed, turbulence on 28 Oct** (LENZSPITZE-55, Visibility, 0/37): every sensor is agitated ×1.9 to ×2.9 its calm, but the median `error_value` stays at ×0.9 of its calm, so `heat_shimmer`'s error criterion rejects it. The families document says "the pose shaking without the error_value rising is not turbulence", yet the label says the error rises. → For the user to decide.
- **Missed, partial dimming** (LENZSPITZE-37, 99, 107, Visibility, a few targets for half an hour): same blindness to flux as the occultations. → Limits.
- **Extra Perturbations** (426 instants): single-target jumps that come back hours later (e.g. 1019 10-24 11:40 → 23:00, 101B 12:15 → 22:40) and fall just outside the detected Visibility episodes. MERGE then joins them into multi-hour "31 sensors" events. A return after hours is a Perturbation by design (ALASKA 2026-11-04, S5). The defect is in the short bounds of the visibility episodes around them. → Not fixed.
- **Wrong family, Lasting shift** on one target during visibility episodes (10-25 11:25 1021, 10-26 07:00, 08:30, 10-27 09:25): 1 instant each, now the only 27 wrongly flagged Displacement instants. Small → Not fixed.
- **Partly found, Perturbation of 8012** (LENZSPITZE-105, 106, 108): the shift of the far reference passes to the targets below `K_TOGETHER`. Covered by Thermal only. Small → Not fixed.
- No data LENZSPITZE-43 and -46 are correct. LENZSPITZE-58 (one missing measurement, 10-29 15:05-15:15) is missed: it is a hole of a single step (`MISSING`). Its 2 bound instants only.
## What changed
- **S1** (`f623b79`), `scripts/displacement.py`: constant `SIZE` 1.0 → 2.0. A slow drift over the whole window must now reach twice the median daily amplitude. `thresholds.md`: the `SIZE` line updated.
- **S2** (`c8fb838`), pruning: the Kendall-tau condition (`STEADY` = 0.6) is removed from both the whole-window test and the pieces, along with its computations (`tau` in `_whole`, `signs` in `_pieces`). The docstring comment and the `STEADY` line of `thresholds.md` are removed.
- **S3** (`466799f`), pruning: constant `DAYS` = 5 removed. An axis needs at least two kept days (the minimum for a slope), and the `n >= DAYS` condition of the pieces is gone. Because a drift may not contain a day-to-day step larger than half of it, a drift still needs at least three days. The comment, the unused `n` and the `DAYS` line of `thresholds.md` are updated or removed.
## Why
- S1: a trend of one daily amplitude over a whole window is not a movement but the wander of a healthy target. At that threshold the whole-window branch flagged untouched targets of several stations as Displacement across the entire window. At two amplitudes the trend has to clearly exceed the daily swing, and the labelled whole-window drift is still found.
- S2, S3: with the step condition and the size thresholds in place, the steadiness condition and the minimum day count removed nothing anywhere in the benchmark. Removing them is a simplification without a regression.
## Checks
- events: one line removed, `2026-10-20T00:00Z → 2026-11-01T23:55Z Displacement kept | Slow drift | 2 sensors`. Nothing else changes, and no `skipped` line.
- sensors: the line `Displacement | Slow drift | 1001, 1010` removed.
- range: Displacement correct `0/2943` → `0/27`. Every other line is unchanged.
- benchmark: see below. S2 and S3 leave every figure identical to S1.
## Pruning
Rules of the slow drift (`displacement.drift`), each tried alone on a copy:
- the Kendall-tau condition (`STEADY`), whole window and pieces: removed, S2 `c8fb838` (no figure changes).
- `DAYS`, the minimum day count: removed, S3 `466799f` (no figure changes).
- the step condition of `_whole`: kept. Without it, CLARIDEN Displacement correct 42 → 35 % (713 instants) and Total correct 41 → 36 %.
- the step condition of `_pieces`: kept. Without it, CLARIDEN correct 42 → 35 % and Total correct 41 → 30 %.
- the whole-window branch: kept. Without it, WILDSTRUBEL Displacement found 94 → 0 % (499 instants) and Total found 98 → 87 %.
- the pieces branch: kept. Without it, CLARIDEN found 100 → 0 % (1421 instants) and Total found 98 → 66 %.
- `HOURS`, the day coverage: kept. Without it, Total Displacement correct 41 → 38 % (745 instants).
- `SIZE` = `PIECE` (3.5, one constant less): kept. It gives WILDSTRUBEL found 94 → 0 % and Total found 98 → 87 %.
- `d and` (non-zero drift) in `_pieces`: no figure changes, but kept. It is the only guard against a piece of zero drift on a constant series (amplitude 0), such as corrections stuck at zero. See "For the user to decide".
## Before / after on the range
Events check, the only changed line:
```
< 2026-10-20T00:00Z → 2026-11-01T23:55Z Displacement kept | Slow drift | 2 sensors | absorbed: Slow drift 10-20T00:00
```
Range score, before → after:
- Displacement: found — → —; correct 0/2943 (0 %) → 0/27 (0 %)
- No data: 4/6, 4/4 (unchanged)
- Obstruction: 17/58, 17/486 (unchanged)
- Perturbation: 1/6, 1/426 (unchanged)
- Thermal displacement: 1342/1469, 1342/2611 (unchanged)
- Visibility: 817/1166, 817/875 (unchanged)
## Benchmark
```
NORDEND Displacement found 100 → 0 % (4 instants lost)
Total Displacement correct 18 → 41 %
0 regression(s); complexity: 611 code lines, 48 constants → 606 code lines, 46 constants
```
The NORDEND drop (4 instants, below the regression thresholds) is not a loss of detection. The one-measurement Displacement labels NORDEND-94, -250, -276 and -309 were counted as found only because PR16's whole-window Slow drift (1.0 amplitude) covered the whole 3 months. That is an event on another sensor, which the per-instant score counts.
## For the user to decide
- S1 sets the whole-window drift at 2 daily amplitudes. Untouched targets at 1.0 to 1.9 amplitudes are no longer flagged: 1001, 1010, 1012, 1016, 1018 of LENZSPITZE and PR16 of NORDEND, with no label on any of them. WILDSTRUBEL's PA3_2 (1.9) and PA_9 (1.6) drop out too, but PB2_2 (2.6) still covers WILDSTRUBEL-89. If the user reads a steady 1-to-2-amplitude creep over weeks as a Displacement ("keep watching it"), 1.5 would keep 1016 and the two WILDSTRUBEL PA drifts.
- LENZSPITZE-55 (LENZSPITZE, 10-28 11:00-14:05, Visibility, turbulence): the agitation is clear, but `error_value` does not rise against its calm. The detectors follow the families boundary ("the pose shaking without the error_value rising is not turbulence"), while the label calls it turbulence. Dropping the error criterion would need the user to change that boundary.
- The `d and` guard of `_pieces` is kept despite no figure change: it guards against the degenerate case of constant curves.
## Not fixed
- Target obscured during two consecutive mist nights (10-26 → 10-27, 9 sensors, ~115 instants of LENZSPITZE-101 and 181 of -42 flagged Obstruction). Tried two fixes. Counting only rejections shared by fewer than half of the sensors gave 4 regressions (NIEDERHORN, NORDEND, Total Obstruction found and correct). `MIN_DAYS` 2 → 3 gave 3 regressions (NIEDERHORN, WILDSTRUBEL, Total found). Target obscured is worth 1085 found instants elsewhere.
- Thermal displacement bounds on LENZSPITZE: the slide fallback bridges nights over 10 days. Narrowing its merge gap to 12 h or 6 h gave regressions (LENZSPITZE found 92 → 81/76 %, WYOMING 51 → 36/33 %, Total found −3/−4 points). Detecting a wave carried by a minority of targets (8/31 here) would change the station-level rule (`SHARE`, `R2_MIN`) for every station: not attempted in a small step.
- Multi-hour Perturbation events around the visibility episodes (single-target jumps back after hours, outside the detected Visibility bounds).
- Lasting shifts of one target inside visibility episodes (4 instants) and the 8012 reference shifts (LENZSPITZE-105, 106, 108): small.
## Limits
- LENZSPITZE-89, 94, 49, 50, 59, 63, 109, 110, 111, 112, 113, 115 (Obstruction, 10-23 13:30 to 11-01 05:15, short partial occultations), and LENZSPITZE-37, 99, 107 (Visibility, partial dimming): only the `flux` of the targets shows them. The `error_value` stays under `K_MAD`, and the targets are not rejected. The tools' `data.py` reads `flux` only for recent cameras (LENZSPITZE alone in the benchmark). A flux-drop rule would therefore serve one station, and on these one-measurement labels it would earn well under 1 point of the Obstruction Total. Seeing them on other stations needs flux, or the images.
- The report says no label of the range is wrong. It removed LENZSPITZE-53 and rewrote -66 (now -119), and the labels file already reflects both.
## Tools
- `sessions/LENZSPITZE_2026-10-23T2355_2026-11-01T1140_20261118T1049Z/tools/drift_days.py <detectors> <station> <from> <to> [targets]`: daily levels, amplitude, whole-window drift and pieces of the slow drift, per target and axis. Worth keeping.
- `.../tools/per_label.py <detectors> <station> <labels> <from> <to> [family]`: per label, instants found in its family and the families flagged instead. Worth keeping, as it is the per-label view the range score lacks.
- `.../tools/thermal_why.py <detectors> <station> <from> <to>`: why the thermal wave is accepted or rejected (reproducible axes, sine R²). Worth keeping.
- `.../tools/shimmer_hours.py <detectors> <station> <from> <to> <iso start> <iso end>`: per-hour heat-shimmer stats (agitated share, error ratio). Worth keeping.
- `.../tools/around.py <detectors> <station> <iso center> <minutes> <sensors>`: error_value (MAD, ratio), flux and corr of sensors around an instant. Worth keeping.
- `.../tools/jumps_in.py <detectors> <station> <from> <to> <iso start> <iso end>`: the jump episodes of `displacement` in an interval. Useful occasionally.
- `.../tools/drop_steady.py <detectors>`: the one-off edit of S2. Not worth keeping.
## Difficulties
- Variant copies in the temporary folder find the tools' `data.py` only through `cwd/tools/scripts`, so the copies' benchmarks were run from the optimizer root.
- The first variant edits of the "noobsc" and "own" copies failed, because a file has to be read before it is edited, so their first benchmark measured the unchanged state. They were rerun after the edits.
- The first variants were made with inline sed/heredoc edits on the temporary copies, not with scripts in `tools/`. Those copies are throwaway, and their diffs are described in this file.