From e995f0419366db47dbe79561f447efe9d36e7ec3 Mon Sep 17 00:00:00 2001 From: Theodor Chikin Date: Wed, 28 Jan 2026 17:22:10 +0300 Subject: [PATCH] Number of valid points now calculates before the filling of the missing points. Also averaging is done by 1 sec. (was 10 secs) --- RFG_ADC_dataplotter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RFG_ADC_dataplotter.py b/RFG_ADC_dataplotter.py index aad32c9..88ed519 100755 --- a/RFG_ADC_dataplotter.py +++ b/RFG_ADC_dataplotter.py @@ -305,6 +305,10 @@ class SweepReader(threading.Thread): for x, y in zip(xs, ys): if 0 <= x < target_width: sweep[x] = float(y) + # Метрики валидных точек до заполнения пропусков + finite_pre = np.isfinite(sweep) + n_valid_cur = int(np.count_nonzero(finite_pre)) + # Дополнительная обработка пропусков: при --fancy заполняем внутренние разрывы, края и дотягиваем до максимальной длины if self._fancy: try: @@ -342,8 +346,6 @@ class SweepReader(threading.Thread): else: dt_ms = (now - self._last_sweep_ts) * 1000.0 self._last_sweep_ts = now - finite = np.isfinite(sweep) - n_valid_cur = int(np.count_nonzero(finite)) self._n_valid_hist.append((now, n_valid_cur)) while self._n_valid_hist and (now - self._n_valid_hist[0][0]) > 10.0: self._n_valid_hist.popleft()