added s11!

This commit is contained in:
Ayzen
2026-03-26 18:29:42 +03:00
parent 9ddbde22bd
commit 077542cbd0
43 changed files with 713 additions and 347 deletions
@@ -389,7 +389,10 @@ class AppWindowPlotMixin:
self._bscan_plot.addItem(image_item)
self._bscan_plot.setXRange(x_min, x_max, padding=0.02)
self._bscan_plot.setYRange(depth_min, depth_max, padding=0.02)
self._bscan_plot.setTitle(f"B-scan in{display_key[0]}/out{display_key[1]} | sweeps={sweep_count}")
bscan_channel = self._bscan_channel.currentText().upper()
self._bscan_plot.setTitle(
f"B-scan {bscan_channel} in{display_key[0]}/out{display_key[1]} | sweeps={sweep_count}"
)
return True
def _sync_bscan_history_from_results(self) -> None:
@@ -793,12 +796,13 @@ class AppWindowPlotMixin:
return True
return False
def _draw_single_trace(self, trace: TraceData, title: str) -> None:
def _draw_single_trace(self, trace: TraceData, title: str, *, channel: str = "s21") -> None:
"""Draw one trace on stacked magnitude/phase plots."""
show_magnitude = self._show_magnitude_curves()
show_phase = self._show_phase_curves()
magnitude_plot = self._trace_magnitude_plot
phase_plot = self._trace_phase_plot
samples = trace.s11 if channel == "s11" else trace.s21
magnitude_plot.setVisible(show_magnitude)
phase_plot.setVisible(show_phase)
@@ -822,7 +826,7 @@ class AppWindowPlotMixin:
phase_plot.setTitle(title)
if show_magnitude:
magnitude_db = 20.0 * np.log10(np.maximum(np.abs(trace.s21), 1e-12))
magnitude_db = 20.0 * np.log10(np.maximum(np.abs(samples), 1e-12))
magnitude_curve = pg.PlotCurveItem(
trace.frequency_hz,
magnitude_db,
@@ -834,7 +838,7 @@ class AppWindowPlotMixin:
] = magnitude_curve
if show_phase:
phase_deg = np.degrees(np.angle(trace.s21))
phase_deg = np.degrees(np.angle(samples))
phase_curve = pg.PlotCurveItem(
trace.frequency_hz,
phase_deg,