8.2 KiB
8.2 KiB
Modification
Verdict: changed Changed: scripts/ranges.py data.py: unchanged
What the analyst used
- Tools:
inventory.py,ranges.py --rolling 8,days.py(night levels, byhour),overview.py --rigid(29/09),summary.py(error_value, 1 h),plot.py,thumbnails.py,metrics.py. - Its own scripts, for a re-check of 94 existing labels against a "5 own noises" rule:
exceed.py: every target measurement more than K noises from its rolling level (the same computation asranges.py --rolling 8 --instants 1), plus the labels covering each instant (to find the uncovered ones) and per label, the largest deviation strictly inside with the number of instants beyond K. It was the backbone of the 42 removals and 12 additions.labeldev.py: the same per label, against the edge level as well (previous session).thermal.py,days_dev.py: per day, the deviation ofcorrfrom the night level at "clean" instants (no reference lost except one named sensor, outside brief labels), with the longest run beyond K.clipplot.py:corrin mm, 1st-99th percentile clipped, long labels shaded.build_labels.py: writes the file.
- What it missed: no tool relates the
corrdeviations to a labels file.quality.py --labels/--outsidedoes it only with the image quality metrics, which this station does not have. Its one documentation remark about the tools: measurement timestamps carry seconds, so comparing them with minute label bounds needs flooring.
Diagnosis
- Label check by
corrdeviation (the main task of a re-check, and of any search for forgotten labels on a station without quality metrics): no tool does it. Cause:ranges.pycomputes the deviations per instant but knows nothing of labels;quality.pyknows labels but only reads quality metrics. The analyst rewrote theranges.pycomputation inexceed.pyandlabeldev.pyjust to add the labels. - Seconds in the timestamps against minute label bounds: a script that compares them directly counts a measurement at a bound as inside. Same cause: no tool did the comparison, so each script had to deal with it.
- Day-by-day thermal deviation at clean instants (
thermal.py,days_dev.py): partly covered bydays.py --boundsand--smoothing. Excluding instants with a lost reference is general, but it needs a new mode fordays.py, and the "except R3" choice was specific to this station.
What I decided
ranges.py: changed (S1). New option--labels F. It does whatexceed.pydid, with the computationranges.pyalready has, so it works on any station.exceed.py,labeldev.py(analyst): not added as scripts.ranges.py --labelsreplacesexceed.py(rolling level).labeldev.py's edge level is close to--rollingwith a small N and was a secondary column.thermal.py,days_dev.py(analyst): left where they are.days.py --bounds --smoothingcovers the per-day deviation from the night level. The "clean instants" filter (no reference lost) would be a newdays.pymode, and this one range is not enough to design it: see "Not fixed".clipplot.py: left.plot.pypluscorr_x_mm/corr_y_mmcovers it. The percentile clipping did not block the analyst.GUIDE.md: left untouched, as the request requires (already modified by someone else). The guide text for the option is under "For the user to decide".- Removals: none.
What changed
- S1, commit
f5ff319in tools,scripts/ranges.py: new option--labels F(one JSON per line withstart,end,family, andidif present, numbered in file order). Docstring section 4 and usage line added.- With
--instants N, each instant line ends with| labels: <numbers>or| labels: none. - After that, a "Per label" table: number, id, start, end, family, and the number of measurement instants strictly inside (start < instant < end, instant floored to the minute). Then the largest deviation inside, from the level (rolling if
--rolling): sensor.column, signed in noises, instant. Last, the number of instants inside where a sensor is more than--knoises off. A label with no measurement inside says so. - Without
--labels, the output is byte-identical to before.
- With
Why
- A label re-check, or a search for forgotten labels on a station without quality metrics, asks two questions. What does each label hold beyond k noises? Which instants beyond k does no label cover?
ranges.pyalready computed the deviations but could not answer either, so the analyst re-implemented it. The option answers both from the existing computation (| grep 'labels: none'lists the uncovered instants). - A measurement is compared with the bounds on its minute, strictly inside. A point at a bound (the point before or after) is not counted inside, even if its timestamp carries seconds.
Checks
python3 tools/scripts/ranges.py data/WILDSTRUBEL --columns corr_x,corr_y --rolling 8 --instants 1 --sensors PB1_2,PB2_2,PB4,PB_5,PA2_2,PA3_2,PA_9 --labels labeling/auto/analyses/WILDSTRUBEL_2026-09-24T0230_2026-10-06T1945/work/existing.jsonl --start 2026-09-24T02:30Z --end 2026-10-06T19:45Z→work/tools/ranges-labels-existing.txt, 0.5 s.- It reproduces the analyst's
work/exceed.txt. Same two uncovered instants (24/09 02:30 PB2_2 cx+12; 03/10 05:00 PB1_2 cy+44). Same per-label maxima and counts, e.g. WILDSTRUBEL-94 PB4.cx +16.6, -96 PB1_2.cx +27.6, -87 +2.3, -115 +5.4, -120 to -127 identical. -111 (No data): no measurement inside.
- It reproduces the analyst's
- The same with
--min-measurements 6, no--instants, on the finallabels.jsonl(noid) →work/tools/ranges-labels-new.txt. The per-label table prints-for the id, exit 0. - No PNG (
ranges.pymakes none). python3 tools/scripts/quality.py --self-test: ok.- Without
--labels, the old and newranges.pygive byte-identical output on--rolling 8(the report's command) and on--columns corr_x,corr_y --rolling 8 --instants 2(with a fixedPYTHONHASHSEED, see "Not fixed").
Report commands rerun: 1 (ranges.py --rolling 8 on the range → work/ranges_roll8.txt), no failure.
For the user to decide
GUIDE.mdmust document the new option in the same change (toolsCLAUDE.md), but the request forbids touchingGUIDE.md, so the option is committed without its guide text. Proposed text to add to the guide (by whoever commitsGUIDE.md):- usage line of
ranges.py: add[--labels F]before[--sensors A,B]; - a bullet under
ranges: "--labels F(one JSON per line,start,end,family,idif any): each line of--instantsends with the numbers of the labels that cover the instant (labels: noneotherwise:| grep 'labels: none'lists the deviations no label holds); then, per label, the measurements strictly inside (start < instant < end, to the minute: a measurement at a bound is the point before or after), the largest deviation inside (sensor, column, noises, instant) and the number of instants beyond--k. To check a labels file against the curves:--columns corr_x,corr_y --rolling 8 --instants 1 --sensors <targets> --labels F."
- usage line of
- Inside means strictly inside, on the minute, following the analyst's reading of the bounds (a label goes from the point before to the point after).
quality.py --labelscounts the bounds as inside. I kept the two tools apart rather than changequality.py.
Not fixed
- Day-by-day deviation from the night level at "clean" instants, with the longest run beyond k (
thermal.py). It could become adays.py --boundsfilter: drop the instants where a retained reference is lost. That is a new mode, and this range alone does not settle which references to ignore (here, one always rejected by day). Wait for a second analysis that needs it. ranges.py --instants: the order of the "rejected" list changes from one run to the next (it is built from a set, and string hashing varies between runs). It existed before this change, and the values are unaffected. A one-line fix (iteratenamesthen references in order) if wanted.
Limits
none
Tools
none
Difficulties
- The request forbids committing or reverting
GUIDE.md, while the toolsCLAUDE.mdrequires a new option to enter the guide in the same change. I committed the script alone and gave the guide text above. - The output folder already held another session's files (
modification.md,validation.md,tools/). I only addedtools.mdandwork/.