From 19bab374b9cc2176f1d9f150f14d51494a763c0f Mon Sep 17 00:00:00 2001 From: srcarter3 Date: Fri, 4 Sep 2020 10:34:52 -0600 Subject: [PATCH] fixed import error and units errors --- examples/notebooks/Model_Sounding_Data.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/notebooks/Model_Sounding_Data.ipynb b/examples/notebooks/Model_Sounding_Data.ipynb index d86b420..cb7d59d 100644 --- a/examples/notebooks/Model_Sounding_Data.ipynb +++ b/examples/notebooks/Model_Sounding_Data.ipynb @@ -21,7 +21,7 @@ "from mpl_toolkits.axes_grid1.inset_locator import inset_axes\n", "from math import exp, log\n", "import numpy as np\n", - "from metpy.calc import get_wind_components, lcl, dry_lapse, parcel_profile, dewpoint\n", + "from metpy.calc import wind_components, lcl, dry_lapse, parcel_profile, dewpoint\n", "from metpy.calc import wind_speed, wind_direction, thermo, vapor_pressure\n", "from metpy.plots import SkewT, Hodograph\n", "from metpy.units import units, concatenate\n", @@ -1154,8 +1154,8 @@ "p = prs/100 * units.mbar\n", "\n", "u,v = uc*1.94384,vc*1.94384 # m/s to knots\n", - "spd = wind_speed(u, v) * units.knots\n", - "dir = wind_direction(u, v) * units.deg" + "spd = wind_speed(u*units.knots, v*units.knots)\n", + "dir = wind_direction(u*units.knots, v*units.knots) * units.deg" ] }, { @@ -1264,7 +1264,7 @@ "\n", "# Draw hodograph\n", "ax_hod = inset_axes(skew.ax, '40%', '40%', loc=2)\n", - "h = Hodograph(ax_hod, component_range=wind_speed(u, v).max())\n", + "h = Hodograph(ax_hod, component_range=wind_speed(u*units.knots, v*units.knots).max()/units.knots)\n", "h.add_grid(increment=20)\n", "h.plot_colormapped(u, v, spd)\n", "\n",