seismograms.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:seis_tools 作者: romaguir 项目源码 文件源码
def x_corr(a,b,center_time_s=1000.0,window_len_s=50.0,plot=True):

      center_index = int(center_time_s/a.dt)
      window_index = int(window_len_s/(a.dt))
      print "center_index is", center_index
      print "window_index is", window_index

      t1 = a.trace_x[(center_index - window_index) : (center_index + window_index)]
      t2 = b.trace_x[(center_index - window_index) : (center_index + window_index)]
      print t1

      time_window = np.linspace((-window_len_s/2.0), (window_len_s/2), len(t1))
      #print time_window

      #plt.plot(time_window, t1)
      #plt.plot(time_window, t2)
      #plt.show()

      x_corr_time = correlate(t1, t2)
      delay = (np.argmax(x_corr_time) - (len(x_corr_time)/2) ) * a.dt
      #print "the delay is ", delay
      return delay
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号