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
####################################################################################
评论列表
文章目录