In [7]:
# Make it so notebook knows how to access ooitk from the notebook dir
import sys
import os
sys.path.append(os.path.dirname(os.getcwd()))

from matplotlib import ticker
from datetime import datetime
def convert_time(t,p):
    dtg = datetime.utcfromtimestamp(t)
    return dtg.isoformat()

In [2]:
from ooitk.session import ERDDAPSession

erddap_url = 'http://erddap-test.oceanobservatories.org:8080/erddap/tabledap/cd6bf968001a464985d12bd2858b3f94.html'

session = ERDDAPSession(erddap_url)
session.open()

In [9]:
time = session.variables['time'][:]
north = session.variables['turbulent_velocity_north'][:]

Time to plot some variables


In [10]:
pylab.rcParams['figure.figsize'] = (10.0, 8.0)

data_len = len(session.dimensions['row'])
n = 90

step = data_len / n

ax = plt.subplot(111)
ax.set_title('VEL3D')
ax.set_xlabel('Time (s)')
ax.set_ylabel('Northward Velocity (%s)' % str(session.variables['turbulent_velocity_north'].units))

ax.plot(time[::step], north[::step], color='g')
ax.get_xaxis().set_major_formatter(ticker.FuncFormatter(convert_time))
plt.setp(plt.subplot(111).get_xticklabels(), rotation=15)


plt.show()



In [11]:
session.close()

In [ ]: