def dZ_at_t(self, t):
"""
Interpolate dZ to specified time t and return deformation.
"""
from matplotlib.mlab import find
if t <= self.times[0]:
return self.dZ[0,:,:]
elif t >= self.times[-1]:
return self.dZ[-1,:,:]
else:
n = max(find(self.times <= t))
t1 = self.times[n]
t2 = self.times[n+1]
dz = (t2-t)/(t2-t1) * self.dZ[n,:,:] + \
(t-t1)/(t2-t1) * self.dZ[n+1,:,:]
return dz
dtopotools_horiz_okada_and_1d.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录