In [1]:
import pandas as pd
In [2]:
start='2012-06-30T09:30:00Z'
stop='2012-06-30T15:00:00Z'
In [3]:
from IPython.core.display import HTML
HTML('<iframe src=http://tidesandcurrents.noaa.gov/tsunami/ width=900 height=600></iframe>')
Out[3]:
In [4]:
def coops2df(sta='8447930',start='2013-06-13T18:30:00Z',stop='2013-06-13T23:00:00Z'):
url='http://opendap.co-ops.nos.noaa.gov/ioos-dif-sos/SOS?\
request=GetObservation&service=SOS&responseFormat=text/csv&version=1.0.0&\
offering=urn:ioos:station:NOAA.NOS.CO-OPS:%s&\
observedProperty=water_surface_height_above_reference_datum&\
dataType=PreliminaryOneMinute&\
eventTime=%s/%s' % (sta,start,stop)
df = pd.read_csv(url,index_col='date_time',parse_dates=True)
print url
return df
In [5]:
stas = {}
stas['montauk']='8510560'
stas['woods hole']='8447930'
stas['nantucket']='8449130'
stas['newport']='8452660'
stas['atlantic city']='8534720'
stas['sandy hook']='8531680'
stas['quonset']='8454049'
stas['mystic']='8465705'
stas['battery']='8518750'
stas['lewes']='8557380'
df={}
for sta_name,sta_id in stas.iteritems():
df[sta_name]=coops2df(sta=sta_id,start=start,stop=stop)
# df[sta_name]=coops2df(sta=sta_id,start='2013-06-13T17:30:00Z',stop='2013-06-13T22:00:00Z')
# df[sta_name]=coops2df(sta=sta_id,start='2013-04-11T03:00:00Z',stop='2013-04-11T09:00:00Z')
In [32]:
panel = pd.Panel(df)
In [33]:
slice = panel.minor_xs('water_surface_height_above_reference_datum (m)')
In [34]:
slice[['woods hole','atlantic city','montauk']].plot(figsize=(20,6),title='East Coast water levels (m)');
In [35]:
# NDBC Rest
def ndbc2df(sta='8447930',start='2013-06-13T18:30:00Z',stop='2013-06-13T23:00:00Z'):
url='http://sdf.ndbc.noaa.gov/sos/server.php?request=GetObservation&service=SOS&version=1.0.0&\
offering=urn:ioos:station:wmo:%s&\
observedproperty=sea_floor_depth_below_sea_surface&responseformat=text/csv&\
eventtime=%s/%s' % (sta,start,stop)
df = pd.read_csv(url,index_col='date_time',parse_dates=True)
print url
return df
In [45]:
# Dart Buoy in 1500m water, northeast of Hudson Canyon
sta_id='44402'
In [46]:
df_dart=ndbc2df(sta=sta_id,start=start,stop=stop)
In [47]:
df_dart['sea_floor_depth_below_sea_surface (m)'].plot(figsize=(20,6))
Out[47]:
In [48]:
df_event1=df_dart['2013-6-13 16:45:00':'2013-6-13 17:45:00']
df_event1['sea_floor_depth_below_sea_surface (m)'].plot(figsize=(20,6))
In [ ]:
df_event2=df_dart['2013-6-13 19:45:00':'2013-6-13 20:45:00']
df_event2['sea_floor_depth_below_sea_surface (m)'].plot(figsize=(20,6))
In [ ]:
# 60 km/hr, 90 km/hr, 90 km/hr
In [ ]:
g=9.81
c=60.0 * 1000./3600 # convert km/hr to m/s
h = (c*c)/g
print h
In [ ]:
c=90.0 * 1000./3600 # convert km/hr to m/s
h = (c*c)/g
print h
In [ ]: