Files
aimsight-labeling/auto/analyses/NEBRASKA_2026-10-13T0000_2026-10-22T0000/scripts/thermal_dev.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

33 lines
1.4 KiB
Python

"""Deviation of each target, in its own noise (ranges.py full-range noise),
from a reference level (median of chosen instants), over the instants of a label.
Reads the per-instant tables work/corr_x.txt, work/corr_y.txt written by table.py."""
import re, statistics, sys
D = sys.argv[1]
ref = sys.argv[2].split(',') # reference instants 'MM-DD HH:MM'
span = sys.argv[3].split('/') # 'MM-DD HH:MM/MM-DD HH:MM'
noise = {}
col = None
for line in open(f"{D}/work/requal/full.txt"):
if line.startswith('== corr_x'): col = 'corr_x'
elif line.startswith('== corr_y'): col = 'corr_y'
m = re.match(r'^(\S+)\s+52\s+\S+\s+(\S+)\s', line)
if col and m and not m.group(1).startswith('REF'):
noise[(col, m.group(1))] = float(m.group(2))
for c in ('corr_x', 'corr_y'):
rows = [l.rstrip('\n') for l in open(f"{D}/work/{c}.txt")]
head = rows[0].split()[1:13]
data = {}
for r in rows[1:]:
p = r.split()
if len(p) < 14: continue
t = p[0] + ' ' + p[1]
try: data[t] = [float(v) for v in p[2:14]]
except ValueError: pass
times = sorted(data)
sel = [t for t in times if span[0] <= t <= span[1]]
print(f"== {c} reference {ref}")
print('time ' + ' '.join(f"{h:>7}" for h in head))
lev = [statistics.median(data[t][i] for t in ref if t in data) for i in range(12)]
for t in sel:
print(t + ' ' + ' '.join(f"{(data[t][i]-lev[i])/noise[(c, head[i])]:7.1f}" for i in range(12)))