From af37973cccfe4605e9e249835ddb0c7816860691 Mon Sep 17 00:00:00 2001 From: Rune Broberg Date: Wed, 6 Nov 2019 10:39:55 +0100 Subject: [PATCH] Bugfix: VSWR analysis should now find the correct dips when there are more than 3. Fixes #78 --- NanoVNASaver/Analysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NanoVNASaver/Analysis.py b/NanoVNASaver/Analysis.py index f941032..bed8ac4 100644 --- a/NanoVNASaver/Analysis.py +++ b/NanoVNASaver/Analysis.py @@ -1278,8 +1278,10 @@ class VSWRAnalysis(Analysis): best_dips = [] for i in range(max_dips_shown): - best_dips.append(minimums[np.argmin(dips)]) - dips.remove(np.min(dips)) + min_idx = np.argmin(dips) + best_dips.append(minimums[min_idx]) + dips.remove(dips[min_idx]) + minimums.remove(minimums[min_idx]) minimums = best_dips if len(minimums) > 0: