-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Thanks for the library. I did following steps for generating tidal signals for a coastal location using Indian Ocean TPXO tidal solution. Initial time being set at 20110101, as the tidal solution being used is TPXO 2011.
import uptide
from datetime import datetime, timedelta
import pytz
import numpy as np
klkta = pytz.timezone('Asia/Kolkata')
tide = uptide.Tides(['M2', 'S2', 'N2', 'K2', 'O1', 'P1', 'Q1', 'M4']) # select which constituents to use
tide.set_initial_time(datetime.datetime(2011,1,1,0,0,0, tzinfo=klkta))
grid_file = 'DATA_IO/gridIO_atlas.nc'
data_file = 'DATA_IO/hf.IO_2011atlas.nc'
tnci = uptide.OTPSncTidalInterpolator(tide, grid_file, data_file)
#setting datetime starting at 2011 and predict for date 20210119
d0 = datetime.strptime('20110101', '%Y%m%d')
d1 = datetime.strptime(s_date, '%Y%m%d')
d2=d1+ timedelta(days=7)
delta_0 = d1 - d0
delta_1 = d2 - d0
ttime=np.arange(delta_0.days*24*3600,delta_1.days*24*3600,600)
lon=72.75
lat=19.45
tnci.set_time(ttime[0])
loc_x=(lon,lat)
eta = tdsol.get_val(loc_x)
The eta is ranging between -1 to 1, how to convert it into tidal height in meters specific to the location(lat,lon).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels