Skip to content

Commit

Permalink
added unittest for join_radar
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Jul 19, 2022
1 parent f61f5eb commit 88ff2bd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pyart/util/tests/test_radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ def test_is_vpt():
pyart.util.to_vpt(radar)
assert pyart.util.is_vpt(radar)

def test_join_radar():
radar1 = pyart.testing.make_empty_ppi_radar(10, 36, 3)
radar1.instrument_parameters = {
'nyquist_velocity': {'data': np.array([6] * 3)}
}
field = {'data': np.ones((36 * 3, 10))}
radar1.add_field('f1', field)
radar1.add_field('f2', field)
radar2 = pyart.testing.make_empty_ppi_radar(10, 36, 4)
radar2.instrument_parameters = {
'nyquist_velocity': {'data': np.array([8] * 4)}
}
field = {'data': np.ones((36 * 4, 10))}
radar2.add_field('f1', field)

radar3 = pyart.util.join_radar(radar1, radar2)
assert 'f1' in radar3.fields
assert len(radar3.instrument_parameters['nyquist_velocity']['data']) == 7

def test_to_vpt():
# single scan
Expand Down

0 comments on commit 88ff2bd

Please sign in to comment.