fixed import error and units errors

This commit is contained in:
srcarter3 2020-09-04 10:34:52 -06:00 committed by GitHub
parent a7cb7c55ee
commit 19bab374b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@
"from mpl_toolkits.axes_grid1.inset_locator import inset_axes\n", "from mpl_toolkits.axes_grid1.inset_locator import inset_axes\n",
"from math import exp, log\n", "from math import exp, log\n",
"import numpy as np\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.calc import wind_speed, wind_direction, thermo, vapor_pressure\n",
"from metpy.plots import SkewT, Hodograph\n", "from metpy.plots import SkewT, Hodograph\n",
"from metpy.units import units, concatenate\n", "from metpy.units import units, concatenate\n",
@ -1154,8 +1154,8 @@
"p = prs/100 * units.mbar\n", "p = prs/100 * units.mbar\n",
"\n", "\n",
"u,v = uc*1.94384,vc*1.94384 # m/s to knots\n", "u,v = uc*1.94384,vc*1.94384 # m/s to knots\n",
"spd = wind_speed(u, v) * units.knots\n", "spd = wind_speed(u*units.knots, v*units.knots)\n",
"dir = wind_direction(u, v) * units.deg" "dir = wind_direction(u*units.knots, v*units.knots) * units.deg"
] ]
}, },
{ {
@ -1264,7 +1264,7 @@
"\n", "\n",
"# Draw hodograph\n", "# Draw hodograph\n",
"ax_hod = inset_axes(skew.ax, '40%', '40%', loc=2)\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.add_grid(increment=20)\n",
"h.plot_colormapped(u, v, spd)\n", "h.plot_colormapped(u, v, spd)\n",
"\n", "\n",