Skip to content

Commit

Permalink
FIX: nsweeps wasn't updated when calling 'determine_sweeps'; tests we…
Browse files Browse the repository at this point in the history
…re updated accordingly
  • Loading branch information
isilber committed Dec 6, 2023
1 parent ea1a94b commit 1d338c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyart/util/radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def determine_sweeps(radar,
radar.sweep_start_ray_index['data'] = ma.array(sweep_start_index, dtype='int32')
radar.sweep_end_ray_index['data'] = ma.array(sweep_end_index, dtype='int32')
radar.sweep_number['data'] = ma.array(sweep_number, dtype='int32')
radar.nsweeps = len(sweep_number)
return


Expand Down
2 changes: 2 additions & 0 deletions tests/util/test_radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_determine_sweeps():
assert np.all(radar.sweep_end_ray_index['data'] == [35, 71, 107])
assert np.all(radar.sweep_start_ray_index['data'] == [0, 36, 72])
assert len(radar.sweep_number['data']) == 3
assert radar.nsweeps == 3

# rhi
radar = pyart.testing.make_empty_rhi_radar(10, 25, 5)
Expand All @@ -66,6 +67,7 @@ def test_determine_sweeps():
assert np.all(radar.sweep_end_ray_index['data'] == [ 24, 49, 74, 99, 124])
assert np.all(radar.sweep_start_ray_index['data'] == [ 0, 25, 50, 75, 100])
assert len(radar.sweep_number['data']) == 5
assert radar.nsweeps == 5


def test_subset_radar():
Expand Down

0 comments on commit 1d338c1

Please sign in to comment.