from rsf.proj import *
import rsf.recipes.channelslabel as channels
titles = {'t' : 'convolution (depth refl)',
'tt' : 'convolution (time refl)',
'f' : 'exploding reflector (depth refl)',
'ft' : 'exploding reflector (time refl)',
'c' : 'shot record',
'm' : 'convolution (depth refl)',
'mt' : 'convolution (time refl)',
'i' : 'exploding reflector (depth refl)',
'it' : 'exploding reflector (time refl)',
'j' : 'shot record'}
frq_list = [40]
time_list_2D = ['t','tt','f','ft','c']
depth_list_2D = ['m','mt','i','it','j']
time_list_3D = ['t','tt']
depth_list_3D = ['m','mt']
time_list_3D_slice = []
depth_list_3D_slice = []
from rsf.recipes.beg import server as private
grid_par = {'nx':360, 'dx':15, 'ox':0,
'ny':200, 'dy':15, 'oy':0,
'xy_pad':40}
res_grid_par = grid_par.copy()
res_grid_par['nz'] = 128
res_grid_par['dz'] = 2
res_grid_par['oz'] = -59
ovr_grid_par = grid_par.copy()
ovr_grid_par['nz'] = 64
ovr_grid_par['dz'] = 40
ovr_grid_par['oz'] = 158
geo_par = {
'as_width' : 0.8,
'as_shift' : 0.8,
'as_height0' : 0.5,
'as_height1' : 0.8,
'as_shape' : 1.2,
'bd_depth' : 0.8,
'bd_zshift' : -0.15,
'md_depth' : 1.2,
'md_zshift' : 0.10}
sand_par = {
'bd_sand' : 0.3,
'md_sand' : 0.2,
'as_sand' : 1.0,
'na_sand0' : 0.4,
'na_sand1' : 0.9}
bk_noise_par = {'taper_switch':1,
'std_dev': 0.03,
'alpha':1,
'oriu':[1,0,0],
'oriv':[0,1,0],
'oriw':[0,0,1],
'ru':1000,
'rv':1000,
'rw': 1}
sd_noise_par = {'taper_switch':1,
'std_dev':0.01,
'alpha':1,
'oriu':[1,0,0],
'oriv':[0,1,0],
'oriw':[0,0,1],
'ru':200,
'rv':200,
'rw': 1}
res_taper_par = { 'top_h' : 0,
'top_phi' : 0.3500,
'top_rho' : 1.6865,
'top_vp' : 1964.5730,
'top_vs' : 509.7961,
'bot_h' : 20,
'bot_phi' : 0.1554,
'bot_rho' : 2.3431,
'bot_vp' : 2429.1460,
'bot_vs' : 1019.5922}
ovr_taper_par = { 'top_h' : 2000,
'top_phi' : 0.3500,
'top_rho' : 1.6865,
'top_vp' : 1964.5730,
'top_vs' : 509.7961,
'bot_h' : 0,
'bot_phi' : 0.1554,
'bot_rho' : 2.3431,
'bot_vp' : 2429.1460,
'bot_vs' : 1019.5922}
memsize = 512
channels.make_reservoir ( memsize, private,
res_grid_par, geo_par,
sand_par, bk_noise_par, sd_noise_par,
res_taper_par)
channels.make_overburden (memsize, ovr_grid_par, bk_noise_par, ovr_taper_par)
def tplot2d(par,custom=""):
return '''
window |
grey scalebar=y labelrot=n pclip=100
label1=t label2=x %s
''' % (custom)
def zplot2d(par,custom=""):
return '''
window |
transp |
grey scalebar=y labelrot=n pclip=100
label1=z label2=x %s
''' % (custom)
def tplot3d(par,custom1="",custom2=""):
return '''
transp memsize=%d plane=13 |
byte bar=bar.rsf gainpanel=all pclip=99 %s |
grey3 scalebar=n bar=bar.rsf labelrot=n flat=y
frame1=%d frame2=%d frame3=80
point1=0.85 point2=0.90 screenratio=0.7 screenht=9
label1=y label2=x label3=t %s
''' % (memsize,custom1,par['ypad'],par['xpad'],custom2)
z_slice = res_grid_par['dz']*res_grid_par['nz']+res_grid_par['oz']-10
def zplot3d(par,custom1="",custom2=""):
return '''
byte bar=bar.rsf gainpanel=all pclip=99 %s |
grey3 scalebar=n bar=bar.rsf labelrot=n flat=y
frame1=%d frame2=%d frame3=%d
point1=0.85 point2=0.90 screenratio=0.7 screenht=9
label1=y label2=x label3=z %s
''' % (custom1,par['ypad'],par['xpad'],
z_slice/res_grid_par['dz'],custom2)
par = {
'nt':1000, 'ot':0, 'dt':0.005, 'kt':20,
'nw':501, 'ow':0,
'nx':res_grid_par['nx']+2*res_grid_par['xy_pad'],
'ny':res_grid_par['ny']+2*res_grid_par['xy_pad'],
'nz':res_grid_par['nz'],
'dx':res_grid_par['dx'],
'dy':res_grid_par['dy'],
'dz':res_grid_par['dz'],
'ox':0, 'oy':0, 'oz':0,
'verb':'y','eps':0.01,'nrmax':1,'dtmax':0.00005,
'tmx':16,'tmy':16,'pmx':0,'pmy':0,'misc':'incore=y'
}
par['dw']=1./(par['nt']*par['dt'])
par['xmin']=par['ox']
par['xmax']=par['ox'] + (par['nx']-1) * par['dx']
par['ymin']=par['oy']
par['ymax']=par['oy'] + (par['ny']-1) * par['dy']
par['zmin']=par['oz']
par['zmax']=par['oz'] + (par['nz']-1) * par['dz']
par['xpad']=par['nx']/2.
par['ypad']=par['ny']/2.
par['xsou']=par['ox'] + par['xpad'] * par['dx']
par['ysou']=par['oy'] + par['ypad'] * par['dy']
par['ft']=par['kt']*par['dt']
def flip():
return '''
transp memsize=250 plane=23 |
transp memsize=250 plane=12 |
reverse which=1 opt=i |
put label1=z label2=x label3=y
unit1=m unit2=m unit3=m
'''
Flow('vp0','res_vp_noise_taper',flip() )
Flow('vp1','ovr_vp_noise_taper',flip() )
Flow('ro0','res_rho_noise_taper',flip() )
Flow('ro1','ovr_rho_noise_taper',flip() )
Flow ('den','ro0','window n1=%(nz)d | put o1=0' % par)
Result('lden','den',
'transp plane=13 |'
+ zplot3d(par,'pclip=100 bias=2.1 allpos=y','title="density" color=j'))
Flow( 'vel','vp0', 'window n1=%(nz)d | put o1=0 o3=0' % par)
Result('lvel','vel',
'transp plane=13 |'
+ zplot3d(par,'pclip=100 bias=2297 allpos=y','title="velocity" color=j'))
Flow( 'ovb','vp1', 'window n1=%(nz)d | put o1=0 o3=0' % ovr_grid_par)
Result('lovb','ovb',
'transp plane=13 |'
+ zplot3d(par,'pclip=100 bias=1950 allpos=y',
'title="overburden velocity" frame3=%(nz)d color=j'
% ovr_grid_par))
z_rect = 120
Flow('slo','vel',
'''
math "output=1/input" |
transp memsize=250 plane=12 |
transp memsize=250 plane=23 |
put label1=x label2=y label3=z
unit1=m unit2=m unit3=m
''')
Result('lslo','slo',
'transp memsize=250 plane=12 |'
+ zplot3d(par,'pclip=100 bias=0.00034 allpos=y',
'title="slowness" color=j'))
Flow('slo-s','slo',
'smooth rect1=50 rect2=50 rect3=%d' % (z_rect/res_grid_par['dz']))
Result('lslo-s','slo-s',
'transp memsize=250 plane=12 |'
+ zplot3d(par,'pclip=100 bias=0.00034 allpos=y',
'title="smoothed slowness" color=j'))
Flow('ovs','ovb',
'''
math "output=1/input" |
transp memsize=250 plane=12 |
transp memsize=250 plane=23 |
put label1=x label2=y label3=z
''')
Result('lovs','ovs',
'transp memsize=250 plane=12 |'
+ zplot3d(par,'pclip=100 bias=0.00039 allpos=y',
'title="overburden slowness" frame3=%(nz)d color=j'
% ovr_grid_par))
Flow('ovs-s','ovs',
'smooth rect1=50 rect2=50 rect3=%d' % (z_rect/ovr_grid_par['dz']))
Result('lovs-s','ovs-s',
'transp memsize=250 plane=12 |'
+ zplot3d(par,'pclip=100 bias=0.00039 allpos=y',
'title="smoothed overburden slowness" frame3=%(nz)d color=j'
% ovr_grid_par))
dt_conv = 0.0025
t_window = 0.16
t_frame = 0.12/dt_conv
Flow('aim','vel den','math v=${SOURCES[0]} d=${SOURCES[1]} output=v*d', stdin=0)
Result('laim','aim',
'transp plane=13 |'
+ zplot3d(par,'pclip=100 bias=4.44 allpos=y',
'title="acoustic impedance" color=j'))
Flow('ait',['aim','vel'],
'depth2time velocity=${SOURCES[1]} dt=%g nt=%d | put label1=t unit1=s'
% (dt_conv,par['nt']) )
Result('lait','ait',
'window max1=%g |' % (t_window)
+ tplot3d(par,'pclip=100 bias=4.44 allpos=y',
'title="acoustic impedance" color=j frame3=%d' % (t_frame)))
Flow('reflbl','aim','ai2refl')
Result('reflbl','reflbl',
'transp plane=13 |'
+ zplot3d(par,'','title="reflectivity"'))
End() |