Files
aimsight-optimizer/sessions/FLORIDA_2026-10-11T0945_2026-10-22T0315_20261118T1300Z/modification.md
T

116 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
FLORIDA, 2026-10-11 → 2026-10-23 (UTC; labels from 2026-10-11T09:45Z), cadence 15 min, 6 targets and 2 references (p1_r, r1_r). Sellette 3 and Pont Ernen are the twins of p1_r and r1_r.
Range score before (instants):
| Family | labelled | found | flagged | wrongly |
|---|---|---|---|---|
| Displacement | 1 | 0 | 2 | 2 |
| No data | 13 | 13 | 15 | 2 |
| Obstruction | 9 | 0 | 156 | 156 |
| Perturbation | 0 | — | 253 | 253 |
| Target issue | 1095 | 1095 | 1095 | 0 |
| Thermal displacement | 327 | 319 | 799 | 480 |
| Visibility | 154 | 138 | 138 | 0 |
- **Extra, Perturbation (main defect, 80 of 100 Perturbation events, plus 2 extra Displacements)**: single-target "Sudden jump, back to normal" on Sellette 3 and/or Pont Ernen, all over the range, and two "Jump, not back yet" on them on 22/10 (14:15, 23:45). These two targets share their prism with a reference, so their corr is nearly as still as a reference's. Their noise (median step) is 0.0002 to 0.0004 px, which is 1 to 2 % of the station's other targets. Over the whole benchmark the next quietest target sits at 25 %, and almost all at 50 % or more. `displacement._jumps` sets the threshold at K = 20 times the series' own noise, so for these twins a step of 0.005 px, far below the other targets' noise, counts as a jump. Fixed by S1.
- **Correct**: FLORIDA-1 and FLORIDA-14 (Target issue: Sellette 6 and Massif 2, Degraded target). FLORIDA-27, -29, -32, -34, -35, -40 and -42 (No data). FLORIDA-34 and -35 are merged into one event, and the 2 wrongly flagged instants are the measurement between them, which is fine.
- **Correct, bounds a few measurements off**: FLORIDA-37, -39 and -45 (Visibility, poor visibility). They are found as Poor visibility. The 16 missed instants are the edges and the gap between the two events of 20/10 (18:45 → 20:15).
- **Found, too wide**: FLORIDA-24, -25, -26, -28, -31, -41 and -44 (Thermal displacement). `thermal_displacement` finds no cycle on the corrected curves, so it falls back to the raw x, y wave ("Camera thermal expansion" 09:00–14:00 and "contraction" 14:00–02:00, every day). The contraction runs about 4 h past the labels' evening ends. The waves of 16, 17 and 18/10 are flagged too, but the report says the correction absorbs them there, so they have no label. That gives 480 wrongly flagged instants. Not fixed (see "Not fixed").
- **Wrong family, Obstruction labels read as Perturbation**: FLORIDA-74, -75, -76 and -78 (p1_r measured off at night on 12/10). The detectors give them a Perturbation of all targets (the targets-together series) at 00:45, 02:00, 04:00 and 22:30. FLORIDA-77 (06:30) is missed because the jump is under K_TOGETHER. Only the images show the cause (the bright point next to p1_r). Without that cause, Perturbation is the reading that the families' boundary allows, so this is an alternative reading, in "Limits".
- **Wrong family, Visibility read as Obstruction or Perturbation**: FLORIDA-23 (11/10 10:00, r1_r rejected for one measurement) is read as a Perturbation of all targets plus a "Brief obstruction" on r1_r. The rejections of the references and their twins during FLORIDA-39 and -45 (19/10 00:15, 21/10 03:30 to 18:15) and at the start of FLORIDA-48 (22/10 11:30 to 13:15) are "Brief obstruction" events from the rejected-sensor branch of `visibility`. Not fixed (V1 below).
- **Extra, Obstruction, Target obscured**: Sellette 5 (20/10 05:30 → 21/10 15:45) and Sellette 4 (20/10 15:30 → 21/10 16:30). They are rejected during the long poor visibility FLORIDA-45, and `target_issue` counts those weather rejections as their own. Not fixed (V2 below).
- **Extra, remaining Perturbation (22 events, 24 instants after S1)**: jumps of the targets together that come back at the next measurement. Four are the p1_r events above. The others have no label, such as 18/10 10:30, near the two Sellette 4 spikes that the report leaves for a later analysis. One more is a Pont Ernen jump on 22/10 12:45 inside FLORIDA-48 (Visibility).
- **Missed, Displacement**: FLORIDA-46 (Sellette 4, small lasting step on 22/10 03:30). The step is far under K = 20 noises.
- The 5 labels that the report removes (FLORIDA-30, -33, -36, -38, -43) are not in the labels file. That is consistent.
## What changed
- **S1, commit 3c2189b** (`scripts/displacement.py`, `thresholds.md`): new constant `FLOOR = 0.1`. In `jumps()`, the floor is computed per axis as FLOOR × the median noise of the station's targets. `_jumps()` gets a `floor` argument and uses `max(noise(v), floor)` as the noise of each target's series. The targets-together series keeps its own noise and K_TOGETHER, with no floor. The docstring (rule 1) is updated and the `FLOOR` line is added to `thresholds.md`.
## Why
- A target whose prism is also a reference has almost no noise of its own. A threshold tied only to its own noise then flags steps far smaller than any other target's noise, as jumps that come back (Perturbation) or that stay (Displacement). With a floor tied to the station's typical target noise, such a target needs a step of at least 2 typical noises (20 × 0.1). Targets with ordinary noise do not change: none of them falls under 0.1 of the median anywhere in the benchmark.
## Checks
- events: 150 → 70 lines. 103 lines removed, 23 added. The removed lines are all the single-target twin Perturbations and the 2 Displacements. The added lines are the targets-together Perturbations, which are now single instants because no twin jump merges with them any more, and the Visibility events whose absorbed twin jumps are gone. No `skipped` line.
- sensors: the twin-only Perturbations are gone. The 18/10 05:15 Visibility event loses Pont Ernen (a twin jump it had absorbed). The Displacements on Pont Ernen and Sellette 3 on 22/10 are gone.
- range: Perturbation flagged 253 → 24 (all wrong), Displacement flagged 2 → 0. Other families unchanged.
- benchmark (compare before → S1): FLORIDA Perturbation correct 1 → 2 %, Total Perturbation correct 3 → 4 % (2.5 → 4.1 %, 714 fewer wrongly flagged instants). FLORIDA Perturbation found 36 → 9 % and Total Perturbation found 10 → 9 % (6 instants, flagged REGRESSION by compare): see "For the user to decide". Complexity 606 → 610 code lines, 46 → 47 constants.
## Pruning
Rules of `displacement.py` (the detector S1 touched), each removed on a copy and compared with benchmark-S1 (outputs `try-P*.txt`):
- the targets-together series (K_TOGETHER): kept. Its removal regresses Total Perturbation found 9 → 4 % and correct 4 → 2 %.
- the together jump required to be one measurement out and back (`a == b`): kept. Its removal regresses Total Perturbation correct 4 → 2 % and WYOMING Perturbation correct 57 → 24 %.
- `BASE` 4 → 1: kept. Total Perturbation correct 4 → 3 %, WYOMING 57 → 11 %.
- `RETREAT` check of the whole-window drift: kept. Total Displacement correct 58 → 41 %.
- drift pieces (`PIECE`, `_pieces`): kept. Total Displacement found 98 → 66 %, CLARIDEN and MICHIGAN 100 → 0 %.
- step check of the whole-window drift: kept. Total Displacement correct 58 → 48 %, CLARIDEN 44 → 35 %.
- `HOURS` (days measured enough): kept. Total Displacement correct 58 → 56 % (316 instants, WILDSTRUBEL).
- `BACK_H` ("Jump, not back yet" merged into "Lasting shift"): no regression, but **not committed**. The benchmark scores families, not varieties, so it cannot see this change. The removal would erase a variety that `labeling/families.md` documents with its own advice to the client, and that file is outside this session's scope. See "For the user to decide".
- `FLOOR` (S1 itself): its removal is the state before, which loses 1.6 points of Total Perturbation correct.
## Before / after on the range
Events check: the 80 Perturbation events on Sellette 3 / Pont Ernen alone and the two Displacement lines are gone, for example:
- `2026-10-11T00:30Z → 2026-10-11T01:00Z Perturbation greyed | Sudden jump, back to normal | 1 sensors` → removed
- `2026-10-22T14:15Z → 2026-10-22T14:15Z Displacement kept | Jump, not back yet | 1 sensors` → removed
- `2026-10-22T23:45Z → 2026-10-22T23:45Z Displacement kept | Jump, not back yet | 1 sensors` → removed
- `2026-10-12T03:15Z → 2026-10-12T04:45Z Perturbation | 6 sensors` → `2026-10-12T04:00Z → 2026-10-12T04:00Z Perturbation | 6 sensors` (the targets-together jump without the twin jumps merged around it)
Range score, per family, found / correct:
- Displacement: 0/1 / 0/2 → 0/1 / —
- Perturbation: — / 0/253 → — / 0/24
- No data 13/13 / 13/15, Obstruction 0/9 / 0/156, Target issue 1095/1095 / 1095/1095, Thermal displacement 319/327 / 319/799, Visibility 138/154 / 138/138: unchanged
## Benchmark
```
FLORIDA Perturbation found 36 → 9 % (6 instants lost)
FLORIDA Perturbation correct 1 → 2 %
REGRESSION Total Perturbation found 10 → 9 % (6 instants lost)
Total Perturbation correct 3 → 4 %
1 regression(s); complexity: 606 code lines, 46 constants → 610 code lines, 47 constants
```
## For the user to decide
- The 6 Perturbation instants lost (the compare REGRESSION line) all belong to FLORIDA-18 (FLORIDA, 2026-10-09 08:00 → 13:30, Perturbation: a level change of Sellette 4 and Sellette 5 after rain). Before S1 they were counted as found only through the twins' sub-noise jumps: a Pont Ernen / Sellette 3 jump at 08:45 merged into the 08:45 → 10:00 event, and a Pont Ernen jump at 12:00. Neither of those sensors is named by the label. Under CLAUDE.md ("an instant counted as found by an event on another sensor") this is not a regression. The targets-together jump at 10:00 is still found.
- `BACK_H` could be removed without any change to the benchmark. I did not remove it, because it would delete the "Jump, not back yet" variety documented in `labeling/families.md`.
## Not fixed
- Brief obstruction on rejected references (r1_r, p1_r, with their twins) where the labels say Visibility: FLORIDA-23, and parts of FLORIDA-39, -45 and -48. I tried V1 (a rejected sensor set that includes a reference becomes Poor visibility "reduced"). FLORIDA Visibility found went 70 → 82 %, but it regressed Total Obstruction found 40 → 36 % and WILDSTRUBEL Obstruction found 35 → 24 % (`try-V1.txt`). The error_value / threshold ratio of rejected references does not separate the two cases either: FLORIDA Visibility median 1.23, WILDSTRUBEL Obstruction 1.30 to 1.39 (`tools/refratio.py`).
- Target obscured of Sellette 4 and 5 during FLORIDA-45. I tried V2 (a rejection shared with at least half of the other sensors does not count in `target_issue`). FLORIDA did not change at all, because their rejections are only partly shared, and it regressed NIEDERHORN Obstruction correct 38 → 31 % and Total Obstruction found (`try-V2.txt`).
- Thermal displacement too wide (contraction until 02:00) and on the days the compensation absorbs (16 to 18/10). The camera branch reads the raw wave, which is there every day. Telling which days the corrected curves keep it would take a new per-day rule on the corr, and this sample cannot show that it would earn its place.
- FLORIDA-46 (a small lasting step of Sellette 4): under K = 20 noises. Lowering K is ruled out by E-001 (healthy targets greyed at 15).
## Limits
- FLORIDA-74 (2026-10-12T00:30Z → 01:00Z), -75 (01:45 → 03:00), -76 (03:45 → 04:30), -77 (06:15 → 06:45) and -78 (22:15 → 22:45), Obstruction. The p1_r position is off, and only the images (a small bright point next to p1_r) give the cause. From the measurements the detectors read a Perturbation of all the targets, which is the boundary's reading without an established cause. Telling them apart would need the images.
- FLORIDA-23 (2026-10-11T09:45Z → 10:15Z, Visibility). Whether something passed in front of r1_r or it was just at its threshold is seen only on the images.
- The report says no label is wrong. It leaves the two Sellette 4 spikes of 18/10 (10:15, 10:30) unlabelled, pending a later analysis. A detector Perturbation at 10:30 falls there.
## Tools
- `sessions/FLORIDA_2026-10-11T0945_2026-10-22T0315_20261118T1300Z/tools/series.py <station> <from> <to> [sensor ...]`: noise, MAD and range of corr_x and corr_y per sensor, and optionally a sensor's series. Worth keeping.
- `.../tools/noises.py <data folder> [STATION ...]`: each target's noise relative to the station's median target noise, lowest first. It is the evidence for FLOOR. Worth keeping.
- `.../tools/shared.py <station> <from> <to> <sensor>`: histogram of how many other sensors are rejected when a given sensor is rejected. Occasional use.
- `.../tools/refratio.py <data> <labels> STATION ...`: error_value / threshold of rejected references, grouped by the family of the covering label. Occasional use.
- `.../tools/patch.py <file> <old> <new>`: replaces one unique exact string. A helper for variants.
- `.../tools/variant.sh <workdir> <name> <file> <old> <new> ...`: copies the detectors at HEAD, applies the patches and runs the copy's benchmark. Worth keeping for pruning.
## Difficulties
- My first S1 edit had a syntax error, and the benchmark showed no `skipped` line in the part I looked at (I only read the tail). I caught it because Perturbation dropped to 0, fixed it and re-ran the full benchmark. benchmark-S1.txt is from the committed code.
- In the working copies, `compare` reports 611 code lines where HEAD has 610, even for a removal. The copies probably count one more line somewhere. The regressions were read from the figures, not from the complexity.