Rich Signell - Oceanographer
US Geological Survey, Woods Hole, MA, USA
Massimo Di Stefano - Software Engineer
Rensselaer Polytechnic Institute (RPI), NY, USA
Woods Hole Oceanographic Institution, Woods Hole, MA, USA
|
|
|
|
In [54]:
from pylab import *
In [55]:
plot(arange(10))
Out[55]:
In [58]:
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[58]:
In [59]:
import netCDF4
import time
In [60]:
#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 [ ]: