def gravityeffect(h0,s0,p0,tl,amp,phases):
"""
purpose: To compute the gravity effect due to each
tidal component.
"""
dtor = np.pi/180
R90 = np.pi/2
R360 = np.pi*2
p0 = np.remainder(p0,R360)
h0 = np.remainder(h0,R360)
s0 = np.remainder(s0,R360)
tl = np.remainder(tl,R360)
arg=np.zeros(11)
# argument component
arg[0] = 2*tl - 2*s0 # M2
arg[1] = 2*tl - 2*h0 # S2
arg[2] = tl - R90 # K1
arg[3] = tl - 2*s0 + R90 # O1
arg[4] = 2*tl - 3*s0 + p0 # N2
arg[5] = tl - 2*h0 + R90 # P1
arg[6] = 2*tl # K2
arg[7] = tl - 3*s0 + p0 +R90 # Q1
arg[8] = 2*s0 # Mf
arg[9] = s0 - p0 # Mm
arg[10] = 2*h0 # Ssa
totaleffect=np.sum([amp[i]*np.cos(arg[i] - phases[i]*dtor) for i in range(len(arg))])
return totaleffect
评论列表
文章目录