This commit is contained in:
awe
2026-02-11 19:26:00 +03:00
parent 66b9eee230
commit d2d504f5b8

View File

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