Files
Support-Agent/labeling/auto/etiqueteur/JUNGFRAU_2026-10-06/outils/extremes.py
T
maximeandClaude Opus 5.5 6fbd7510b7 Etiqueteur: October labels for 8 stations; its folder moves to labeling/auto/etiqueteur/, analyses and scripts versioned (D-126)
Labels for CLARIDEN, FLORIDA, JUNGFRAU (gaps 06-20.10, 26.10-01.11), LENZSPITZE,
NIEDERHORN, NORDEND, SNCF01, WILDSTRUBEL. Figures and tool outputs stay out of git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:33:41 +01:00

12 lines
791 B
Python

"""Max du matin (03-12h) et min de l'après-midi (12-21h) de la médiane des cibles corr_y, lissée sur 1 h.
usage : vue.py --table --pas15 > f ; python3 extremes.py f"""
import sys, statistics as st
L = [l.split() for l in open(sys.argv[1]) if l[:2].isdigit()]
s = [(l[0], l[1], float(l[3])) for l in L if l[3] != "-"]
lis = [(d, h, st.median(v for _, _, v in s[max(0, i-2):i+3])) for i, (d, h, _) in enumerate(s)]
for d in sorted({d for d, _, _ in lis}, key=lambda x: x[3:]+x[:2]):
m = [x for x in lis if x[0] == d and "03:00" <= x[1] < "12:00"]
n = [x for x in lis if x[0] == d and "12:00" <= x[1] < "21:00"]
f = lambda x: f"{x[1]} {x[2]:+.3f}"
print(d, "max matin", f(max(m, key=lambda x: x[2])) if m else "-", "| min aprem", f(min(n, key=lambda x: x[2])) if n else "-")