Rich Signell - Oceanographer
US Geological Survey, Woods Hole, MA, USA
Emilio Mayorga - Oceanographer
Applied Physics Lab, University of Washington, Seattle, USA
Northwest Association of Networked Ocean Observing Systems (NANOOS)
In [2]:
from pylab import *
In [3]:
plot(arange(10))
Out[3]:
In [8]:
import pandas as pd
ts = pd.Series(randn(1800), index=pd.date_range('11/24/2013', periods=1800, freq='H'))
ts = ts.cumsum()
ts.plot(figsize=(10,4))
Out[8]:
In [9]:
import netCDF4
import time
In [10]:
#url='http://geoport.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd'
url='/usgs/vault0/coawst/coawst_4/Output/use/coawst_us_20140206_13.nc'
nc = netCDF4.Dataset(url);time0 = time.time()
t = nc.variables['temp'][-10:,:,:,:]
print 'maximum temperature over 10 time steps = %s' % t[~isnan(t)].max()
print 'shape:',shape(t)
print 'size (Mb):', len(t.ravel())*8/1e6
print 'elapsed time = %5.2f seconds ' % (time.time()-time0)
In [ ]: