- Every station's auto labels reviewed by an analyst (/review-auto-labels), then a cross-review per family across all stations (new skill /cross-review-labels), a finishing pass, and descriptions rewritten in words (no numeric values). - The three never-labeled ranges (WILDSTRUBEL 07/09-01/10, NORDEND 16/08-01/10) labeled and reviewed: 991 auto labels on 11 stations, labeling/controle.py at 0 errors. - Labeling knowledge gathered in labeling/: regles-d-etiquetage.md (new), familles.md (settled boundaries), connaissances/ (notes moved from docs/, links updated), the label map rebuilt from reviewed labels, events and cases; events tied to their stations (PS_DES_COUDRES is JUNGFRAU). The labeler and reviewers read only labeling/. - labels-map reads auto labels and events; decision D-130; living plan points 73-75. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
3.0 KiB
Python
52 lines
3.0 KiB
Python
"""La référence R3, jour par jour : mesures, rejetées, part rejetée de jour (05:00-15:00) et de nuit (18:00-03:00),
|
|
premier et dernier rejet du jour (hors nuit), error_value médiane de jour et de nuit face à son seuil, retenue
|
|
(inlier 1) quand acceptée ; puis, à chaque entrée et sortie de R3 dans la compensation (acceptée ↔ rejetée,
|
|
de jour), le saut médian des corr des cibles acceptées aux deux mesures, en bruits propres de chaque cible,
|
|
face au saut médian des autres pas du jour. Usage : r3.py"""
|
|
import sys, statistics as st
|
|
from collections import defaultdict
|
|
sys.path.insert(0, sys.path[0])
|
|
from donnees import mesures, temperature
|
|
|
|
M = mesures()
|
|
T = temperature()
|
|
CIB = ('PA2_2', 'PA3_2', 'PA_9', 'PB1_2', 'PB2_2', 'PB4', 'PB_5')
|
|
temps = sorted({t for t, _ in M})
|
|
rej = lambda t, c: (t, c) in M and float(M[(t, c)]['error_value']) > float(M[(t, c)]['error_threshold'])
|
|
val = lambda t, c, k: float(M[(t, c)][k]) if (t, c) in M and M[(t, c)][k] and not rej(t, c) else None
|
|
bruit = {}
|
|
for c in CIB:
|
|
for k in ('corr_x', 'corr_y'):
|
|
s = [val(t, c, k) for t in temps]
|
|
s = [x for x in s if x is not None]
|
|
bruit[c, k] = st.median(abs(b - a) for a, b in zip(s, s[1:]))
|
|
par = defaultdict(list)
|
|
for t in temps:
|
|
if (t, 'R3') in M:
|
|
par[t.date()].append(t)
|
|
seuil = float(M[(temps[0], 'R3')]['error_threshold'])
|
|
print(f'seuil de R3 : {seuil}')
|
|
print('jour n rej jour% nuit% 1er rejet dernier ev_jour ev_nuit temp.max sauts entrée/sortie (médiane des cibles, bruits) | sauts habituels')
|
|
for d, ts in sorted(par.items()):
|
|
jr = [t for t in ts if 5 <= t.hour < 15]; nt = [t for t in ts if t.hour >= 18 or t.hour < 3]
|
|
rj = [t for t in ts if rej(t, 'R3')]
|
|
rjj = [t for t in rj if 3 <= t.hour < 18]
|
|
evj = st.median(float(M[(t, 'R3')]['error_value']) for t in jr) if jr else float('nan')
|
|
evn = st.median(float(M[(t, 'R3')]['error_value']) for t in nt) if nt else float('nan')
|
|
sauts, hab = [], []
|
|
for a, b in zip(ts, ts[1:]):
|
|
if not (5 <= a.hour < 17) or (b - a).total_seconds() > 1800:
|
|
continue
|
|
s = [abs(val(b, c, k) - val(a, c, k)) / bruit[c, k] for c in CIB for k in ('corr_x', 'corr_y')
|
|
if val(a, c, k) is not None and val(b, c, k) is not None]
|
|
if not s:
|
|
continue
|
|
(sauts if rej(a, 'R3') != rej(b, 'R3') else hab).append((b, st.median(s)))
|
|
tm = max((v for t, v in T.items() if t.date() == d), default=float('nan'))
|
|
pj = 100 * sum(rej(t, 'R3') for t in jr) / len(jr) if jr else float('nan')
|
|
pn = 100 * sum(rej(t, 'R3') for t in nt) / len(nt) if nt else float('nan')
|
|
print(f'{d:%d/%m} {len(ts):3} {len(rj):4} {pj:4.0f} {pn:4.0f} {rjj[0]:%H:%M}' if rjj else f'{d:%d/%m} {len(ts):3} {len(rj):4} {pj:4.0f} {pn:4.0f} - ', end='')
|
|
print(f' {rjj[-1]:%H:%M}' if rjj else ' ', end='')
|
|
print(f' {evj:.2f} {evn:.2f} {tm:5.1f} ' + ' '.join(f'{t:%H:%M}:{v:.1f}' for t, v in sauts) +
|
|
(f' | {st.median(v for _, v in hab):.1f}' if hab else ''))
|