Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #330 from dopplershift/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
dopplershift authored Aug 30, 2018
2 parents 3893411 + f85cf29 commit 0b0f636
Show file tree
Hide file tree
Showing 6 changed files with 549 additions and 13 deletions.
4 changes: 2 additions & 2 deletions notebooks/CartoPy/CartoPy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@
"source": [
"# Create some synthetic gridded wind data\n",
"import numpy as np\n",
"from metpy.calc import get_wind_speed\n",
"from metpy.calc import wind_speed\n",
"\n",
"# Note that all of these winds have u = 0 -> south wind\n",
"v = np.full((5, 5), 10, dtype=np.float64) + 10 * np.arange(5)\n",
"u = np.zeros_like(v)\n",
"speed = get_wind_speed(u, v)\n",
"speed = wind_speed(u, v)\n",
"x, y = np.meshgrid(np.linspace(-120, -60, 5), np.linspace(25, 50, 5))\n",
"\n",
"# Plot as normal\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/Command_Line_Tools/synopticplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def make_basemap(proj):

# Contour the GFS data
c = ax.contour(gfs_lon_grid, gfs_lat_grid, gfs_data_grid, colors='C3',
lw=2, transform=ccrs.PlateCarree())
linewidths=2, transform=ccrs.PlateCarree())

plt.clabel(c, fontsize=14, inline=1, inline_spacing=1, fmt='%i', rightside_up=True)

Expand Down
6 changes: 3 additions & 3 deletions notebooks/MetPy_Case_Study/MetPy_Case_Study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
"\n",
"MetPy has a large and growing list of functions to calculate many different atmospheric quantities. Here we want to use some classic functions to calculate wind speed, advection, planetary vorticity, relative vorticity, and divergence.\n",
"\n",
"* Wind Speed: `mpcalc.get_wind_speed()`\n",
"* Wind Speed: `mpcalc.wind_speed()`\n",
"* Advection: `mpcalc.advection()`\n",
"* Planetary Vorticity: `mpcalc.coriolis_parameter()`\n",
"* Relative Vorticity: `mpcalc.vorticity()`\n",
Expand Down Expand Up @@ -605,7 +605,7 @@
"\n",
"Calculating wind speed is not a difficult calculation, but MetPy offers a function to calculate it easily keeping units so that it is easy to convert units for plotting purposes.\n",
"\n",
"[`get_wind_speed(uwnd, vwnd)`](https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.get_wind_speed.html#metpy.calc.get_wind_speed)\n",
"[`wind_speed(uwnd, vwnd)`](https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.wind_speed.html#metpy.calc.wind_speed)\n",
"\n",
"**Geostrophic Wind**\n",
"\n",
Expand All @@ -630,7 +630,7 @@
"outputs": [],
"source": [
"# Divergence 300 hPa, Ageostrophic Wind\n",
"wspd_300 = mpcalc.get_wind_speed(uwnd_300, vwnd_300).to('kts')\n",
"wspd_300 = mpcalc.wind_speed(uwnd_300, vwnd_300).to('kts')\n",
"\n",
"div_300 = mpcalc.divergence(uwnd_300, vwnd_300, dx, dy, dim_order='yx')\n",
"ugeo_300, vgeo_300 = mpcalc.geostrophic_wind(hght_300, f, dx, dy, dim_order='yx')\n",
Expand Down
10 changes: 5 additions & 5 deletions notebooks/Metpy_Introduction/Introduction to MetPy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's use the `get_wind_dir` function from MetPy to calculate wind direction from these values. Remember you can look at the docstring or the website for help."
"Let's use the `wind_direction` function from MetPy to calculate wind direction from these values. Remember you can look at the docstring or the website for help."
]
},
{
Expand All @@ -396,7 +396,7 @@
"metadata": {},
"outputs": [],
"source": [
"direction = mpcalc.get_wind_dir(u, v)\n",
"direction = mpcalc.wind_direction(u, v)\n",
"print(direction)"
]
},
Expand All @@ -406,7 +406,7 @@
"source": [
"<div class=\"alert alert-success\">\n",
" <b>EXERCISE</b>:\n",
" <li>Calculate the wind speed using the `get_wind_speed` function.</li>\n",
" <li>Calculate the wind speed using the `wind_speed` function.</li>\n",
" <li>Print the wind speed in m/s and mph.</li>\n",
"</div>"
]
Expand All @@ -427,7 +427,7 @@
"<button data-toggle=\"collapse\" data-target=\"#sol3\" class='btn btn-primary'>View Solution</button>\n",
"<div id=\"sol3\" class=\"collapse\">\n",
"<code><pre>\n",
"speed = mpcalc.get_wind_speed(u, v)\n",
"speed = mpcalc.wind_speed(u, v)\n",
"print(speed)\n",
"print(speed.to('mph'))\n",
"</pre></code>\n",
Expand Down Expand Up @@ -475,7 +475,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.6.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 0b0f636

Please sign in to comment.