Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions failing_notebooks/Siphon Radar Server.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import cartopy\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"from metpy.plots import ctables # For NWS colortable\n",
"\n",
"# Create projection centered on the radar. This allows us to use x\n",
Expand All @@ -562,7 +562,7 @@
"fig = plt.figure(figsize=(10, 10))\n",
"ax = fig.add_subplot(1, 1, 1, projection=proj)\n",
"\n",
"ax.add_feature(cfeat.STATES.with_scale('50m'), linewidth=2)\n",
"ax.add_feature(cfeature.STATES.with_scale('50m'), linewidth=2)\n",
"\n",
"# Set limits in lat/lon space\n",
"ax.set_extent([data.RadarLongitude - 2.5, data.RadarLongitude + 2.5,\n",
Expand Down
4 changes: 2 additions & 2 deletions failing_notebooks/python-awips/Satellite_Imagery.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"source": [
"from awips.dataaccess import DataAccessLayer\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"import matplotlib.pyplot as plt\n",
"from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER\n",
"import numpy as np\n",
Expand Down Expand Up @@ -146,7 +146,7 @@
"\n",
"fig, ax = make_map(bbox=bbox)\n",
"# State boundaries\n",
"states = cfeat.NaturalEarthFeature(category='cultural',\n",
"states = cfeature.NaturalEarthFeature(category='cultural',\n",
" name='admin_1_states_provinces_lakes',\n",
" scale='50m', facecolor='none')\n",
"ax.add_feature(states, linestyle=':')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER\n",
"\n",
"\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"from cartopy.feature import ShapelyFeature,NaturalEarthFeature\n",
"from shapely.geometry import Polygon\n",
"from awips.tables import vtec\n",
Expand Down Expand Up @@ -325,7 +325,7 @@
"metadata": {},
"outputs": [],
"source": [
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"from cartopy.feature import ShapelyFeature\n",
"from shapely.geometry import Polygon\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/Bonus/Downloading GFS with Siphon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
"source": [
"import matplotlib.pyplot as plt\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"from metpy.plots import ctables\n",
"\n",
"# Create a new figure\n",
Expand All @@ -539,7 +539,7 @@
"ax.set_extent([-100.03, -111.03, 35, 43])\n",
"\n",
"# Retrieve the state boundaries using cFeature and add to plot\n",
"ax.add_feature(cfeat.STATES, edgecolor='gray')\n",
"ax.add_feature(cfeature.STATES, edgecolor='gray')\n",
"\n",
"# Contour temperature at each lat/long\n",
"contours = ax.contourf(lon_2d, lat_2d, temp_2d.to('degF'), 200, transform=ccrs.PlateCarree(),\n",
Expand Down
32 changes: 16 additions & 16 deletions notebooks/CartoPy/CartoPy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,21 @@
"outputs": [],
"source": [
"# import cartopy's collection of map features\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"\n",
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(1, 1, 1, projection=ccrs.LambertConformal())\n",
"\n",
"# Add variety of features\n",
"ax.add_feature(cfeat.LAND)\n",
"ax.add_feature(cfeat.OCEAN)\n",
"ax.add_feature(cfeat.COASTLINE)\n",
"ax.add_feature(cfeature.LAND)\n",
"ax.add_feature(cfeature.OCEAN)\n",
"ax.add_feature(cfeature.COASTLINE)\n",
"\n",
"# Can also supply matplotlib kwargs\n",
"ax.add_feature(cfeat.BORDERS, linestyle=':')\n",
"ax.add_feature(cfeat.STATES, linestyle=':')\n",
"ax.add_feature(cfeat.LAKES, alpha=0.5)\n",
"ax.add_feature(cfeat.RIVERS, edgecolor='tab:green')\n",
"ax.add_feature(cfeature.BORDERS, linestyle=':')\n",
"ax.add_feature(cfeature.STATES, linestyle=':')\n",
"ax.add_feature(cfeature.LAKES, alpha=0.5)\n",
"ax.add_feature(cfeature.RIVERS, edgecolor='tab:green')\n",
"\n",
"ax.set_extent([-130, -60, 20, 55])"
]
Expand Down Expand Up @@ -264,9 +264,9 @@
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(1, 1, 1, projection=ccrs.LambertConformal())\n",
"\n",
"ax.add_feature(cfeat.COASTLINE)\n",
"ax.add_feature(cfeat.BORDERS, linewidth=2)\n",
"ax.add_feature(cfeat.STATES, linestyle=\"--\", edgecolor='black')\n",
"ax.add_feature(cfeature.COASTLINE)\n",
"ax.add_feature(cfeature.BORDERS, linewidth=2)\n",
"ax.add_feature(cfeature.STATES, linestyle=\"--\", edgecolor='black')\n",
"\n",
"ax.plot(-105, 40, marker='o', color='tab:red')\n",
"\n",
Expand All @@ -289,9 +289,9 @@
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(1, 1, 1, projection=ccrs.LambertConformal())\n",
"\n",
"ax.add_feature(cfeat.COASTLINE)\n",
"ax.add_feature(cfeat.BORDERS, linewidth=2)\n",
"ax.add_feature(cfeat.STATES, linestyle=\"--\", edgecolor='black')\n",
"ax.add_feature(cfeature.COASTLINE)\n",
"ax.add_feature(cfeature.BORDERS, linewidth=2)\n",
"ax.add_feature(cfeature.STATES, linestyle=\"--\", edgecolor='black')\n",
"\n",
"data_projection = ccrs.PlateCarree()\n",
"ax.plot(-105, 40, marker='o', color='tab:red', transform=data_projection)\n",
Expand Down Expand Up @@ -326,8 +326,8 @@
"fig = plt.figure(figsize=(10, 8))\n",
"ax = fig.add_subplot(1, 1, 1, projection=ccrs.LambertConformal())\n",
"\n",
"ax.add_feature(cfeat.COASTLINE)\n",
"ax.add_feature(cfeat.BORDERS, linewidth=2)\n",
"ax.add_feature(cfeature.COASTLINE)\n",
"ax.add_feature(cfeature.BORDERS, linewidth=2)\n",
"\n",
"# Plot wind barbs--CartoPy handles reprojecting the vectors properly for the\n",
"# coordinate system\n",
Expand Down
10 changes: 5 additions & 5 deletions notebooks/CartoPy/solutions/map.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(1, 1, 1, projection=ccrs.Mercator())

ax.add_feature(cfeat.COASTLINE)
ax.add_feature(cfeat.LAND, facecolor='tab:brown')
ax.add_feature(cfeat.OCEAN, facecolor='tab:cyan')
ax.add_feature(cfeat.BORDERS, linewidth=2)
ax.add_feature(cfeat.STATES, linestyle="--", edgecolor='black')
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.LAND, facecolor='tab:brown')
ax.add_feature(cfeature.OCEAN, facecolor='tab:cyan')
ax.add_feature(cfeature.BORDERS, linewidth=2)
ax.add_feature(cfeature.STATES, linestyle="--", edgecolor='black')

ax.plot(-101.877, 33.583, marker='o', color='tab:green', transform=ccrs.PlateCarree())

Expand Down
6 changes: 3 additions & 3 deletions notebooks/Command_Line_Tools/synopticplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import argparse
import cartopy.crs as ccrs
import cartopy.feature as cfeat
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import netCDF4
import numpy as np
Expand Down Expand Up @@ -117,8 +117,8 @@ def make_basemap(proj):
"""
fig = plt.figure(figsize=(10.5, 7))
ax = fig.add_subplot(1, 1, 1, projection=proj)
ax.add_feature(cfeat.STATES, linestyle=':')
ax.add_feature(cfeat.COASTLINE)
ax.add_feature(cfeature.STATES, linestyle=':')
ax.add_feature(cfeature.COASTLINE)

return fig, ax

Expand Down
13 changes: 4 additions & 9 deletions notebooks/GOES_RGB_Demo/GOES_False_Color_RGB.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"from datetime import datetime\n",
"\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib import patheffects\n",
"from metpy.plots import add_metpy_logo\n",
Expand Down Expand Up @@ -152,19 +152,14 @@
" latitude_true_scale=proj_var.standard_parallel,\n",
" globe=globe)\n",
"\n",
"# Set up a feature for the state/province lines. Tell cartopy not to fill in the polygons\n",
"state_boundaries = cfeat.NaturalEarthFeature(category='cultural',\n",
" name='admin_1_states_provinces_lakes',\n",
" scale='50m', facecolor='none')\n",
"\n",
"# Same as before, except we call imshow with our colormap and norm.\n",
"fig = plt.figure(figsize=(20, 20))\n",
"ax = fig.add_subplot(1, 1, 1, projection=proj)\n",
"\n",
"im = ax.imshow(rgb_data, extent=(x.min(), x.max(), y.min(), y.max()), origin='upper')\n",
"ax.coastlines(resolution='50m', color='black')\n",
"ax.add_feature(state_boundaries, linestyle=':', edgecolor='black')\n",
"ax.add_feature(cfeat.BORDERS, linewidth=2, edgecolor='black')\n",
"ax.add_feature(cfeature.STATES, linestyle=':')\n",
"ax.add_feature(cfeature.BORDERS, linewidth=2)\n",
"\n",
"# Add text (aligned to the right); save the returned object so we can manipulate it.\n",
"text_time = ax.text(0.99, 0.01, timestamp.strftime('%d %B %Y %H%MZ'),\n",
Expand Down Expand Up @@ -201,7 +196,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.6.4"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/GOES_RGB_Demo/GOES_RGB_Image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"from datetime import datetime\n",
"\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib import patheffects\n",
"from metpy.plots import add_metpy_logo\n",
Expand Down Expand Up @@ -201,7 +201,7 @@
" globe=globe)\n",
"\n",
"# Set up a feature for the state/province lines. Tell cartopy not to fill in the polygons\n",
"state_boundaries = cfeat.NaturalEarthFeature(category='cultural',\n",
"state_boundaries = cfeature.NaturalEarthFeature(category='cultural',\n",
" name='admin_1_states_provinces_lakes',\n",
" scale='50m', facecolor='none')\n",
"\n",
Expand All @@ -212,7 +212,7 @@
"im = ax.imshow(rgb_data, extent=(x.min(), x.max(), y.min(), y.max()), origin='upper')\n",
"ax.coastlines(resolution='50m', color='black')\n",
"ax.add_feature(state_boundaries, linestyle=':', edgecolor='black')\n",
"ax.add_feature(cfeat.BORDERS, linewidth=2, edgecolor='black')\n",
"ax.add_feature(cfeature.BORDERS, linewidth=2, edgecolor='black')\n",
"\n",
"# Add text (aligned to the right); save the returned object so we can manipulate it.\n",
"text_time = ax.text(0.99, 0.01, timestamp.strftime('%d %B %Y %H%MZ'),\n",
Expand Down
14 changes: 7 additions & 7 deletions notebooks/MetPy_Case_Study/MetPy_Case_Study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"from datetime import datetime\n",
"\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"from netCDF4 import Dataset, num2date\n",
"import numpy as np\n",
"from scipy.ndimage import gaussian_filter\n",
Expand Down Expand Up @@ -620,7 +620,7 @@
" ax=plt.subplot(111, projection=plotproj)\n",
" ax.set_extent([-125, -73, 25, 50],ccrs.PlateCarree())\n",
" ax.coastlines('50m', linewidth=0.75)\n",
" ax.add_feature(cfeat.STATES, linewidth=0.5)\n",
" ax.add_feature(cfeature.STATES, linewidth=0.5)\n",
" return fig, ax"
]
},
Expand Down Expand Up @@ -848,7 +848,7 @@
"ax=plt.subplot(221,projection=plotproj)\n",
"ax.set_extent([-125.,-73,25.,50.],ccrs.PlateCarree())\n",
"ax.coastlines('50m', linewidth=0.75)\n",
"ax.add_feature(cfeat.STATES,linewidth=0.5)\n",
"ax.add_feature(cfeature.STATES,linewidth=0.5)\n",
"\n",
"# Contour #1\n",
"clev500 = np.arange(0,7000,60)\n",
Expand Down Expand Up @@ -879,7 +879,7 @@
"ax=plt.subplot(222,projection=plotproj)\n",
"ax.set_extent([-125.,-73,25.,50.],ccrs.PlateCarree())\n",
"ax.coastlines('50m', linewidth=0.75)\n",
"ax.add_feature(cfeat.STATES, linewidth=0.5)\n",
"ax.add_feature(cfeature.STATES, linewidth=0.5)\n",
"\n",
"# Contour #1\n",
"clev500 = np.arange(0,7000,60)\n",
Expand Down Expand Up @@ -910,7 +910,7 @@
"ax=plt.subplot(223,projection=plotproj)\n",
"ax.set_extent([-125.,-73,25.,50.],ccrs.PlateCarree())\n",
"ax.coastlines('50m', linewidth=0.75)\n",
"ax.add_feature(cfeat.STATES, linewidth=0.5)\n",
"ax.add_feature(cfeature.STATES, linewidth=0.5)\n",
"\n",
"# Contour #1\n",
"clev500 = np.arange(0,7000,60)\n",
Expand Down Expand Up @@ -941,7 +941,7 @@
"ax=plt.subplot(224,projection=plotproj)\n",
"ax.set_extent([-125.,-73,25.,50.],ccrs.PlateCarree())\n",
"ax.coastlines('50m', linewidth=0.75)\n",
"ax.add_feature(cfeat.STATES, linewidth=0.5)\n",
"ax.add_feature(cfeature.STATES, linewidth=0.5)\n",
"\n",
"# Contour #1\n",
"clev500 = np.arange(0,7000,60)\n",
Expand Down Expand Up @@ -1033,7 +1033,7 @@
"ax = plt.subplot(111,projection=ccrs.LambertConformal(central_latitude=50,central_longitude=-107))\n",
"ax.set_extent([LLlon,URlon,LLlat,URlat],ccrs.PlateCarree())\n",
"ax.coastlines('50m', edgecolor='grey', linewidth=0.75)\n",
"ax.add_feature(cfeat.STATES, edgecolor='grey', linewidth=0.5)\n",
"ax.add_feature(cfeature.STATES, edgecolor='grey', linewidth=0.5)\n",
"\n",
"# Set up station plotting using only every third element from arrays for plotting\n",
"stationplot = StationPlot(ax, lon[skip_points].ravel()[mask],\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/MetPy_Case_Study/solutions/map_data_500.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
proj = ccrs.LambertConformal(central_latitude=50, central_longitude=-107)
ax = plt.subplot(111, projection=proj)
ax.coastlines('50m', edgecolor='grey', linewidth=0.75)
ax.add_feature(cfeat.STATES, edgecolor='grey', linewidth=0.5)
ax.add_feature(cfeature.STATES, edgecolor='grey', linewidth=0.5)

# Set up station plotting using only every third
# element from arrays for plotting
Expand Down
2 changes: 1 addition & 1 deletion notebooks/Metpy_Introduction/solutions/intro_calc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
speed = mpcalc.get_wind_speed(u, v)
print(speed)
print(speed.to('mph'))
print(speed.to('mph'))
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
temperature_change_rate = -2.3 * units.delta_degF / (10 * units.minutes)
temperature = 25 * units.degC
dt = 1.5 * units.hours
print(temperature + temperature_change_rate * dt)
print(temperature + temperature_change_rate * dt)
2 changes: 1 addition & 1 deletion notebooks/Metpy_Introduction/solutions/intro_units.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speed = 25 * units.knots
time = 1 * units.fortnight
distance = speed * time
print(distance.to('furlongs'))
print(distance.to('furlongs'))
10 changes: 5 additions & 5 deletions notebooks/Model_Output/Downloading model fields with NCSS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
"source": [
"%matplotlib inline\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeat\n",
"import cartopy.feature as cfeature\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# GFS uses lon/lat grid\n",
Expand All @@ -258,8 +258,8 @@
"\n",
"# add some common geographic features\n",
"ax.coastlines(resolution='10m', color='black')\n",
"ax.add_feature(cfeat.STATES, edgecolor='black')\n",
"ax.add_feature(cfeat.BORDERS)\n",
"ax.add_feature(cfeature.STATES, edgecolor='black')\n",
"ax.add_feature(cfeature.BORDERS)\n",
"\n",
"# add some lat/lon gridlines\n",
"ax.gridlines()\n",
Expand Down Expand Up @@ -310,8 +310,8 @@
"\n",
"# add some common geographic features\n",
"ax.coastlines(resolution='10m', color='black')\n",
"ax.add_feature(cfeat.STATES, edgecolor='black')\n",
"ax.add_feature(cfeat.BORDERS)\n",
"ax.add_feature(cfeature.STATES, edgecolor='black')\n",
"ax.add_feature(cfeature.BORDERS)\n",
"\n",
"# add some lat/lon gridlines\n",
"ax.gridlines()"
Expand Down
4 changes: 2 additions & 2 deletions notebooks/Model_Output/solutions/model_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

# add some common geographic features
ax.coastlines(resolution='10m', color='black')
ax.add_feature(cfeat.STATES, edgecolor='black')
ax.add_feature(cfeat.BORDERS)
ax.add_feature(cfeature.STATES, edgecolor='black')
ax.add_feature(cfeature.BORDERS)

# add some lat/lon gridlines
ax.gridlines()
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
ax.grid(True)
ax.set_xlabel('Time')
ax.xaxis.set_major_formatter(DateFormatter('%m/%d'))
ax.xaxis.set_major_locator(DayLocator())
ax.xaxis.set_major_locator(DayLocator())
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
ax.grid(True)
ax.set_xlabel('Time')
ax.xaxis.set_major_formatter(DateFormatter('%m/%d'))
ax.xaxis.set_major_locator(DayLocator())
ax.xaxis.set_major_locator(DayLocator())
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
for i, item in enumerate(zip(my_list, my_other_list)):
reference, quote = item
print(i, ' - ', reference, ' - ', quote)
print(i, ' - ', reference, ' - ', quote)
Loading