Files
aimsight-labeling/auto/analyses/long-labels/NORDEND/scripts/rejections.py
T
maximeandClaude Opus 5.5 ddb17c2189 auto: labels requalified under the 5-noise rules (only what stands out from the noise): 32 analyses refined, the 6 paused periods verified, the long labels requalified with the fixes the period analysts found; 1153 -> 961 labels
- 32 analyses: each label kept, rewritten or removed by its analyst (section Requalification of the report; mm magnitudes where the targets have them)
- SNCF01 x3, WILDSTRUBEL 2026-09-01 -> 2026-10-06 x3: verified from their existing labels under the new rules
- long labels (no analysis): auto/analyses/long-labels/<STATION>/; NORDEND-169 and -195 run to 07/11, so NORDEND-283 and -284 (their continuation) are removed
- reading-rules.md, stations.md: the citations of removed or rewritten labels point to their successor, or to [expert]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 23:58:00 +01:00

20 lines
833 B
Python

"""Rejection rate of a sensor over a window, overall and per day: python3 rejections.py FOLDER SENSOR START END."""
import sys
from collections import defaultdict
sys.path.insert(0, "tools/scripts")
import data # noqa: E402
folder, sensor, start, end = sys.argv[1:5]
ms = data.filter_window(data.load(folder)[sensor], data.parse_time(start), data.parse_time(end))
days = defaultdict(lambda: [0, 0])
for m in ms:
d = days[m["t"].strftime("%m-%d")]
d[0] += 1
d[1] += data.rejected(m)
tot = sum(v[0] for v in days.values())
rej = sum(v[1] for v in days.values())
print(f"{sensor} {start} -> {end}: {rej}/{tot} rejected ({100 * rej / max(tot, 1):.0f} %), "
f"days with a rejection {sum(1 for v in days.values() if v[1])}/{len(days)}")
print(" ".join(f"{k}:{100 * v[1] / v[0]:.0f}" for k, v in sorted(days.items())))