2
$\begingroup$

I am trying to reconstruct the astronomical tide time series from harmonic constituents (calculated from T_Tide).I am using the equation that all knows H(t) = Amplitude * cos ( t * harmonicSpeed + phase lag), I wrote my script in python. The output is not matching with the tide predicction (from the T_Tide file). As you know the construction is very simple but I am thinking that my problem is about the sampling interval, I really don´t know how to interpret it for this case, I wrote 1/24 due to the input time (for calculating in T_TIDE , hourly data), I am not sure about this.

I share the harmonic constants file from T_Tide and the tide predicction values file (hourly , which I want to reproduce). They are https://github.com/feraxel/Harmonic-constans/commit/fb11b9ef9909b03e722978ccfa102fc7b9fd1f01#diff-09639ac17104196efd895598afe1af5234cbb5bcac39070e4a3d9133c611a4ea and https://github.com/feraxel/Harmonic-constans/commit/1e46d1d416c49ef131005d8fa68775f9169c0270#diff-545b5ec39a1b72b56fa5e37c33afb30a3c3c39ba0e6fe1d583b4a1d77e9fc74a

os.chdir(r'directory') # change the file.txt directory
con =  pd.read_csv('harmonics_aca.txt',sep=' ') # We load the harmonic constants
We create a datetime vector for concatenate to the constructed tide
date = pd.date_range(start='01/02/2018 22:00:00', end='05/30/2022 15:00:00',freq='H') 
datetime = pd.DataFrame({'Fecha':date})

tide = 0 
H = [] # This vector save the tide for the t time 
dt = 1/24 #####Sampling interval 
for t in np.arange(0,len(fecha)*dt,dt):
    Am = con.iloc[i,2] # Harmonic constituent amplitude
    Ph = np.deg2rad(con.iloc[i,4]) # Harmonic constituent phase
    Fr = (con.iloc[i,1]*2*np.pi)  # Frecuency (1/Hours)*2*pi
    level = Am*np.cos(Fr*t - Ph)
    tide = tide+level

H.append(tide)
tide = 0
$\endgroup$

1 Answer 1

1
$\begingroup$

My recommendation is that you check the tidal prediction code provided with t_tide (t_predic). In there, you will find a piece of code like this:

ap=tidecon(:,1)/2.*exp(-i*tidecon(:,3)*pi/180); am=conj(ap);

You can check that you are doing that part correctly up to there.

The other important part is the astronomical nodal modulation correction. That is the difference in phase for your specific location. The code for that is given in t_vuf.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.