receiver_functions.py 文件源码

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

项目:seis_tools 作者: romaguir 项目源码 文件源码
def rf_moveout_correction(rf_trace,table='None'):
####################################################################################
   '''
   takes a receiver function trace in the rfh5 format. if table = 'None', the slowness
   lookup table will be read.  alternatively if calling this function repeatedly, pass 
   the table as an argument to avoid repetative i/o.
   '''

   if table == 'None':
      slowness_table = np.loadtxt('/geo/work10/romaguir/seismology/seis_tools/seispy/slowness_table.dat')
   else:
      slowness_table = table

   p = slowness_table[:,0]
   s = slowness_table[:,1]

   #interpolate with np.interp. make sure values in the first vector are increasing
   scale = np.interp(rf_trace.stats.ray_param,p[::-1],s[::-1])

   #scale the receiver function and interpolate new time axis
   time = np.linspace(0,rf_trace.stats.delta*rf_trace.stats.npts,rf_trace.stats.npts)
   new_time = time * scale

   f        = interp1d(new_time,rf_trace.data,bounds_error=False,fill_value=0)
   rf_mvc   = f(time)
   rf_trace.data = rf_mvc

   return rf_trace

####################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号