In [52]:
import netCDF4
from pylab import *
In [63]:
#aggregation
url='http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/SJROFS/fmrc/Aggregated_7_day_SJROFS_Fields_Forecast_best.ncd'
#non aggregation
url='http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/SJROFS/MODELS/201405/nos.sjrofs.fields.forecast.20140506.t17z.nc'
nc = netCDF4.Dataset(url)
ncv = nc.variables
In [64]:
t=ncv['time'][:]
plot(t,'o-')
Out[64]:
In [65]:
plot(diff(t),'o-')
Out[65]:
In [66]:
dt= diff(t)
In [73]:
dt[:10]*3600*24 # delta t in seconds
Out[73]:
In [68]:
lon = ncv['lon'][:]
lat = ncv['lat'][:]
In [69]:
lon.min()
Out[69]:
In [70]:
lon.max()
Out[70]:
In [71]:
lat.min()
Out[71]:
In [72]:
lat.max()
Out[72]:
In [76]:
shape(lon)
Out[76]:
In [77]:
lon[0:2,0:2
]
Out[77]:
In [89]:
lon=ma.masked_where(lon>=0,lon)
lat=ma.masked_where(lat<=0,lat)
In [90]:
lon.min()
Out[90]:
In [91]:
lon.max()
Out[91]:
In [92]:
lat.min()
Out[92]:
In [93]:
lat.max()
Out[93]:
In [96]:
plot(lon,lat,lon.T,lat.T);
In [ ]: