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>
This commit is contained in:
1 parent
2bba388290
commit
6fbd7510b7
112 files changed
+8951
-6
No files matched your search
@@ -0,0 +1,44 @@
|
||||
"""Par instant d'une fenêtre : références rejetées, cibles rejetées, médiane des écarts de corr_x / corr_y des cibles
|
||||
acceptées à leur niveau (médiane du lot), cibles qui s'écartent de plus de K bruits, et la pose.
|
||||
Lancer depuis la racine : python3 labeling/auto/etiqueteur/NORDEND_2026-10-01/outils/instants.py DEBUT FIN [K]"""
|
||||
import csv, glob, sys, statistics as st
|
||||
from collections import defaultdict
|
||||
|
||||
D = "data/NORDEND"
|
||||
d0, d1 = sys.argv[1], sys.argv[2]
|
||||
K = float(sys.argv[3]) if len(sys.argv) > 3 else 8
|
||||
rows = defaultdict(dict)
|
||||
serie = defaultdict(list)
|
||||
for f in sorted(glob.glob(f"{D}/displacement/NORDEND_advanced_202610*.csv")):
|
||||
for r in csv.DictReader(open(f)):
|
||||
t = r["time_utc"][:16].replace(" ", "T")
|
||||
rows[t][r["sensor_name"]] = r
|
||||
if r["pattern_type"] != "global_ref" and r["corr_x"]:
|
||||
serie[r["sensor_name"]].append((t, float(r["corr_x"]), float(r["corr_y"])))
|
||||
niv, bruit = {}, {}
|
||||
for s, L in serie.items():
|
||||
niv[s] = (st.median(a[1] for a in L), st.median(a[2] for a in L))
|
||||
bruit[s] = (st.median(abs(L[i + 1][1] - L[i][1]) for i in range(len(L) - 1)),
|
||||
st.median(abs(L[i + 1][2] - L[i][2]) for i in range(len(L) - 1)))
|
||||
cam = {}
|
||||
for f in glob.glob(f"{D}/camera/NORDEND_camera_202610*.csv"):
|
||||
for r in csv.DictReader(open(f)):
|
||||
cam[r["time_utc"][:16].replace(" ", "T")] = r
|
||||
for t in sorted(rows):
|
||||
if not (d0 <= t <= d1):
|
||||
continue
|
||||
R = rows[t]
|
||||
refrej = [s for s, r in R.items() if r["pattern_type"] == "global_ref" and float(r["error_value"]) > float(r["error_threshold"])]
|
||||
rej = [s for s, r in R.items() if r["pattern_type"] != "global_ref" and not r["corr_x"]]
|
||||
dx, dy, out = [], [], []
|
||||
for s, r in R.items():
|
||||
if r["pattern_type"] == "global_ref" or not r["corr_x"]:
|
||||
continue
|
||||
ex = (float(r["corr_x"]) - niv[s][0]); ey = (float(r["corr_y"]) - niv[s][1])
|
||||
dx.append(ex); dy.append(ey)
|
||||
if abs(ex) > K * bruit[s][0] * 3 or abs(ey) > K * bruit[s][1] * 3:
|
||||
out.append(s)
|
||||
c = cam.get(t)
|
||||
ce = f"pan {float(c['median_pan']):+.4f} tilt {float(c['median_tilt']):+.4f} s0 {float(c['median_sigma0']) if c['median_sigma0'] else float('nan'):.4f}" if c else "SANS POSE"
|
||||
print(f"{t} refrej {','.join(refrej) or '-':12s} rej {len(rej):2d} {','.join(sorted(rej))[:60]:60s} "
|
||||
f"mx {st.median(dx) if dx else float('nan'):+.3f} my {st.median(dy) if dy else float('nan'):+.3f} hors {len(out):2d} {','.join(sorted(out))[:50]:50s} {ce}")
|
||||
Reference in new issue
Block a user