Files
Support-Agent/labeling/auto/revue-croisee/2026-11-04/target-issue/outils/jour_nuit.py
T
maximeandClaude Opus 5.5 35b5ed4d74 Auto labels reviewed per station and cross-reviewed; all labeling knowledge in labeling/ (D-130)
- 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>
2026-11-05 08:21:57 +01:00

22 lines
1.4 KiB
Python

"""Écart de jour d'une cible : par jour, médiane de corr_x et corr_y aux heures de jour (H1-H2 UTC) moins celle de la nuit d'avant (00-03 UTC), et médiane de error_value / seuil de jour.
Usage : python3 jour_nuit.py STATION H1 H2 CAPTEUR [CAPTEUR...] (mesures acceptées seulement)."""
import csv, glob, re, sys, collections, statistics as S
st, h1, h2, caps = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), sys.argv[4:]
v = collections.defaultdict(list)
for p in sorted(glob.glob(f'data/{st}/displacement/{st}_advanced_2026*.csv')):
if not re.search(r'_advanced_\d{8}\.csv$', p): continue
for l in csv.DictReader(open(p)):
c = l['sensor_name'].strip()
if c not in caps or not l['corr_x']: continue
j, h = l['time_utc'][:10], int(l['time_utc'][11:13])
k = 'j' if h1 <= h < h2 else 'n' if h < 3 else None
if k: v[c, j, k].append((float(l['corr_x']), float(l['corr_y']), float(l['error_value']) / float(l['error_threshold'])))
jours = sorted({j for _, j, _ in v})
print('jour ' + ''.join(f'{c:>24}' for c in caps) + ' (dx, dy jour - nuit ; ev/seuil de jour)')
for j in jours:
r = []
for c in caps:
a, b = v.get((c, j, 'j')), v.get((c, j, 'n'))
r.append(f"{S.median(x[0] for x in a) - S.median(x[0] for x in b):+7.3f}{S.median(x[1] for x in a) - S.median(x[1] for x in b):+7.3f}{S.median(x[2] for x in a):6.2f} " if a and b else ' ' * 24)
print(j, ''.join(r))