fix range

This commit is contained in:
awe
2026-06-09 19:42:40 +03:00
parent 52575e8312
commit 05f8a8942b
3 changed files with 39 additions and 5 deletions

View File

@ -265,13 +265,15 @@ def make_update(reader, parser, assembler, curves, plots):
if n < 2:
return
freqs_ghz = np.linspace(F_START_HZ / 1e9, F_STOP_HZ / 1e9, n)
freqs_hz = freqs_ghz * 1e9
ref_amp, ref_phase = process_reference(
sweep["ref_ch1"], sweep["ref_ch2"]
)
# Compute frequency axis from reference signal phase (linear phase-freq model)
phi0, phi1 = ref_phase[0], ref_phase[-1]
freqs_ghz = (F_START_HZ / 1e9) + (ref_phase - phi0) / (phi1 - phi0) * (BW_HZ / 1e9)
freqs_hz = freqs_ghz * 1e9
# Fix reference phase from the first sweep
if state["ref_phase_first"] is None:
state["ref_phase_first"] = ref_phase[0]