support: NADELHORN 2026-11-18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b80b7c963
commit
74b161b0a1
9 files changed
+268
No files matched your search
+62
@@ -0,0 +1,62 @@
|
||||
"""Client figure: corrected vertical position (mm) of m_c7_mon and m_c10_mon, a witness
|
||||
(m_c9_mon), and the error of the reference m_c12_mon, with the instants where m_c12_mon is
|
||||
rejected greyed. Run from the repository root with .venv/bin/python.
|
||||
Usage: client_figure.py <station folder> <out png>
|
||||
"""
|
||||
import sys
|
||||
sys.path.insert(0, "tools/scripts")
|
||||
import data # the shared reader
|
||||
import matplotlib
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.dates as mdates
|
||||
from datetime import datetime, timezone
|
||||
|
||||
folder, out = sys.argv[1], sys.argv[2]
|
||||
t0 = datetime(2026, 11, 17, 18, 0, tzinfo=timezone.utc)
|
||||
t1 = datetime(2026, 11, 18, 13, 15, tzinfo=timezone.utc)
|
||||
allm = data.load(folder)
|
||||
series = {n: [(m["t"], m) for m in ms if t0 <= m["t"] <= t1] for n, ms in allm.items()}
|
||||
|
||||
def col(name, c):
|
||||
out_t, out_v = [], []
|
||||
for t, r in sorted(series.get(name, []), key=lambda p: p[0]):
|
||||
v = r.get(c)
|
||||
if v in (None, ""):
|
||||
continue
|
||||
try:
|
||||
v = float(v)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
if v != v:
|
||||
continue
|
||||
out_t.append(t)
|
||||
out_v.append(v)
|
||||
return out_t, out_v
|
||||
|
||||
rej = [(t, r) for t, r in series["m_c12_mon"] if data.rejected(r)]
|
||||
|
||||
fig, (a1, a2) = plt.subplots(2, 1, figsize=(11, 6.5), sharex=True,
|
||||
gridspec_kw={"height_ratios": [3, 1.3]})
|
||||
for name, colr in (("m_c7_mon", "tab:red"), ("m_c10_mon", "tab:blue"), ("m_c9_mon", "tab:grey")):
|
||||
t, v = col(name, "corr_y_mm")
|
||||
a1.plot(t, v, ".-", color=colr, lw=1, ms=3, label=name + (" (other target, same behaviour)" if name == "m_c9_mon" else ""))
|
||||
from datetime import timedelta
|
||||
for t, _ in rej:
|
||||
for a in (a1, a2):
|
||||
a.axvspan(t - timedelta(minutes=7), t + timedelta(minutes=7), color="orange", alpha=0.3, lw=0)
|
||||
a1.set_ylabel("vertical position, corrected [mm]")
|
||||
a1.set_title("NADELHORN, 17-18 Nov 2026 (UTC): the vertical jumps fall exactly when the\n"
|
||||
"reference m_c12_mon is hidden by a construction machine (orange bands)")
|
||||
a1.legend(loc="upper left", fontsize=8)
|
||||
a1.grid(alpha=0.3)
|
||||
t, v = col("m_c12_mon", "error_value")
|
||||
a2.plot(t, v, ".-", color="tab:orange", lw=1, ms=3, label="m_c12_mon (reference) recognition error")
|
||||
a2.axhline(0.4, color="k", ls="--", lw=0.8, label="rejection threshold")
|
||||
a2.set_ylabel("error")
|
||||
a2.legend(loc="upper left", fontsize=8)
|
||||
a2.grid(alpha=0.3)
|
||||
a2.xaxis.set_major_formatter(mdates.DateFormatter("%d/%m\n%H:%M", tz=timezone.utc))
|
||||
fig.tight_layout()
|
||||
fig.savefig(out, dpi=110)
|
||||
print(out)
|
||||
Reference in new issue
Block a user