How to convert reconstructed signal at time into tidal height(m)
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).
Hi @nishadhka . Your code looks correct to me. The tidal height that is returned is in the same units as the tidal solution you've used (which is in meters). So I'm guessing the tidal range of the location that you are looking at just happens to be one meter?
Just to clarify with regards to using 2011: the year numbers in these global solution sets are just version numbers, i.e. the 2011 version is the one they released in 2011 and probably has accuracy improvements over the previous versions. The point of reconstructing from harmonic analysis is that it allows you to do this at an arbitrary point in time (in the past or the future). The only restriction here is if the geometry of the oceans has significantly changed at the scale that these models resolve.