Skip to content

Commit 169ad22

Browse files
committed
test the indices I guess
1 parent d779cc5 commit 169ad22

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

pyxlma/lmalib/lma_intercept_rhi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ def find_points_near_rhi(lma_file, radar_latitude, radar_longitude, radar_altitu
222222
lma_range : `numpy.ndarray`
223223
A 1D array representing the distance along the radar RHI scan to each filtered LMA point.
224224
lma_dist : `numpy.ndarray`
225-
A 1D array representing the distance from the radar RHI scan plane to each filtered LMA point.
225+
A 1D array representing the distance from the radar RHI scan plane to each filtered LMA point.
226226
lma_alt : `numpy.ndarray`
227-
A 1D array representing the height above the radar of each filtered LMA point.
227+
A 1D array representing the height above the radar of each filtered LMA point.
228228
point_mask : `numpy.ndarray`
229229
A 1D array of booleans representing the VHF points that were included in the return.
230230
"""

tests/test_intercept_rhi.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_intercept_rhi():
1212
files_to_read = ['examples/data/'+file for file in files_to_read]
1313
dataset, start_date = lma_read.dataset(files_to_read)
1414
lma_radar_range, lma_plane_distance, lma_arl, event_mask = lma_intercept_rhi.find_points_near_rhi(dataset, 33.56, -101.81, 1600.0, 225, start_date+timedelta(seconds=30), distance_threshold=500, time_threshold=15)
15-
lma_ids = dataset.event_id.isel(number_of_events=np.flatnonzero(event_mask))
15+
lma_indices = np.flatnonzero(event_mask)
1616
true_radar_range = np.array([-24314.95714263, -24255.42134556, -23947.00309296, -24201.07999466,
1717
-24216.22494555, -24209.0779143 , -24252.54770026, -24196.90100367,
1818
-24261.77984816, -24002.07311165, -23977.02349918, -23922.33835871,
@@ -55,12 +55,15 @@ def test_intercept_rhi():
5555
2746.43494287, 2584.35605103, 2341.75645168, 2613.90859694,
5656
2919.30959546, 2614.69497102, 2473.25507194, 2782.82223582,
5757
2461.79799166, 2377.74468257, 7332.69246886])
58-
true_lma_ids = np.array([5499, 5501, 5502, 5504, 5509, 5511, 5513, 5520, 5524, 5536, 5537,
59-
5543, 5555, 5556, 5565, 5759, 5770, 5773, 5774, 5775, 5776, 5777,
60-
5778, 5779, 5780, 5781, 5783, 5784, 5791, 5797, 5798, 5969, 6156,
61-
6158, 6163, 6164, 6165, 6167, 6170, 6173, 6176, 6177, 6179, 6180,
62-
6183, 6187, 6196, 6205, 6207, 6210, 6211, 6212, 6216, 6219, 6324], dtype='uint64')
58+
true_lma_ids = np.array([12731, 12733, 12734, 12736, 12741, 12743, 12745, 12752, 12756,
59+
12768, 12769, 12775, 12787, 12788, 12797, 12991, 13002, 13005,
60+
13006, 13007, 13008, 13009, 13010, 13011, 13012, 13013, 13015,
61+
13016, 13023, 13029, 13030, 13201, 13388, 13390, 13395, 13396,
62+
13397, 13399, 13402, 13405, 13408, 13409, 13411, 13412, 13415,
63+
13419, 13428, 13437, 13439, 13442, 13443, 13444, 13448, 13451,
64+
13556], dtype='uint64')
6365
assert np.allclose(lma_radar_range, true_radar_range, atol=1e-3)
6466
assert np.allclose(lma_plane_distance, true_plane_distance, atol=1e-3)
6567
assert np.allclose(lma_arl, true_radar_arl, atol=1e-3)
66-
assert np.all(lma_ids == true_lma_ids)
68+
assert np.all(lma_indices == true_lma_ids)
69+

0 commit comments

Comments
 (0)