7.2 KiB
7.2 KiB
Modification
Verdict: changed Changed: scripts/ranges.py data.py: unchanged
What the analyst used
- Tools:
ranges.py(--k 5 --outside, plain and--rolling 12),inventory.py, anddata.loadimported directly by its scripts. Earlier in the reading it also usedoverview.py,days.py --bounds,quality.py,plot.pyandthumbnails.py. - Its scripts:
requalify.pyrunsranges.pyonce per label (100 runs, each on a window around the label with the noise taken outside it) and parses the range tables.neighbours.pytakes the rolling deviation at a label's instant and counts how many instants in a window around reach at least as far.thermal.pytakes the hourly median of corr inside each thermal label against the night before.bounds.py,scan.py,win.pyandbuild.pyare left over from the earlier reading and only served this range. - What got in its way: 100 runs of
ranges.pytook more than ten minutes. Each run reads the whole station (about 5 s here), whatever--start/--endsay. Also, whether a one-measurement event counts as "beyond 5 noises" depended on the window the noise was computed over (LENZSPITZE-81 at 4.8 against 82 at 5.7). To settle it, the analyst wroteneighbours.py: does the instant stand out from the instants around it?
Diagnosis
- Measuring a set of labels:
ranges.py --labelsalready measures every label in one run (12 s for the whole week here), but its per-label line only gives the largest deviation in noises of the whole window. It does not say whether that deviation stands out from the surroundings of the label. That is why the analyst fell back on one--outsiderun per label plusneighbours.py. Cause: the--labelssection ofranges.pylacks a measure that does not depend on the noise scale. - The noise-window ambiguity (81 against 82): a count of the measurements around that reach as far is the same whatever window the noise comes from. Adding that count to the per-label line removes the dependence.
- The slow loop: the cost is
data.loadreading all files. Fixing that would mean touchingdata.py, which is allowed only for a reading error. With the count above, one--labelsrun replaces the loop. thermal.py(night level against hourly median):days.pyalready gives night levels and the day cycle. Not needed.
What I decided
ranges.py: changed (S1, commit e03d911). In the--labelssection, each label's line ends withas far around: n/m, where m is the number of measurements of the same sensor-column within--marginbefore the start and after the end (outside the label), and n is how many of them deviate from the level at least as much as the largest deviation inside. This isneighbours.pymade general, inside an existing option, as values with no threshold. Existing options and outputs are unchanged.neighbours.py: not added as a script, superseded by the option above.requalify.py: not added. Once the count exists, the loop is oneranges.py --labels F --rolling 12 --margin 3hrun.thermal.py,bounds.py,scan.py,win.py,build.py: left in the analysis. They are specific to this range or covered bydays.py,ranges.py --labelsandquality.py.- No removal.
What changed
- S1, e03d911,
scripts/ranges.py: in the per-label line of--labels, afterinstants > k, a new columnas far around(n/m) for the sensor-column of the largest deviation inside. It follows the same level (window median, or rolling with--rolling) and covers the measurements within--marginon both sides, outside the label. The heading lines and the docstring (item 4) explain it. Nothing else changes.
Why
- A brief label's deviation in "noises" depends on the window the noise comes from, so a label near the threshold falls on one side or the other depending on the window. The count of measurements around that reach as far does not depend on that scale. It tells an instant that stands out from a sensor that already moves that much around it, and it comes in the same single run that measures all the labels.
Checks
python3 tools/scripts/ranges.py data/LENZSPITZE --columns corr_x,corr_y --k 5 --rolling 12 --labels labeling/auto/analyses/LENZSPITZE_2026-10-16T0235_2026-10-23T2355/work/requalify_input.jsonl --margin 3h --start 2026-10-15T20:00Z --end 2026-10-24T06:00Z: 12 s for the 50 labels. Before:work/tools/ranges-labels-before.txt. After:work/tools/ranges-labels-after.txt. The only differences are the per-label heading and the new column, for example:- LENZSPITZE-79: 1013.cy −7.5, as far around 0/75
- LENZSPITZE-81: 8002.cx +6.0, 1/74
- LENZSPITZE-82: 8017.cy −5.0, 0/77
- LENZSPITZE-85: 102H.cy −15.8, 0/75
- LENZSPITZE-88: 1003.cx +4.1, 25/75
- On the same command, the old
ranges.py(HEAD before S1) and the new one give byte-identical output outside--labels. python3 tools/scripts/quality.py --self-test: ok.- No PNG:
ranges.pywrites none. - Report commands rerun: 3 (
requalify.py … plain,requalify.py … 12,ranges.py … --k 3 --rolling 12 … --outside 2026-10-19T12:55Z/2026-10-19T13:05Z), outputs inwork/. No failure.- The two requalify outputs differ from the analysis's files in a few counts (for example, targets>5 31 → 30 on LENZSPITZE-1). The cause is commits to the tools made after the analysis, not S1: the old and new
ranges.pygive identical output on these commands. - The background job showed as "failed" only because
diffexits 1 when files differ.
- The two requalify outputs differ from the analysis's files in a few counts (for example, targets>5 31 → 30 on LENZSPITZE-1). The cause is commits to the tools made after the analysis, not S1: the old and new
For the user to decide
- GUIDE.md was not touched, because the request says to neither commit nor revert it, but
CLAUDE.mdwants a new output in the guide in the same change. Two sentences are proposed for the--labelsbullet of### ranges:- "the line of each label ends with
as far aroundn/m: of the m measurements of that sensor-column within--marginaround the label, n reach at least as far (it does not depend on the window the noise comes from: a brief label near the threshold is read with it)." - "To measure all the labels of a range, one run with
--labelsover the range widened by--margin(each run reads the whole station), not one run per label."
- "the line of each label ends with
- The count is given for the largest sensor-column only, not for each of the
--toprows. Those rows measure against the level before the label, and a count against a different level would be confusing.
Not fixed
- The time to read the station on each run (about 5 s per run here, whatever the window):
data.loadreads every file. Restricting it to a window would mean changingdata.py, which the rules allow only for a reading error. - The rule for which window the noise is computed over is a labelling rule (labeling-rules.md), outside the tools.
Limits
none
Tools
none. No script written. The edit was applied once with an inline Python replacement, then with Edit.
Difficulties
- The request forbids committing GUIDE.md (already modified), while the target's
CLAUDE.mdwants the guide updated in the same change. I followed the narrower request and put the guide sentences under "For the user to decide". ranges.pyhas no--out, so the trial outputs are text files inwork/tools/.- My first edit of
ranges.pywas an inline Python heredoc rather than the Edit tool. It made no other change.