Rework radar system

This commit is contained in:
Ayzen
2026-10-06 12:32:26 +03:00
parent 552cdc688a
commit 5bb86b7165
299 changed files with 13537 additions and 27763 deletions
+4 -5
View File
@@ -32,7 +32,6 @@ def export_trace_png(
trace: TraceData,
output_path: Path,
*,
channel: str,
title: str,
) -> None:
"""Render one trace's amplitude (dB) and wrapped phase (deg) panes to a PNG.
@@ -41,22 +40,22 @@ def export_trace_png(
curves as the live preview, and exports the scene as a PNG. Requires a
running ``QApplication`` (always true inside the GUI).
"""
samples = trace.s11 if channel == "s11" else trace.s21
samples = trace.s21
magnitude_db = 20.0 * np.log10(np.maximum(np.abs(samples), 1e-12))
phase_deg = np.degrees(np.angle(samples))
layout = pg.GraphicsLayoutWidget(show=False, size=_EXPORT_SIZE)
layout.setBackground(_BACKGROUND)
try:
layout.addLabel(title, row=0, col=0, colspan=2)
layout.ci.addLabel(title, row=0, col=0, colspan=2)
magnitude_plot = layout.addPlot(row=1, col=0)
magnitude_plot = layout.ci.addPlot(row=1, col=0)
magnitude_plot.showGrid(x=True, y=True, alpha=0.2)
magnitude_plot.setLabel("bottom", "Frequency", units="Hz")
magnitude_plot.setLabel("left", "Magnitude", units="dB")
magnitude_plot.plot(trace.frequency_hz, magnitude_db, pen=_MAGNITUDE_PEN)
phase_plot = layout.addPlot(row=1, col=1)
phase_plot = layout.ci.addPlot(row=1, col=1)
phase_plot.showGrid(x=True, y=True, alpha=0.2)
phase_plot.setLabel("bottom", "Frequency", units="Hz")
phase_plot.setLabel("left", "Phase", units="deg")