This notebook sets up forcing for two storm surge simulations: one during a neap tide and one during a spring tide. The idea is to examine the influence of the tidal dissipation on surge amplitude. The surge from Feb 1-8, 2006 will be used in both simulations. However, I will run over different times in order to capture the spring/neap variability.
Steps:
Ideally each simulation is 7 days long.
import netCDF4 as nc
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime
from dateutil import tz
import os
import glob
from salishsea_tools.nowcast import figures
from salishsea_tools import nc_tools
%matplotlib inline
def dateParserMeasured2(s):
"""
converts string in %d-%b-%Y %H:%M:%S format Pacific time to a datetime object UTC time.
"""
PST=tz.tzoffset("PST",-28800)
#convert the string to a datetime object
unaware = datetime.datetime.strptime(s, "%d-%b-%Y %H:%M:%S ")
#add in the local time zone (Canada/Pacific)
aware = unaware.replace(tzinfo=PST)
#convert to UTC
return aware.astimezone(tz.tzutc())
fname = '/data/nsoontie/MEOPAR/storm-surge/Revisions/tides/analysis/PointAtkinson_t_tide_compare8_31-Dec-2005_02-Jan-2007_snr2_filter.csv'
ttide = pd.read_csv(fname,skiprows=3,parse_dates=[0],date_parser=dateParserMeasured2)
ttide = ttide.rename(columns={'Time_Local ': 'time', ' pred_8 ': 'pred_8', ' pred_all ': 'pred_all'})
to=datetime.datetime(2006,12,1)
tf=datetime.datetime(2006,12,31)
fig,ax=plt.subplots(1,1,figsize=(15,4))
plt.plot(ttide.time, ttide.pred_all)
ax.set_xlim([to,tf])
(732646.0, 732676.0)
Spring surge
Neap surge
First, load the feb 2006 forcing file.
fname = '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/ssh_y2006m02.nc'
res = nc.Dataset(fname)
nc_tools.show_variables(res)
[u'time_counter', u'nav_lat', u'nav_lon', u'sossheig', u'vobtcrtx', u'vobtcrty', u'nbidta', u'nbjdta', u'nbrdta']
ssh = res.variables['sossheig']
time =res.variables['time_counter']
#fboundary parameters
startj = 384
endj = 471
lengthj = endj-startj
r = 1
#load bathy
fB = nc.Dataset('/data/nsoontie/MEOPAR/NEMO-forcing/grid/bathy_meter_SalishSea2.nc','r')
lat = fB.variables['nav_lat'][:]
lon = fB.variables['nav_lon'][:]
fB.close()
def prepare_netcdf(ssh_file, count, ssh):
# dataset attributes
nc_tools.init_dataset_attrs(
ssh_file,
title='Juan de Fuca SSH hourly values',
notebook_name='',
nc_filepath='/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring' + filename,
comment='SSH for Tofino - testing spring/neap effect')
#dimensions
ssh_file.createDimension('xbT', lengthj*r)
ssh_file.createDimension('yb', 1)
ssh_file.createDimension('time_counter', None)
# variables
# time_counter
time_counter = ssh_file.createVariable('time_counter', 'float32', ('time_counter'))
time_counter.long_name = 'Time axis'
time_counter.axis = 'T'
time_counter.units = 'hour since 00:00:00 '
# nav_lat and nav_lon
nav_lat = ssh_file.createVariable('nav_lat','float32',('yb','xbT'))
nav_lat.long_name = 'Latitude'
nav_lat.units = 'degrees_north'
nav_lon = ssh_file.createVariable('nav_lon','float32',('yb','xbT'))
nav_lon.long_name = 'Longitude'
nav_lon.units = 'degrees_east'
# ssh
sossheig = ssh_file.createVariable('sossheig', 'float32',
('time_counter','yb','xbT'), zlib=True)
sossheig.units = 'm'
sossheig.long_name = 'Sea surface height'
sossheig.coordinates = 'nav_lon nav_lat time_counter'
sossheig.grid = 'SalishSea2'
# vobtcrtx, vobtcrty
vobtcrtx = ssh_file.createVariable('vobtcrtx', 'float32',
('time_counter','yb','xbT'), zlib=True)
vobtcrtx.units = 'm/s'
vobtcrtx.long_name = 'Barotropic U Velocity- ZEROD'
vobtcrtx.grid = 'SalishSea2'
vobtcrty = ssh_file.createVariable('vobtcrty', 'float32',
('time_counter','yb','xbT'), zlib=True)
vobtcrty.units = 'm/s'
vobtcrty.long_name = 'Barotropic V Velocity- ZEROD'
vobtcrty.grid = 'SalishSea2'
# nbidta, ndjdta, ndrdta
nbidta = ssh_file.createVariable('nbidta', 'int32' , ('yb','xbT'), zlib=True)
nbidta.long_name = 'i grid position'
nbidta.units = 1
nbjdta = ssh_file.createVariable('nbjdta', 'int32' , ('yb','xbT'), zlib=True)
nbjdta.long_name = 'j grid position'
nbjdta.units = 1
nbrdta = ssh_file.createVariable('nbrdta', 'int32' , ('yb','xbT'), zlib=True)
nbrdta.long_name = 'position from boundary'
nbrdta.units = 1
for ir in range(0,r):
nav_lat[0,ir*lengthj:(ir+1)*lengthj] = lat[startj:endj,ir]
nav_lon[0,ir*lengthj:(ir+1)*lengthj] = lon[startj:endj,ir]
nbidta[0,ir*lengthj:(ir+1)*lengthj] = ir
nbjdta[0,ir*lengthj:(ir+1)*lengthj] = range(startj,endj)
nbrdta[0,ir*lengthj:(ir+1)*lengthj] = ir
for ib in range(0,lengthj*r):
sossheig[0:count,0,ib] = ssh[0:count]
time_counter[0:count] = range(1,count+1)
vobtcrtx[0:count,0,ib] = 0*np.ones(count)
vobtcrty[0:count,0,ib] = 0*np.ones(count)
Loop through Feb 1-10. Create the spring files Dec 1-10, 2006.
start_day = datetime.datetime(2006,12,1)
for d in np.arange(1,11):
day = start_day + datetime.timedelta(days = d-1)
#grab subset of ssh data
ssh_sub = ssh[24*(d-1):24*d,:,:]
print ssh_sub
#print day and time counters for sanity check
print day
print time[24*(d-1):24*d]
# construct file name
filename = day.strftime('ssh_y%Ym%md%d.nc')
ssh_file = nc.Dataset(filename, 'w', zlib=True)
print filename
#construct netcdf
prepare_netcdf(ssh_file,24,ssh_sub)
ssh_file.close()
[[[ 0.67745298 0.67745298 0.67745298 ..., 0.67745298 0.67745298 0.67745298]] [[ 0.81208497 0.81208497 0.81208497 ..., 0.81208497 0.81208497 0.81208497]] [[ 0.86075902 0.86075902 0.86075902 ..., 0.86075902 0.86075902 0.86075902]] ..., [[ 0.27557901 0.27557901 0.27557901 ..., 0.27557901 0.27557901 0.27557901]] [[ 0.33987099 0.33987099 0.33987099 ..., 0.33987099 0.33987099 0.33987099]] [[ 0.37389499 0.37389499 0.37389499 ..., 0.37389499 0.37389499 0.37389499]]] 2006-12-01 00:00:00 [ 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24.] ssh_y2006m12d01.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:02] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.36940199 0.36940199 0.36940199 ..., 0.36940199 0.36940199 0.36940199]] [[ 0.35389999 0.35389999 0.35389999 ..., 0.35389999 0.35389999 0.35389999]] [[ 0.377929 0.377929 0.377929 ..., 0.377929 0.377929 0.377929 ]] ..., [[ 0.21154 0.21154 0.21154 ..., 0.21154 0.21154 0.21154 ]] [[ 0.199637 0.199637 0.199637 ..., 0.199637 0.199637 0.199637 ]] [[ 0.224934 0.224934 0.224934 ..., 0.224934 0.224934 0.224934 ]]] 2006-12-02 00:00:00 [ 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48.] ssh_y2006m12d02.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:02] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.218465 0.218465 0.218465 ..., 0.218465 0.218465 0.218465 ]] [[ 0.20141 0.20141 0.20141 ..., 0.20141 0.20141 0.20141 ]] [[ 0.222629 0.222629 0.222629 ..., 0.222629 0.222629 0.222629 ]] ..., [[ 0.213973 0.213973 0.213973 ..., 0.213973 0.213973 0.213973 ]] [[ 0.216717 0.216717 0.216717 ..., 0.216717 0.216717 0.216717 ]] [[ 0.25186399 0.25186399 0.25186399 ..., 0.25186399 0.25186399 0.25186399]]] 2006-12-03 00:00:00 [ 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72.] ssh_y2006m12d03.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:02] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.31834301 0.31834301 0.31834301 ..., 0.31834301 0.31834301 0.31834301]] [[ 0.41075501 0.41075501 0.41075501 ..., 0.41075501 0.41075501 0.41075501]] [[ 0.47863901 0.47863901 0.47863901 ..., 0.47863901 0.47863901 0.47863901]] ..., [[ 0.497152 0.497152 0.497152 ..., 0.497152 0.497152 0.497152 ]] [[ 0.408452 0.408452 0.408452 ..., 0.408452 0.408452 0.408452 ]] [[ 0.330928 0.330928 0.330928 ..., 0.330928 0.330928 0.330928 ]]] 2006-12-04 00:00:00 [ 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96.] ssh_y2006m12d04.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:02] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.247356 0.247356 0.247356 ..., 0.247356 0.247356 0.247356 ]] [[ 0.20305499 0.20305499 0.20305499 ..., 0.20305499 0.20305499 0.20305499]] [[ 0.178451 0.178451 0.178451 ..., 0.178451 0.178451 0.178451 ]] ..., [[ 0.001747 0.001747 0.001747 ..., 0.001747 0.001747 0.001747 ]] [[-0.0046 -0.0046 -0.0046 ..., -0.0046 -0.0046 -0.0046 ]] [[-0.030398 -0.030398 -0.030398 ..., -0.030398 -0.030398 -0.030398 ]]] 2006-12-05 00:00:00 [ 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120.] ssh_y2006m12d05.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[-0.015177 -0.015177 -0.015177 ..., -0.015177 -0.015177 -0.015177]] [[ 0.004114 0.004114 0.004114 ..., 0.004114 0.004114 0.004114]] [[ 0.026801 0.026801 0.026801 ..., 0.026801 0.026801 0.026801]] ..., [[ 0.111174 0.111174 0.111174 ..., 0.111174 0.111174 0.111174]] [[ 0.122326 0.122326 0.122326 ..., 0.122326 0.122326 0.122326]] [[ 0.096723 0.096723 0.096723 ..., 0.096723 0.096723 0.096723]]] 2006-12-06 00:00:00 [ 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144.] ssh_y2006m12d06.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.082286 0.082286 0.082286 ..., 0.082286 0.082286 0.082286 ]] [[ 0.081318 0.081318 0.081318 ..., 0.081318 0.081318 0.081318 ]] [[ 0.101295 0.101295 0.101295 ..., 0.101295 0.101295 0.101295 ]] ..., [[ 0.14754 0.14754 0.14754 ..., 0.14754 0.14754 0.14754 ]] [[ 0.17461801 0.17461801 0.17461801 ..., 0.17461801 0.17461801 0.17461801]] [[ 0.144858 0.144858 0.144858 ..., 0.144858 0.144858 0.144858 ]]] 2006-12-07 00:00:00 [ 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168.] ssh_y2006m12d07.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[ 0.143169 0.143169 0.143169 ..., 0.143169 0.143169 0.143169]] [[ 0.117628 0.117628 0.117628 ..., 0.117628 0.117628 0.117628]] [[ 0.146513 0.146513 0.146513 ..., 0.146513 0.146513 0.146513]] ..., [[-0.06797 -0.06797 -0.06797 ..., -0.06797 -0.06797 -0.06797 ]] [[-0.08533 -0.08533 -0.08533 ..., -0.08533 -0.08533 -0.08533 ]] [[-0.099235 -0.099235 -0.099235 ..., -0.099235 -0.099235 -0.099235]]] 2006-12-08 00:00:00 [ 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192.] ssh_y2006m12d08.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[-0.099829 -0.099829 -0.099829 ..., -0.099829 -0.099829 -0.099829]] [[-0.085324 -0.085324 -0.085324 ..., -0.085324 -0.085324 -0.085324]] [[-0.109058 -0.109058 -0.109058 ..., -0.109058 -0.109058 -0.109058]] ..., [[-0.10731 -0.10731 -0.10731 ..., -0.10731 -0.10731 -0.10731 ]] [[-0.097291 -0.097291 -0.097291 ..., -0.097291 -0.097291 -0.097291]] [[-0.090911 -0.090911 -0.090911 ..., -0.090911 -0.090911 -0.090911]]] 2006-12-09 00:00:00 [ 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209. 210. 211. 212. 213. 214. 215. 216.] ssh_y2006m12d09.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect [[[-0.086759 -0.086759 -0.086759 ..., -0.086759 -0.086759 -0.086759]] [[-0.069909 -0.069909 -0.069909 ..., -0.069909 -0.069909 -0.069909]] [[-0.04106 -0.04106 -0.04106 ..., -0.04106 -0.04106 -0.04106 ]] ..., [[ 0.013694 0.013694 0.013694 ..., 0.013694 0.013694 0.013694]] [[ 0.038598 0.038598 0.038598 ..., 0.038598 0.038598 0.038598]] [[ 0.017858 0.017858 0.017858 ..., 0.017858 0.017858 0.017858]]] 2006-12-10 00:00:00 [ 217. 218. 219. 220. 221. 222. 223. 224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237. 238. 239. 240.] ssh_y2006m12d10.nc file format: NETCDF4 Conventions: CF-1.6 title: Juan de Fuca SSH hourly values institution: Dept of Earth, Ocean & Atmospheric Sciences, University of British Columbia source: REQUIRED references: REQUIRED history: [2015-05-20 11:11:03] Created netCDF4 zlib=True dataset. comment: SSH for Tofino - testing spring/neap effect
Copy these files into forcing directory
srcdir='.'
dstdir='/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/'
import shutil
for basename in os.listdir(srcdir):
if basename.endswith('.nc'):
pathname = os.path.join(srcdir, basename)
if os.path.isfile(pathname):
shutil.copy2(pathname, dstdir)
Copy files into neap period Dec 11-21, 2011
spring=datetime.datetime(2006,12,1)
neap = datetime.datetime(2006,12,11)
for d in np.arange(1,11):
ds = spring +datetime.timedelta(days=d-1)
dn= neap +datetime.timedelta(days=d-1)
print ds,dn
old = ds.strftime('ssh_y%Ym%md%d.nc')
new = dn.strftime('/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y%Ym%md%d.nc')
print old, new
shutil.copy2(old,new)
2006-12-03 00:00:00 2006-12-11 00:00:00 ssh_y2006m12d03.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d11.nc 2006-12-04 00:00:00 2006-12-12 00:00:00 ssh_y2006m12d04.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d12.nc 2006-12-05 00:00:00 2006-12-13 00:00:00 ssh_y2006m12d05.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d13.nc 2006-12-06 00:00:00 2006-12-14 00:00:00 ssh_y2006m12d06.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d14.nc 2006-12-07 00:00:00 2006-12-15 00:00:00 ssh_y2006m12d07.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d15.nc 2006-12-08 00:00:00 2006-12-16 00:00:00 ssh_y2006m12d08.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d16.nc 2006-12-09 00:00:00 2006-12-17 00:00:00 ssh_y2006m12d09.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d17.nc 2006-12-10 00:00:00 2006-12-18 00:00:00 ssh_y2006m12d10.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d18.nc 2006-12-11 00:00:00 2006-12-19 00:00:00 ssh_y2006m12d11.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d19.nc 2006-12-12 00:00:00 2006-12-20 00:00:00 ssh_y2006m12d12.nc /data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d20.nc
springs = glob.glob('/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/*.nc')
springs.sort(key=os.path.basename)
print springs
['/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d03.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d04.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d05.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d06.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d07.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d08.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d09.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d10.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d11.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d12.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/spring/ssh_y2006m12d7.nc']
neaps = glob.glob('/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/*.nc')
neaps.sort(key=os.path.basename)
print neaps
['/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d11.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d12.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d13.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d14.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d15.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d16.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d17.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d18.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d19.nc', '/data/nsoontie/MEOPAR/NEMO-forcing/open_boundaries/west/ssh/neap/ssh_y2006m12d20.nc']
s_ssh=np.array([])
n_ssh =np.array([])
for s,n in zip(springs,neaps):
fs=nc.Dataset(s)
s1=fs.variables['sossheig'][:,0,1]
s_ssh=np.append(s_ssh,s1)
fn=nc.Dataset(n)
n1=fn.variables['sossheig'][:,0,1]
n_ssh=np.append(n_ssh,n1)
fig,ax=plt.subplots(1,1)
ax.plot(s_ssh)
ax.plot(n_ssh)
[<matplotlib.lines.Line2D at 0x7f96c9198a50>]
Looks like a match.