From 2c5c20cfd77171055ccff97b37d47bf3ad62fe81 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 15 Sep 2026 05:39:53 +0000 Subject: [PATCH] fix(report): fit sensor-check mini-plots to their boxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01YDXjZCr4RqT2U3QvMDhgzf --- sfm/report_pdf.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sfm/report_pdf.py b/sfm/report_pdf.py index 2771bba..a793b08 100644 --- a/sfm/report_pdf.py +++ b/sfm/report_pdf.py @@ -930,10 +930,17 @@ def _draw_waveform_subplot(fig, gridspec_cell, rd: ReportData) -> None: sc_axes.append(scx) sc_vals = rd.sensor_check_waveforms.get(ch) or [] if sc_vals: - scx.plot(range(len(sc_vals)), sc_vals, - color=_channel_axis_color(ch), linewidth=0.5) - _amx = max((abs(v) for v in sc_vals), default=1.0) or 1.0 - scx.set_ylim(-_amx * 1.15, _amx * 1.15) + _col = _channel_axis_color(ch) + # Faint zero baseline (BW draws the channel baseline through the + # strip) — reference for the one-sided geophone ring-downs. + 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([]) for _s in scx.spines.values(): _s.set_linewidth(0.4); _s.set_color("#999")