Files
aimsight-labeling/auto/analyses/NIEDERHORN_2026-10-11T0500_2026-10-21T1200/scripts/values.py
T

23 lines
1004 B
Python
Raw Normal View History

"""Values of chosen sensors per instant: corr_x/corr_y/error_value (r = rejected).
Usage: python3 values.py START END SENSOR[,SENSOR...]"""
import sys
sys.path.insert(0, "tools/scripts")
import data
start, end = data.parse_time(sys.argv[1]), data.parse_time(sys.argv[2])
by = data.load("data/NIEDERHORN")
names = sys.argv[3].split(",")
cols = []
for n in names:
s = next(k for k in by if k == n or k == f"PWD_{n}_C09")
cols.append((s, {m["t"]: m for m in data.filter_window(by[s], start, end)}))
times = sorted({t for _, d in cols for t in d})
f = lambda v: " -" if v is None else f"{v:+.3f}"
print("time " + " | ".join(f"{s.replace('PWD_', '').replace('_C09', ''):^22}" for s, _ in cols))
for t in times:
row = []
for s, d in cols:
m = d.get(t)
row.append(" none " if m is None else
f"{f(m['corr_x'])} {f(m['corr_y'])} {m['error_value']:.2f}{'r' if data.rejected(m) else ' '}")
print(data.iso(t), " | ".join(row))