Using IPython Notebook and Wakari for Earth Science Information Workflows

IOOS DMAC Webinar, February 12, 2014

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)

</table>

Interactive exploration


In [2]:
from pylab import *

In [3]:
plot(arange(10))


Out[3]:
[<matplotlib.lines.Line2D at 0x41df350>]

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]:
<matplotlib.axes.AxesSubplot at 0x63e7250>

Perform computations close to data


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)


maximum temperature over 10 time steps = 27.6297
shape: (10, 16, 336, 896)
size (Mb): 385.35168
elapsed time =  3.82 seconds 

In [ ]: