Using IPython Notebook and Wakari for Earth Science Information Workflows

ESIP Rant and Rave, February 6, 2014

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

Interactive exploration


In [54]:
from pylab import *

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


Out[55]:
[<matplotlib.lines.Line2D at 0xeab02d0>]

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

Perform computations close to data


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)


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

In [ ]: