normaliser #1

Open
awe wants to merge 13 commits from normaliser into master
18 changed files with 1659 additions and 1446 deletions
Showing only changes of commit d2d504f5b8 - Show all commits

View File

@ -7,7 +7,9 @@ from typing import Optional, Tuple
import numpy as np
from rfg_adc_plotter.constants import FFT_LEN
from rfg_adc_plotter.constants import FFT_LEN, FREQ_SPAN_GHZ, IFFT_LEN
_IFFT_T_MAX_NS = float((IFFT_LEN - 1) / (FREQ_SPAN_GHZ * 1e9) * 1e9)
from rfg_adc_plotter.io.sweep_reader import SweepReader
from rfg_adc_plotter.processing.normalizer import build_calib_envelopes
from rfg_adc_plotter.state.app_state import AppState, format_status
@ -128,8 +130,8 @@ def run_matplotlib(args):
# График спектра
fft_line_obj, = ax_fft.plot([], [], lw=1)
ax_fft.set_title("FFT", pad=1)
ax_fft.set_xlabel("X")
ax_fft.set_ylabel("Амплитуда, дБ")
ax_fft.set_xlabel("Время, нс")
ax_fft.set_ylabel("Мощность, дБ")
# Водопад сырых данных
img_obj = ax_img.imshow(
@ -149,7 +151,7 @@ def run_matplotlib(args):
aspect="auto", interpolation="nearest", origin="lower", cmap=args.cmap,
)
ax_spec.set_title("B-scan (дБ)", pad=12)
ax_spec.set_ylabel("расстояние")
ax_spec.set_ylabel("Время, нс")
try:
ax_spec.tick_params(axis="x", labelbottom=False)
except Exception:
@ -199,9 +201,10 @@ def run_matplotlib(args):
ax_img.set_xlim(0, ms - 1)
ax_img.set_ylim(FREQ_MIN, FREQ_MAX)
img_fft_obj.set_data(np.zeros((fb, ms), dtype=np.float32))
img_fft_obj.set_extent((0, ms - 1, 0, fb - 1))
img_fft_obj.set_extent((0, ms - 1, 0.0, _IFFT_T_MAX_NS))
ax_spec.set_xlim(0, ms - 1)
ax_spec.set_ylim(0, max(1, fb - 1))
ax_spec.set_ylim(0.0, _IFFT_T_MAX_NS)
ax_fft.set_xlim(0.0, _IFFT_T_MAX_NS)
_imshow_initialized = [False]