sessions of 2026-11-18 (the optimization campaign; three runs without summary, interrupted and rerun)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a81c53cd9
commit
0cfbd1b7bc
363 files changed
+30822
No files matched your search
@@ -0,0 +1,79 @@
|
||||
# Modification
|
||||
|
||||
**Verdict**: changed
|
||||
**Changed**: scripts/ranges.py
|
||||
**data.py**: unchanged
|
||||
|
||||
## What the analyst used
|
||||
|
||||
- Tools: `ranges.py` (`--k 5 --rolling 8`, `--instants 1`, `--min-measurements 4` on the weak thermal days), `inventory.py` (distances, mm per px), labeling's `validate.py`. In the verification before this one: `overview.py`, `summary.py`, `metrics.py`, `stations.py`, `quality.py`, `thumbnails.py`, `plot.py`, `gif.py`.
|
||||
- Its own scripts: `requalify.py` and `thermal_nights.py` (this pass), `thermal_days.py` and `scan.py` (the verification). Three of the four do the same thing: they measure a long (thermal, daily) label per target as the hourly median of `corr` minus the level of the hours before the label, in the target's own noise, and they leave out the instants of the other, shorter labels inside it.
|
||||
- What it missed: `ranges.py --labels` already gives, per label, the "size" (the extreme inside measured from the level before, in noises), but for a long label that size comes from the largest single-measurement jump or the short event nested inside it (a cobweb night, a lost reference), not from the slow cycle. The level before can also fall under another event. So the analyst wrote its scripts. `scan.py` duplicates `ranges.py --rolling 4 --instants 1 --labels` and needs nothing new.
|
||||
|
||||
## Diagnosis
|
||||
|
||||
- Long labels (thermal cycles): the size from `ranges.py --labels` is the largest native-step deviation inside the label. Short jumps and short labelled events inside the label set it: in this range, every thermal label came out at 12 to 64 noises, from a cobweb or a lost reference, even where the cycle itself stays under 5. Cause: in `ranges.py`, the label-size block has no smoothing and no way to leave out other labels.
|
||||
- Level before a label that sits under another event: the same block takes the median of `--margin` before the start, even when another label covers that time. Same cause.
|
||||
|
||||
## What I decided
|
||||
|
||||
- `ranges.py`: changed (S1, a9948d3). Two options of `--labels`, for the size block only: `--smoothing N` (each measurement inside is the median of the N centred on it, the same meaning as in `days.py`) and `--shorter-out` (leaves out, before, inside and after, the measurements inside the shorter labels of the file that overlap the label). The default output is unchanged byte for byte.
|
||||
- `requalify.py`, `thermal_nights.py`, `thermal_days.py`: not added as tools. They are fixed to this station (hard-coded sensors and paths), and the new options of `ranges.py` now cover what they measured.
|
||||
- `scan.py`: left. `ranges.py --rolling N --instants 1 --labels F` already shows the same.
|
||||
- `GUIDE.md`: left untouched, as the request requires (it was already modified). The target's rules want a new option in the guide in the same change. The text is proposed below for the user.
|
||||
|
||||
## What changed
|
||||
|
||||
- S1, a9948d3, `scripts/ranges.py`: two new arguments, `--smoothing N` (default 1, i.e. none) and `--shorter-out` (flag, off by default). Both act only in the per-label "size" rows of `--labels` (extreme inside from the level before, net, `>k`). The per-label head line and every other output are unchanged.
|
||||
- With `--shorter-out`, the measurements inside any label of the file that is shorter than the label being measured and overlaps it (`start < end of label` and `end > start of label`) are dropped from before, inside and after. A label that only touches it, such as the previous day's label, is not dropped.
|
||||
- With `--smoothing N`, each measurement inside becomes the median of the N measurements centred on it, taken from the kept series.
|
||||
- The header line says which options are on. The docstring and usage line describe both options.
|
||||
|
||||
## Why
|
||||
|
||||
- A long label was sized by whatever short event fell inside it, so the tool could not say whether a slow daily cycle stands out from the noise. Smoothing removes the one-point jumps, and leaving out the shorter labels removes the events that are already labelled on their own.
|
||||
- When the margin before a label fell under another labelled event, its level was that event's level. Leaving out the shorter overlapping labels keeps only clean measurements. If none are left, the label gets no size rows, as before when there was no measurement before it.
|
||||
|
||||
## Checks
|
||||
|
||||
Trial commands (from aimsight-optimizer; outputs in `sessions/NORDEND_2026-08-23T0515_2026-09-04T0615_20261118T1542Z/work/tools/`, text only, `ranges.py` draws no PNG):
|
||||
- `python3 tools/scripts/ranges.py data/NORDEND --columns corr_x,corr_y --k 5 --margin 3h --top 3 --labels <analysis>/work/requalify_input.jsonl --sensors CTR01,PR01,…,PR18 (no PR04) --start 2026-08-23T02:15Z --end 2026-09-04T09:15Z`: run before (`before_labels.txt`) and after the change (`after_default.txt`); `cmp` says identical.
|
||||
- The same with `--smoothing 5 --shorter-out` (`after_options.txt`). The largest size per thermal label, before → after (noises):
|
||||
- NORDEND-51: 17.5 → 17.5
|
||||
- NORDEND-52: 22.7 → 22.7
|
||||
- NORDEND-55: 10.9 → 13.0
|
||||
- NORDEND-56: 11.4 → 11.4
|
||||
- NORDEND-246: 12.5 → 14.4
|
||||
- NORDEND-248: 65.9 → no level before (the cobweb label covers the 3 h before it)
|
||||
- NORDEND-68: 12.5 → 12.4
|
||||
- NORDEND-72: 13.5 → 5.8
|
||||
- NORDEND-74: 5.2 → 5.2
|
||||
- NORDEND-78: 9.5 → 9.5
|
||||
- NORDEND-81: 13.6 → 13.9
|
||||
- NORDEND-83: 17.8 → 4.6
|
||||
|
||||
These match the analyst's own scripts to within a few tenths (72: 5.9, 74: 5.3, 83: 4.6, 51: 17.8, 52: 23.0), without its station-specific code.
|
||||
- `python3 tools/scripts/quality.py --self-test`: ok.
|
||||
|
||||
Report commands rerun: 3 (`ranges.py --rolling 8`, the same with `--instants 1`, `--min-measurements 4` on 28/08; outputs in `work/`), no failure. The values are the same as the analyst's files (`diff -w`). Only the spacing of the header changed, from an earlier commit.
|
||||
|
||||
## For the user to decide
|
||||
|
||||
- Add to `GUIDE.md`, section ranges: put `[--smoothing N] [--shorter-out]` after `[--top 5]` in the usage line, and add at the end of the `--labels` bullet: "For a long label (a daily cycle), add `--smoothing 5 --shorter-out` and a `--margin` of a calm hour or three before it: the size is then read on the median of 5 measurements, without the shorter labels that overlap it (before, inside, after), so neither a one-point jump nor a short event inside it, nor one under its level before, sizes it. Without them for the short labels: smoothing erases a label of one or two measurements." I did not add it because the request forbids touching the already-modified `GUIDE.md`.
|
||||
- The meaning of "shorter": a label is left out if it is shorter than the one being measured and overlaps it. Another reading would leave out only labels of another family. I chose duration so that no family name is written into the tool.
|
||||
|
||||
## Not fixed
|
||||
|
||||
- The analyst's choice of the reference night when the night before is under another event (28/08: it used the nights on either side). The tool now gives no size rows in that case. A night after can be read with `days.py`; a "level after" option for the size was not added, because one case is not enough.
|
||||
|
||||
## Limits
|
||||
|
||||
none
|
||||
|
||||
## Tools
|
||||
|
||||
none
|
||||
|
||||
## Difficulties
|
||||
|
||||
- The request forbids committing or reverting `GUIDE.md`, while the target's `CLAUDE.md` wants a new option in the guide in the same change. I documented the options in the script's docstring and `--help` and put the guide text above for the user.
|
||||
Reference in new issue
Block a user