Skip to content

Commit

Permalink
Add to tests for Iowa sounding metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrleeman committed Mar 29, 2018
1 parent c13f790 commit c0c5274
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions siphon/tests/test_iastate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def test_iastate():
"""Test that we are properly parsing data from the Iowa State archive."""
df = IAStateUpperAir.request_data(datetime(1999, 5, 4, 0), 'OUN')

assert(df['time'][0] == datetime(1999, 5, 4, 0))
assert(df['station'][0] == 'KOUN')

assert_almost_equal(df['pressure'][6], 872.7, 2)
assert_almost_equal(df['height'][6], 1172.0, 2)
assert_almost_equal(df['temperature'][6], 18.2, 2)
Expand All @@ -36,13 +39,18 @@ def test_iastate():
assert(df.units['v_wind'] == 'knot')
assert(df.units['speed'] == 'knot')
assert(df.units['direction'] == 'degrees')
assert(df.units['station'] is None)
assert(df.units['time'] is None)


@recorder.use_cassette('iastate_high_alt_sounding')
def test_high_alt_iastate():
"""Test Iowa State data that starts at pressure less than 925 hPa."""
df = IAStateUpperAir.request_data(datetime(2010, 12, 9, 12), 'BOI')

assert(df['time'][0] == datetime(2010, 12, 9, 12))
assert(df['station'][0] == 'KBOI')

assert_almost_equal(df['pressure'][0], 919.0, 2)
assert_almost_equal(df['height'][0], 871.0, 2)
assert_almost_equal(df['temperature'][0], -0.1, 2)
Expand All @@ -51,3 +59,14 @@ def test_high_alt_iastate():
assert_almost_equal(df['v_wind'][0], 1.500, 2)
assert_almost_equal(df['speed'][0], 3.0, 1)
assert_almost_equal(df['direction'][0], 240.0, 1)

assert(df.units['pressure'] == 'hPa')
assert(df.units['height'] == 'meter')
assert(df.units['temperature'] == 'degC')
assert(df.units['dewpoint'] == 'degC')
assert(df.units['u_wind'] == 'knot')
assert(df.units['v_wind'] == 'knot')
assert(df.units['speed'] == 'knot')
assert(df.units['direction'] == 'degrees')
assert(df.units['station'] is None)
assert(df.units['time'] is None)

0 comments on commit c0c5274

Please sign in to comment.