fix(report): fit sensor-check mini-plots to their boxes
The sensor-check strip used a symmetric ±max scale, so the one-sided geophone ring-downs (a dip to ~-990 with the baseline at 0) sat in the bottom half of each mini-box with the top half blank — visibly off next to Blastware. Scale each mini-plot to its actual data range with a small pad instead, and draw a faint zero baseline, so the ring-downs and the mic pulse train fill their boxes the way BW draws them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDXjZCr4RqT2U3QvMDhgzf
This commit is contained in:
+11
-4
@@ -930,10 +930,17 @@ def _draw_waveform_subplot(fig, gridspec_cell, rd: ReportData) -> None:
|
|||||||
sc_axes.append(scx)
|
sc_axes.append(scx)
|
||||||
sc_vals = rd.sensor_check_waveforms.get(ch) or []
|
sc_vals = rd.sensor_check_waveforms.get(ch) or []
|
||||||
if sc_vals:
|
if sc_vals:
|
||||||
scx.plot(range(len(sc_vals)), sc_vals,
|
_col = _channel_axis_color(ch)
|
||||||
color=_channel_axis_color(ch), linewidth=0.5)
|
# Faint zero baseline (BW draws the channel baseline through the
|
||||||
_amx = max((abs(v) for v in sc_vals), default=1.0) or 1.0
|
# strip) — reference for the one-sided geophone ring-downs.
|
||||||
scx.set_ylim(-_amx * 1.15, _amx * 1.15)
|
scx.axhline(0.0, color=_col, linewidth=0.3, alpha=0.4)
|
||||||
|
scx.plot(range(len(sc_vals)), sc_vals, color=_col, linewidth=0.5)
|
||||||
|
# Fit the trace to the box (BW-style) rather than a symmetric
|
||||||
|
# scale: the geo self-checks are one-sided dips, so a symmetric
|
||||||
|
# scale would strand them in the bottom half with an empty top.
|
||||||
|
_lo, _hi = min(sc_vals), max(sc_vals)
|
||||||
|
_pad = 0.10 * ((_hi - _lo) or 1.0)
|
||||||
|
scx.set_ylim(_lo - _pad, _hi + _pad)
|
||||||
scx.set_xticks([]); scx.set_yticks([])
|
scx.set_xticks([]); scx.set_yticks([])
|
||||||
for _s in scx.spines.values():
|
for _s in scx.spines.values():
|
||||||
_s.set_linewidth(0.4); _s.set_color("#999")
|
_s.set_linewidth(0.4); _s.set_color("#999")
|
||||||
|
|||||||
Reference in New Issue
Block a user