我正在努力了解如何使用谐波常数创建潮汐预测表.
并使用这个python脚本来总结潮汐成分 –
import math
import time
tidalepoch = 0
epoch = time.mktime(time.gmtime()) - tidalepoch
f = open('bridgeport.txt', 'r')
M_PI = 3.14159
lines = f.readlines()
t = epoch - 24 * 3600
i = -24
while t < epoch:
height = 0
for line in lines:
x = line.split()
A = float(x[2]) # amplitude
B = float(x[3]) # phase
B *= M_PI / 180.0
C = float(x[4]) # speed
C *= M_PI / 648000
# h = R cost (wt - phi)
height += A * math.cos(C * t - B)
print str(i) + " " + str(height + 3.61999)
i += 1
t += 3600
每小时打印一个高度“今天”.最终的高度在我预期的范围内,为-0.5至7.5英尺,但在当日不正确.
我在正确的轨道上吗?如何确定潮汐时期