Skip to content

Commit

Permalink
Keep wind speed and direction in returned upperair data
Browse files Browse the repository at this point in the history
  • Loading branch information
jrleeman committed Feb 16, 2017
1 parent e667a05 commit 740c63f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions metpy/io/tests/test_upperair.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def test_wyoming():
assert_almost_equal(data.variables['dewpoint'][5], 14.3 * units.degC, 2)
assert_almost_equal(data.variables['u_wind'][5], 6.60 * units.knot, 2)
assert_almost_equal(data.variables['v_wind'][5], 37.42 * units.knot, 2)
assert_almost_equal(data.variables['speed'][5], 38.0 * units.knot, 1)
assert_almost_equal(data.variables['direction'][5], 190.0 * units.deg, 1)


def test_iastate():
Expand All @@ -33,6 +35,8 @@ def test_iastate():
assert_almost_equal(data.variables['dewpoint'][3], 15.2 * units.degC, 2)
assert_almost_equal(data.variables['u_wind'][3], 1.72 * units.knot, 2)
assert_almost_equal(data.variables['v_wind'][3], 2.46 * units.knot, 2)
assert_almost_equal(data.variables['speed'][3], 3.0 * units.knot, 1)
assert_almost_equal(data.variables['direction'][3], 215.0 * units.deg, 1)


def test_high_alt_wyoming():
Expand Down
3 changes: 1 addition & 2 deletions metpy/io/upperair.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from .cdm import Dataset
from ..calc import get_wind_components
from ..package_tools import Exporter
from ..units import units

exporter = Exporter(globals())

Expand Down Expand Up @@ -77,7 +76,7 @@ def add_unit_var(name, std_name, arr, unit):
add_unit_var('u_wind', 'eastward_wind', u, spd_units)
add_unit_var('v_wind', 'northward_wind', v, spd_units)
add_unit_var('speed', 'wind_speed', spd, spd_units)
add_unit_var('dir', 'wind_direction', direc, units.deg)
add_unit_var('direction', 'wind_from_direction', direc, 'deg')

return ds

Expand Down

0 comments on commit 740c63f

Please sign in to comment.