low freq filter
This commit is contained in:
@ -7,6 +7,7 @@ import unittest
|
||||
|
||||
from rfg_adc_plotter.constants import C_M_S, FFT_LEN, SWEEP_FREQ_MAX_GHZ, SWEEP_FREQ_MIN_GHZ
|
||||
from rfg_adc_plotter.gui.pyqtgraph_backend import (
|
||||
apply_distance_cut_to_axis,
|
||||
apply_working_range,
|
||||
apply_working_range_to_aux_curves,
|
||||
build_main_window_layout,
|
||||
@ -16,6 +17,7 @@ from rfg_adc_plotter.gui.pyqtgraph_backend import (
|
||||
resolve_axis_bounds,
|
||||
resolve_heavy_refresh_stride,
|
||||
resolve_initial_window_size,
|
||||
resolve_distance_cut_start,
|
||||
sanitize_curve_data_for_display,
|
||||
sanitize_image_for_display,
|
||||
set_image_rect_if_ready,
|
||||
@ -317,6 +319,22 @@ class ProcessingTests(unittest.TestCase):
|
||||
|
||||
self.assertIsNone(bounds)
|
||||
|
||||
def test_resolve_distance_cut_start_interpolates_with_percent(self):
|
||||
axis = np.asarray([0.0, 1.0, 2.0, 3.0], dtype=np.float64)
|
||||
cut_start = resolve_distance_cut_start(axis, 50.0)
|
||||
|
||||
self.assertIsNotNone(cut_start)
|
||||
self.assertAlmostEqual(float(cut_start), 1.5, places=6)
|
||||
|
||||
def test_apply_distance_cut_to_axis_keeps_farthest_point_for_extreme_cut(self):
|
||||
axis = np.asarray([0.0, 1.0, 2.0, 3.0], dtype=np.float64)
|
||||
cut_axis, keep_mask = apply_distance_cut_to_axis(axis, 10.0)
|
||||
|
||||
self.assertEqual(cut_axis.shape, (1,))
|
||||
self.assertEqual(keep_mask.shape, axis.shape)
|
||||
self.assertTrue(bool(keep_mask[-1]))
|
||||
self.assertAlmostEqual(float(cut_axis[0]), 3.0, places=6)
|
||||
|
||||
def test_resolve_initial_window_size_stays_within_small_screen(self):
|
||||
width, height = resolve_initial_window_size(800, 480)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user