Load my Hurricane Sandy model results

In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import netCDF4
In [2]:
nc = netCDF4.Dataset('http://jetstream.signell.us/thredds/dodsC/local/Sandy_ocean_his.nc')
%time temp = nc['temp'][1,:,:,:]
CPU times: user 4 ms, sys: 4 ms, total: 8 ms
Wall time: 26.1 ms
In [3]:
nc = netCDF4.Dataset('Sandy_ocean_his.nc')
%time temp = nc['temp'][-1,:,:,:]
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 977 ┬Ás
In [4]:
import cartopy.crs as ccrs
from cartopy.feature import NaturalEarthFeature, COLORS
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
In [5]:
LAND = NaturalEarthFeature('physical', 'land', '10m', edgecolor='face', facecolor=COLORS['land'])
In [6]:
nc['temp'].shape
Out[6]:
(97, 16, 64, 84)
In [7]:
lon = nc['lon_rho'][:]
lat = nc['lat_rho'][:]

crs = ccrs.PlateCarree()

fig, ax = plt.subplots(figsize=(10,8),subplot_kw=dict(projection=ccrs.Mercator()))

ax.set_extent([lon.min(), lon.max(), lat.min(), lat.max()])
ax.add_feature(LAND)
ax.coastlines(resolution='10m')
gl = ax.gridlines(draw_labels=True)
gl.xlabels_top = gl.ylabels_right = False
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER

p = ax.pcolormesh(lon, lat, nc['Hwave'][50,:,:], transform = crs);
plt.colorbar(p);