from rsf.proj import *
import math
p1=0.7
sr=1.0
sw=7.0
sh=10.0
xll=2.0
fat=2
nx=101
delx=0.0125*2
ox=-1.25
ny=nx
dely=delx
oy=ox
nt=1001
dt=0.004
fw=10.0
dx=0.4
dy=0.1
dt=.004
z0=0.8
cg = 1/math.sqrt(1+dx*dx+dy*dy)
ca = -dx*cg
cb = -dy*cg
d = z0*cg
mx = 0
my = 0
D = d - mx*ca - my*cb
v0 = 2.5
t0 = 2*D/v0
it0=int(t0/dt)
it1=it0
Flow('spike1',None,
'''
spike n1=%d k1=%d nsp=1 | ricker1 frequency=%g |
spray axis=2 n=%d o=%g d=%g |
spray axis=3 n=%d o=%g d=%g
''' % (nt,it1,fw,ny,oy,dely,nx,ox,delx))
wx = 1-ca*ca
wy = 1-cb*cb
wxy = - ca*cb
Flow('vel1.asc',None,'echo %g %g %g n1=3 data_format=ascii_float in=$TARGET' % (wx,wy,wxy))
Flow('vel1','vel1.asc','dd form=native | scale dscale=%g | spray axis=1 n=%d' % (1/(v0*v0),nt),local=1)
Flow('cmp1','spike1 vel1','inmo3 velocity=${SOURCES[1]}',local=1)
dx=0.4
dy=0.41
dt=.004
z0=1.5
cg = 1/math.sqrt(1+dx*dx+dy*dy)
ca = -dx*cg
cb = -dy*cg
d = z0*cg
mx = 0
my = 0
D = d - mx*ca - my*cb
v0 = 1.7
t0 = 2*D/v0
it0=int(t0/dt)
it2=it0
Flow('spike2',None,
'''
spike n1=%d k1=%d nsp=1 | ricker1 frequency=%g |
spray axis=2 n=%d o=%g d=%g |
spray axis=3 n=%d o=%g d=%g
''' % (nt,it2,fw,ny,oy,dely,nx,ox,delx))
wx = 1-ca*ca
wy = 1-cb*cb
wxy = - ca*cb
Flow('vel2.asc',None,'echo %g %g %g n1=3 data_format=ascii_float in=$TARGET' % (wx,wy,wxy))
Flow('vel2','vel2.asc','dd form=native | scale dscale=%g | spray axis=1 n=%d' % (1/(v0*v0),nt),local=1)
Flow('cmp2','spike2 vel2','inmo3 velocity=${SOURCES[1]}',local=1)
dx=0.2
dy=0.5
dt=.004
z0=2.5
cg = 1/math.sqrt(1+dx*dx+dy*dy)
ca = -dx*cg
cb = -dy*cg
d = z0*cg
mx = 0
my = 0
D = d - mx*ca - my*cb
v0 = 1.75
t0 = 2*D/v0
it0=int(t0/dt)
it3=it0
Flow('spike3',None,
'''
spike n1=%d k1=%d nsp=1 | ricker1 frequency=%g |
spray axis=2 n=%d o=%g d=%g |
spray axis=3 n=%d o=%g d=%g
''' % (nt,it3,fw,ny,oy,dely,nx,ox,delx))
wx = 1-ca*ca
wy = 1-cb*cb
wxy = - ca*cb
Flow('vel3.asc',None,'echo %g %g %g n1=3 data_format=ascii_float in=$TARGET' % (wx,wy,wxy))
Flow('vel3','vel3.asc','dd form=native | scale dscale=%g | spray axis=1 n=%d' % (1/(v0*v0),nt),local=1)
Flow('cmp3','spike3 vel3','inmo3 velocity=${SOURCES[1]}',local=1)
dx=0.2
dy=0.1
dt=.004
z0=3.5
cg = 1/math.sqrt(1+dx*dx+dy*dy)
ca = -dx*cg
cb = -dy*cg
d = z0*cg
mx = 0
my = 0
D = d - mx*ca - my*cb
v0 = 2.0
t0 = 2*D/v0
it0=int(t0/dt)
it4=it0
Flow('spike4',None,
'''
spike n1=%d k1=%d nsp=1 | ricker1 frequency=%g |
spray axis=2 n=%d o=%g d=%g |
spray axis=3 n=%d o=%g d=%g
''' % (nt,it4,fw,ny,oy,dely,nx,ox,delx))
wx = 1-ca*ca
wy = 1-cb*cb
wxy = - ca*cb
Flow('vel4.asc',None,'echo %g %g %g n1=3 data_format=ascii_float in=$TARGET' % (wx,wy,wxy))
Flow('vel4','vel4.asc','dd form=native | scale dscale=%g | spray axis=1 n=%d' % (1/(v0*v0),nt),local=1)
Flow('cmp4','spike4 vel4','inmo3 velocity=${SOURCES[1]}',local=1)
Flow('cmp','cmp1 cmp2 cmp3 cmp4',
'''
math cmp2=${SOURCES[1]} cmp3=${SOURCES[2]} cmp4=${SOURCES[3]} output="input+cmp2+cmp3+cmp4" |
noise seed=1 range=0.011
''',local=1)
def slice(name,title,bias,barfmt):
Result(name,
'''
grey title="%s" color=j allpos=n screenht=6 barwidth=0.2 screenratio=0.85
crowd=0.6 scalebar=y colorbar=y xll=2 parallel2=n labelfat=%d titlefat=%d
label1="Crossline offset" label2="Inline offset"
format2=%s font=2 bias=%g formatbar=%s barlabelfat=%d
''' % (title,fat,fat,'%3.1f',bias,barfmt,fat), local=1)
def smoothslices(name,title):
global it1
global it2
global it3
global it4
ishift=2
it1=it1+ishift
it2=it2+ishift
it3=it3+ishift
it4=it4+ishift
name1=name+'slice1'
name2=name+'slice2'
name3=name+'slice3'
name4=name+'slice4'
Flow(name1,name,
'''
window n1=1 f1=%d squeeze=y |
smooth rect1=3 rect2=3 |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it1)
Flow(name2,name,
'''
window n1=1 f1=%d squeeze=y |
smooth rect1=3 rect2=3 |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it2)
Flow(name3,name,
'''
window n1=1 f1=%d squeeze=y |
smooth rect1=3 rect2=3 |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it3)
Flow(name4,name,
'''
window n1=1 f1=%d squeeze=y |
smooth rect1=3 rect2=3 |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it4)
title1='Event 1 '+title
title2='Event 2 '+title
title3='Event 3 '+title
title4='Event 4 '+title
slice(name1,title,0,'%3.1f')
slice(name2,title,0,'%3.1f')
slice(name3,title,0,'%3.1f')
slice(name4,title,0,'%3.1f')
def slices(name,title):
global it1
global it2
global it3
global it4
ishift=2
it1=it1+ishift
it2=it2+ishift
it3=it3+ishift
it4=it4+ishift
name1=name+'slice1'
name2=name+'slice2'
name3=name+'slice3'
name4=name+'slice4'
Flow(name1,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it1)
Flow(name2,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it2)
Flow(name3,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it3)
Flow(name4,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it4)
title1='Event 1 '+title
title2='Event 2 '+title
title3='Event 3 '+title
title4='Event 4 '+title
slice(name1,title,0,'%3.1f')
slice(name2,title,0,'%3.1f')
slice(name3,title,0,'%3.1f')
slice(name4,title,0,'%3.1f')
def slowslices(name,title):
global it1
global it2
global it3
global it4
ishift=2
it1=it1+ishift
it2=it2+ishift
it3=it3+ishift
it4=it4+ishift
name1=name+'slice1'
name2=name+'slice2'
name3=name+'slice3'
name4=name+'slice4'
Flow(name1,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it1)
Flow(name2,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it2)
Flow(name3,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it3)
Flow(name4,name,
'''
window n1=1 f1=%d squeeze=y |
put label1="Crossline offset" unit1=km label2="Inline offset" unit2=km
''' % it4)
title1='Event 1 '+title
title2='Event 2 '+title
title3='Event 3 '+title
title4='Event 4 '+title
slice(name1,title,0.10,'%3.3f')
slice(name2,title,0.20,'%3.3f')
slice(name3,title,0.18,'%3.3f')
slice(name4,title,0.18,'%3.3f')
patches=2
patch3=patches*patches*patches
Flow('pat','cmp',
'''
patch p=%d,%d,%d verb=y w=600,60,60
''' % (patches,patches,patches))
Flow('pat1','pat',
'''
put n4=%d n5=1 n6=1
''' % patch3 )
tsmooth=1
xsmooth=1
ysmooth=1
Flow('patdipx','pat1',
'''
window squeeze=n |
dip rect1=%d rect2=%d rect3=%d order=3 n4=1
''' % (tsmooth,xsmooth,xsmooth),split=[4,patch3],reduce='cat axis=4')
Flow('patdipy','pat1',
'''
window squeeze=y |
dip rect1=%d rect2=%d rect3=%d order=3 n4=0
''' % (tsmooth,ysmooth,ysmooth),split=[4,patch3],reduce='cat axis=4')
Flow('dipxtemp','patdipx',
'''
put n4=%d n5=%d n6=%d
''' % (patches,patches,patches),local=1)
Flow('dipytemp','patdipy',
'''
put n4=%d n5=%d n6=%d
''' % (patches,patches,patches),local=1)
Flow('px','dipxtemp','patch inv=y weight=y dim=3 n0=%d,%d,%d' % (nt,ny,nx),local=1)
Flow('py','dipytemp','patch inv=y weight=y dim=3 n0=%d,%d,%d' % (nt,ny,nx),local=1)
slices('px','Px')
slices('py','Py')
tsmooth=10
xsmooth=10
ysmooth=10
Flow('patdipxsmooth','pat1',
'''
window squeeze=n |
dip rect1=%d rect2=%d rect3=%d order=3 n4=1
''' % (tsmooth,xsmooth,xsmooth),split=[4,patch3],reduce='cat axis=4')
Flow('patdipysmooth','pat1',
'''
window squeeze=y |
dip rect1=%d rect2=%d rect3=%d order=3 n4=0
''' % (tsmooth,ysmooth,ysmooth),split=[4,patch3],reduce='cat axis=4')
Flow('dipxtempsmooth','patdipxsmooth',
'''
put n4=%d n5=%d n6=%d
''' % (patches,patches,patches),local=1)
Flow('dipytempsmooth','patdipysmooth',
'''
put n4=%d n5=%d n6=%d
''' % (patches,patches,patches),local=1)
Flow('pxsmooth','dipxtempsmooth','patch inv=y weight=y dim=3 n0=%d,%d,%d' % (nt,ny,nx),local=1)
Flow('pysmooth','dipytempsmooth','patch inv=y weight=y dim=3 n0=%d,%d,%d' % (nt,ny,nx),local=1)
slices('pxsmooth','Px for PNMO')
slices('pysmooth','Py for PNMO')
Result('cmp3d','cmp',
'''
byte gainpanel=all |
grey3 point1=%g title="CMP" label2="Offset (km)" parallel2=n
frame1=%d frame2=50 frame3=50 screenratio=%g screenwd=%g screenht=%g xll=%g labelfat=%d titlefat=%d
format2=%s
''' % (p1,it2,sr,sw,sh,xll,fat,fat,'%3.1f'),local=1)
Result('pxsmooth3d','pxsmooth',
'''byte gainpanel=all |
grey3 point1=%g title="Inline slope" frame1=%d frame2=50 frame3=50 label2="Distance (km)"
screenratio=%g screenwd=%g screenht=%g color=j parallel2=n xll=%g labelfat=%d titlefat=%d framelabelcol=7
format2=%s
''' % (p1,it2,sr,sw,sh,xll,fat,fat,'%3.1f'),local=1)
Result('pysmooth3d','pysmooth',
'''byte gainpanel=all |
grey3 point1=%g title="Crossline slope" frame1=%d frame2=50 frame3=50 label2="Distance (km)"
screenratio=%g screenwd=%g screenht=%g color=j parallel2=n xll=%g labelfat=%d titlefat=%d framelabelcol=7
format2=%s
''' % (p1,it2,sr,sw,sh,xll,fat,fat,'%3.1f'),local=1)
Flow('shift1','cmp','window f2=1')
Flow('shift2','cmp','window f3=1')
Flow('last1','cmp','window f2=-1 squeeze=n')
Flow('last2','cmp','window f3=-1 squeeze=n')
Flow('ref1','shift1 last1','cat axis=2 ${SOURCES[1]}')
Flow('ref2','shift2 last2','cat axis=3 ${SOURCES[1]}')
Flow('ref1s','ref1','add mode=p $SOURCE | stack axis=1 norm=n')
Flow('ref2s','ref2','add mode=p $SOURCE | stack axis=1 norm=n')
Flow('corr1','ref1 cmp','add mode=p ${SOURCES[1]} | stack axis=1 norm=n')
Flow('corr2','ref2 cmp','add mode=p ${SOURCES[1]} | stack axis=1 norm=n')
Flow('num','cmp','add mode=p $SOURCE | stack axis=1 norm=n')
Flow('cos1','corr1 num ref1s',
'''
math s1=${SOURCES[1]} s2=${SOURCES[2]} output="(s1*s2)/(input*input)"
''')
Flow('cos2','corr2 num ref2s',
'''
math s1=${SOURCES[1]} s2=${SOURCES[2]} output="(s1*s2)/(input*input)"
''')
Flow('cos','cos1 cos2',
'''
cat axis=3 ${SOURCES[1]} |
smooth rect1=3 rect2=3
''')
Flow('time2','cos',
'''
mul $SOURCE | stack axis=3 norm=n |
put o1=0 d1=1 o2=0 d2=1 o3=0 d3=1 |
eikonal vel=n zshot=50 yshot=50
''')
Result('time2',
'''
grey color=j scalebar=y allpos=y
title="Minimum Time" transp=n yreverse=n
''')
Flow('pxysmooth','pysmooth pxsmooth','cat axis=4 ${SOURCES[1]}')
Flow('seed','pxysmooth','window n2=1 n3=1 n4=1 | math output=x1')
Flow('pick3-old','pxysmooth seed cos',
'''
pwpaint3 seed=${SOURCES[1]} cost=${SOURCES[2]} ref2=50 ref3=50 |
clip2 lower=0 upper=4
''')
Flow('pick3','pxysmooth seed time2',
'''
pwpaint2 seed=${SOURCES[1]} cost=${SOURCES[2]} |
clip2 lower=0 upper=4
''')
Flow('t0.asc',None,'echo %g %g %g %g n1=4 data_format=ascii_float in=$TARGET' % (it1,it2,it3,it4))
Flow('t0','t0.asc','dd form=native | math output="(input-3)*0.004" ')
Plot('cmp',
'''
byte gainpanel=all |
grey3 point1=%g title="CMP" label2="Offset (km)"
frame1=%d frame2=50 frame3=50 screenratio=%g screenwd=%g screenht=%g
''' % (p1,it2,sr,sw,sh),local=1)
Plot('pick3','pick3 t0',
'''
contour3 point1=%g wanttitle=n wanraxis=n plotfat=3
frame1=%d frame2=50 frame3=50 screenratio=%g screenwd=%g screenht=%g
cfile=${SOURCES[1]}
''' % (p1,it2,sr,sw,sh),local=1)
Result('pick3','cmp pick3','Overlay')
Flow('flat3','cmp pick3','iwarp warp=${SOURCES[1]} eps=1')
Result('flat3',
'''
byte gainpanel=all |
grey3 point1=%g title="CMP" label2="Offset (km)"
frame1=%d frame2=50 frame3=50 screenratio=%g screenwd=%g screenht=%g
''' % (p1,it2,sr,sw,sh),local=1)
Flow('time','pick3','math output=x1 | iwarp warp=$SOURCE eps=1')
Flow('moveout','time','math output="input*input-x1*x1" ')
Result('moveout',
'''
byte clip=4 allpos=y |
grey3 point1=%g title="CMP" label2="Offset (km)" color=j
frame1=%d frame2=50 frame3=50 screenratio=%g screenwd=%g screenht=%g
''' % (p1,it2,sr,sw,sh),local=1)
Flow('offset','spike1','window n1=1 | math output="sqrt(x1*x1+x2*x2)" ',local=1)
Result('offset','grey title=Offset allpos=y color=j scalebar=y',local=1)
Flow('azimuth','spike1','window n1=1 | math output="%g*(x2&x1)" ' % (180/math.pi),local=1)
Result('azimuth','grey title=Azimuth color=j scalebar=y',local=1)
Flow('head','offset azimuth',
'cat axis=3 ${SOURCES[1]} | transp plane=23 | transp plane=12 | put n3=1 n2=10201',local=1)
Flow('scan','cmp offset',
'put n2=10201 n3=1 | vscan semblance=y offset=${SOURCES[1]} v0=1 nv=51 dv=0.02',local=1)
Result('scan','grey allpos=y bias=0.01 color=j title="Velocity Scan" unit2=km/s',local=1)
Flow('vrms_il',None,'math d1=%g n1=%d o1=0 output="1.83-0.05*x1+0.38*(x1-2)*(x1-2)" ' % (dt,nt),local=1)
Flow('vrms_xl',None,'math d1=%g n1=%d o1=0 output="1.83-0.05*x1+0.38*(x1-2)*(x1-2)" ' % (dt,nt),local=1)
Flow('nmo06','cmp offset vrms_il',
'put n2=10201 n3=1 | nmo offset=${SOURCES[1]} velocity=${SOURCES[2]} | put n2=101 n3=101',local=1)
Flow('nmo07','cmp offset vrms_xl',
'put n2=10201 n3=1 | nmo offset=${SOURCES[1]} velocity=${SOURCES[2]} | put n2=101 n3=101',local=1)
Result('nmo063d','nmo06',
'''
byte gainpanel=all |
grey3 point1=%g title="Circular NMO" label2="Distance (km)" frame1=%d frame2=50 frame3=50
screenratio=%g screenwd=%g screenht=%g parallel2=n xll=%g labelfat=%d titlefat=%d
format2=%s
''' % (p1,it2,sr,sw,sh,xll,fat,fat,'%3.1f'),local=1)
Plot('nmo073d','nmo07',
'''
byte gainpanel=all |
grey3 point1=%g title="Circular NMO, crossline" label2="Distance (km)" frame1=%d frame2=50 frame3=50
screenratio=%g screenwd=%g screenht=%g parallel2=n xll=%g labelfat=%d titlefat=%d
''' % (p1,it2,sr,sw,sh,xll,fat,fat),local=1)
Flow('PNMO','cmp pysmooth pxsmooth',
'''
pnmo3d dipx=${SOURCES[2]} dipy=${SOURCES[1]}
''')
Result('PNMO3d','PNMO',
'''byte gainpanel=all |
grey3 point1=%g title="Elliptical NMO" frame1=%d frame2=50 frame3=50 label2="Distance (km)"
screenratio=%g screenwd=%g screenht=%g parallel2=n xll=%g labelfat=%d titlefat=%d
format2=%s
''' % (p1,it2,sr,sw,sh,xll,fat,fat,'%3.1f'),local=1)
Flow('dpxdy','pxsmooth',
'''
math output="input" |
transp plane=12 |
deriv |
transp plane=12
''')
Flow('dpxdt','pxsmooth','deriv')
Flow('pxy','pysmooth dpxdy dpxdt',
'''
math pxy=${SOURCES[1]} pxt=${SOURCES[2]} output="input*pxt+pxy"
''')
slices('pxy','P\_xy\^')
Flow('dpydx','pysmooth',
'''
math output="input" |
transp plane=13 |
deriv |
transp plane=31
''')
Flow('dpydt','pysmooth','deriv')
Flow('pyx','pxsmooth dpydx dpydt',
'''
math pyx=${SOURCES[1]} pyt=${SOURCES[2]} output="input*pyt+pyx"
''')
slices('pyx','P\_yx\^')
pavg='(pxy+pyx)/1.0'
Flow('pcross','pxy pyx',
'''
math pxy=${SOURCES[0]} pyx=${SOURCES[1]} output="%s"
''' % (pavg),local=1)
slices('pcross','P\_xy\^+P\_yx\^/1')
Flow('pxy_test','pxsmooth',
'''
math output="input*x1/0.004" |
transp plane=12 |
deriv |
transp plane=12
''')
slices('pxy_test','pxytest=W\_xy\^')
Flow('testvol',None,'spike n1=10 n2=20 nsp=2 k1=3,6 k2=3,17 d1=1 d2=1| spray axis=3 n=30 d=1 o=0')
Plot('testvol1','testvol','byte | grey3 frame1=5 frame2=5 frame3=5')
Plot('testvol2','testvol','transp plane=12 | byte gainpanel=all | grey3 frame1=5 frame2=5 frame3=5')
Flow('testvol3','testvol','transp plane=31 ')
Plot('testvol3','byte gainpanel=all | grey3 frame1=5 frame2=5 frame3=5')
Result('testvol','testvol1 testvol2 testvol3','SideBySideAniso')
Flow('pxnmod','px pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
Flow('pynmod','py pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
Flow('pxynmod','pxy pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
Flow('pyxnmod','pyx pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
Flow('pcrossnmod','pcross pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
formula='0.5*atan((2*(x3*x2)*(x1*(pxy*6.4)+(px*0.16)*(py*0.16)))/(((x1*(pxy*6.4))+(px*0.16)*(py*0.16))*(x3*x3-x2*x2)+x1*(x2*(px*0.16)-x3*(py*0.16))+0.0000000001))'
Flow('alpha','pxsmooth pysmooth pxy',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} pxy=${SOURCES[2]} output="%s"
''' % (formula),local=1)
Flow('alphanmo','alpha pxsmooth pysmooth',
'pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
Flow('bar','alphanmo','bar')
Plot('alphanmo3d','alphanmo bar',
'''
byte |
grey3 point1=%g title=Azimuth color=j scalebar=y bar=${SOURCES[1]}
frame1=%d frame2=90 frame3=90 label2=Distance unit2=km
screenratio=%g screenwd=%g screenht=%g
''' % (p1,it2,sr,sw,sh),local=1)
smoothslices('alphanmo','Azimuth from px,py,pxy')
Flow('transp','cmp','put n3=1 n2=10201 | transp',local=1)
Flow('bin','transp head',
'bin head=${SOURCES[1]} xkey=0 ykey=1 x0=0 dx=0.025 nx=70 y0=-180 dy=4 ny=91 interp=2',local=1)
Flow('oacmp','bin','transp plane=23 | transp plane=12',local=1)
Result('oacmp','window n2=1 min2=0.75 | grey pclip=95 label2=Azimuth unit2="\^o\_" xll=2 title="Input CMP" screenratio=2 parallel2=n xll=%g labelfat=%d titlefat=%d format2=%s' % (xll,fat,fat,'%3.1f'),local=1)
Flow('PNMOtransp','PNMO','put n3=1 n2=10201 | transp',local=1)
Flow('PNMObin','PNMOtransp head',
'bin head=${SOURCES[1]} xkey=0 ykey=1 x0=0 dx=0.025 nx=70 y0=-180 dy=4 ny=91 interp=2',local=1)
Flow('oaPNMO','PNMObin','transp plane=23 | transp plane=12',local=1)
Result('oaPNMO','window n2=1 min2=0.75 | grey pclip=95 label2=Azimuth unit2="\^o\_" xll=2 title="After PNMO" screenratio=2 parallel2=n xll=%g labelfat=%d titlefat=%d format2=%s' % (xll,fat,fat,'%3.1f'),local=1)
Flow('alphatransp','alphanmo','put n3=1 n2=10201 | transp',local=1)
Flow('alphabin','alphatransp head',
'bin head=${SOURCES[1]} xkey=0 ykey=1 x0=0 dx=0.025 nx=70 y0=-180 dy=4 ny=91 interp=2',local=1)
Flow('oaalpha','alphabin','transp plane=23 | transp plane=12',local=1)
Plot('oaalpha','window n2=1 min2=0.5 | grey label2=Azimuth color=j scalebar=y unit2="\^o\_" ',local=1)
Flow('oaalphasmooth','oaalpha','smooth rect1=2 rect2=5 rect3=1 repeat=1 ')
Plot('oaalphasmooth',
'''
window n2=1 min2=0.5 |
grey label2=Azimuth color=j scalebar=y unit2="\^o\_"
''',local=1)
Flow('alphawiggle1','oaalpha','window n1=1 f1=308 n2=1 f2=26 | put label1=Azimuth unit1=Degrees')
Plot('alphawiggle1','wiggle title=" " plotcol=3 wantaxis=n')
Flow('alphawiggle2','oaalpha','window n1=1 f1=450 n2=1 f2=21 | put label1=Azimuth unit1=Degrees')
Plot('alphawiggle2','wiggle title=" " wantaxis=n')
Flow('alphawiggle3','oaalpha','window n1=1 f1=853 n2=1 f2=20 | put label1=Azimuth unit1=Degrees')
Plot('alphawiggle3','wiggle title=" " plotcol=2 wantaxis=n')
Flow('aziaxi',None,'spike mag=1 n1=91 k1=0 l1=90 o1=-180 d1=4 label1=Azimuth unit1=Degrees')
Flow('iso1','aziaxi',
'''
math output="0.785398163*(x1+180)" |
window n1=12 f1=0
''')
Flow('iso2','aziaxi',
'''
math output="0.785398163*(x1+90)"|
window n1=22 f1=12
''')
Flow('iso3','aziaxi',
'''
math output="0.785398163*(x1)"|
window n1=23 f1=34
''')
Flow('iso4','aziaxi',
'''
math output="0.785398163*(x1-90)"|
window n1=22 f1=57
''')
Flow('iso5','aziaxi',
'''
math output="0.785398163*(x1-180)"|
window n1=12 f1=79
''')
Flow('isowiggle','iso1 iso2 iso3 iso4 iso5',
'''
cat axis=1 ${SOURCES[1]} ${SOURCES[2]} ${SOURCES[3]} ${SOURCES[4]}
''')
Plot('isowiggle','wiggle plotcol=5 label2=Alpha unit2=Radians xreverse=y title="Alpha versus Azimuth"')
Result('wiggles','alphawiggle2 isowiggle','Overlay')
slopemag='sqrt(px*0.16*px*0.16+py*0.16*py*0.16)'
Flow('pmag','pxsmooth pysmooth',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} output="%s" |
pnmo3d dipx=${SOURCES[0]} dipy=${SOURCES[1]}
''' % slopemag, local=1)
smoothslices('pmag','Slope Magnitude')
smoothslices('pxnmod','Slope x')
smoothslices('pynmod','Slope y')
smoothslices('pxynmod','Slope xy')
smoothslices('pyxnmod','Slope yx')
smoothslices('pcrossnmod','Slope Cross')
Flow('offsetvol','offset','spray axis=1 n=1001 | put d1=0.004 o1=0')
Flow('nmovel','pmag offsetvol',
'''
math l=${SOURCES[1]} output="((x1*input)/(l+0.05))"
''')
slowslices('nmovel','NMO Slowness Squared')
dotprod0='acos((px*0.16/(P+0.0000001))*(x3/(X+0.0000001))+(py*0.16/(P+0.0000001))*(x2/(X+0.0000001)))'
dotprod1='((px*0.16)*(x3/(X+0.0000000001))+(py*0.16)*(x2/(X+0.0000000001)))'
dotprod2='(px*0.16)*(x3)+(py*0.16)*(x2)/(X*P+1)'
Flow('pdotx','pxnmod pynmod pmag offsetvol',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} P=${SOURCES[2]} X=${SOURCES[3]} output="(%s*%g)"
''' % (dotprod2,(1)), local=1)
smoothslices('pdotx','Slope Azimuth Projection')
Flow('pdotxtransp','pdotx','put n3=1 n2=10201 | transp',local=1)
Flow('pdotxbin','pdotxtransp head',
'bin head=${SOURCES[1]} xkey=0 ykey=1 x0=0 dx=0.025 nx=70 y0=-180 dy=1 ny=361 interp=2',local=1)
Flow('oapdotx','pdotxbin','transp plane=23 | transp plane=12',local=1)
Result('oapdotx','window n2=1 min2=0.5 | grey allpos=y label2=Azimuth color=j scalebar=y unit2="\^o\_" ',local=1)
formWxy='(x1*pxy*6.4)+(0.16*0.16*py*px)'
Flow('Wxy','pxsmooth pysmooth dpydx',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} pxy=${SOURCES[2]} output="%s"
''' % formWxy)
slices('Wxy','W\_xy\^')
Flow('Wxynmod','Wxy pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
smoothslices('Wxynmod','W\_xy\^nmod')
formWx='(x1*(0.16*px)-Wxy*x2)/(x3+0.00001)'
Flow('Wx','pxsmooth pysmooth Wxy',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} Wxy=${SOURCES[2]} output="%s"
''' % formWx)
slices('Wx','W\_x\^')
Flow('Wxnmod','Wx pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
smoothslices('Wxnmod','W\_x\^nmod')
formWy='(x1*(0.16*py)-Wxy*x3)/(x2+0.00001)'
Flow('Wy','pxsmooth pysmooth Wxy',
'''
math px=${SOURCES[0]} py=${SOURCES[1]} Wxy=${SOURCES[2]} output="%s"
''' % formWy)
slices('Wy','W\_y\^')
Flow('Wynmod','Wy pxsmooth pysmooth','pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]}')
smoothslices('Wynmod','W\_y\^nmod')
wxyalpha='0.5*atan(2*Wxy/(Wx-Wy+0.0000000001))'
Flow('newalpha','Wx Wy Wxy pxsmooth pysmooth',
'''
math Wx=${SOURCES[0]} Wy=${SOURCES[1]} Wxy=${SOURCES[2]} output="%s" |
pnmo3d dipx=${SOURCES[3]} dipy=${SOURCES[4]}
'''% wxyalpha)
smoothslices('newalpha','Alpha from W\_x\^,W\_y\^,W\_xy\^')
Flow('deltaT','cmp pxsmooth pysmooth',
'''
math output="x1*x1" |
pnmo3d dipx=${SOURCES[1]} dipy=${SOURCES[2]} |
math output="input-(x1*x1)" | window n2=51 f2=25 n3=51 f3=25 |
transp plane=23
''')
smoothslices('deltaT',' ')
Flow('dTtransp','deltaT','transp plane=13')
Flow('W0',None,'spike n1=3')
Flow('cmpT','cmp','window n2=51 f2=25 n3=51 f3=25 | transp plane=13 | window n3=1')
nt=1001
wlist=[]
W100list=[]
j=0
for i in range(nt):
Winv = 'Winv_'+str(i)
deltaT = 'deltaT_'+str(i)
Flow(deltaT,'dTtransp','window n3=1 f3=%d' % i)
Flow(Winv,[deltaT,'cmpT','W0'],
'''
conjgrad nmow_adj in=${SOURCES[0]} gather=${SOURCES[1]} nw=3 adj=y mod=${SOURCES[2]} niter=10 | put n2=1
''')
wlist.append(Winv)
if j==100:
W00='W_'+str(i)
Flow(W00,wlist,'cat ${SOURCES[1:%d]} axis=2' % 100)
W100list.append(W00)
if i==100:
W100list.append(Winv)
wlist=[]
j=0
j=j+1
Flow('Winv',W100list,'cat ${SOURCES[1:%d]} axis=2 ' % 11)
Plot('Winv',
'''
transp |
put label2=W unit2=" " |
graph transp=y yreverse=y min2=-0.5 max2=0.5 min1=0 max1=4
grid1=y grid2=n title="W Inversion Results"
''' )
sr=2.0
sra=2.0
ll=1.5
Flow('Wxinv','Winv','window n1=1 f1=0 squeeze=y')
Result('Wxinv',
'''
put label1="Time t\_0\^" unit1=s d1=%g label2=W unit2="s\^2\_/km\^2\_"|
graph transp=y yreverse=y min2=-0.5 max2=0.5 min1=0 max1=4 symbol=+ symbolsz=4
grid1=y grid2=n title="W\_x\^ results" screenratio=%g xll=%g parallel2=n labelfat=%d titlefat=%d
format2=%s
''' % (dt,sr,ll,fat,fat,'%3.1f'))
Flow('Wyinv','Winv','window n1=1 f1=1')
Result('Wyinv',
'''
put label1="Time t\_0\^" unit1=s d1=%g label2=W unit2="s\^2\_/km\^2\_"|
graph transp=y yreverse=y min2=-0.5 max2=0.5 min1=0 max1=4 symbol=- symbolsz=4
grid1=y grid2=n title="W\_y\^ results" screenratio=%g xll=%g parallel2=n labelfat=%d titlefat=%d
format2=%s
''' % (dt,sr,ll,fat,fat,'%3.1f'))
Flow('Wxyinv','Winv','window n1=1 f1=2')
Result('Wxyinv',
'''
put label1="Time t\_0\^" unit1=s d1=%g label2=W unit2="s\^2\_/km\^2\_"|
graph transp=y yreverse=y min2=-0.1 max2=0.1 min1=0 max1=4 symbol=o symbolsz=4
grid1=y grid2=n title="W\_xy\^ results" screenratio=%g xll=%g parallel2=n labelfat=%d titlefat=%d
format2=%s
''' % (dt,sr,ll,fat,fat,'%3.1f'))
Flow('InvAlpha','Wxinv Wyinv Wxyinv',
'''
math wx=${SOURCES[0]} wy=${SOURCES[1]} wxy=${SOURCES[2]} output="%g*0.5*atan(2*wxy/(wx-wy+0.000000001))"
''' % (180/math.pi))
Result('InvAlpha',
'''
put label1="Time t\_0\^" unit1=s d1=%g label2="Alpha" unit2="\^o\_"|
graph transp=y yreverse=y xreverse=n min1=0 max1=4 min2=-50 max2=50 symbol=* symbolsz=8
grid1=y grid2=n title="Alpha results" wantaxis=y screenratio=%g xll=%g parallel2=n labelfat=%d titlefat=%d
format2=%s
''' % (dt,sra,ll,fat,fat,'%3.1f'))
Flow('azimuthvol','azimuth','spray axis=1 n=1001 | put d1=%g o1=0 | math output="input/%g"' % (dt,(180/math.pi)))
Flow('beta','InvAlpha',
'''
window squeeze=y |
spray axis=2 n=%d | spray axis=3 n=%d |
put d2=%g o2=%g d3=%g o3=%g d1=%g |
math output="input/%g"
''' % (ny,nx,dely,oy,delx,ox,dt,(180/math.pi)))
Flow('lambda1','Wxinv Wyinv Wxyinv',
'''
math wx=${SOURCES[0]} wy=${SOURCES[1]} wxy=${SOURCES[2]} output="0.5*(wx+wy+sqrt((wx-wy)*(wx-wy)+4*wxy*wxy))" |
window squeeze=y |
spray axis=2 n=%d | spray axis=3 n=%d |
put d2=%g o2=%g d3=%g o3=%g d1=%g
''' % (ny,nx,dely,oy,delx,ox,dt))
Flow('lambda2','Wxinv Wyinv Wxyinv',
'''
math wx=${SOURCES[0]} wy=${SOURCES[1]} wxy=${SOURCES[2]} output="0.5*(wx+wy-sqrt((wx-wy)*(wx-wy)+4*wxy*wxy))" |
window squeeze=y |
spray axis=2 n=%d | spray axis=3 n=%d |
put d2=%g o2=%g d3=%g o3=%g d1=%g
''' % (ny,nx,dely,oy,delx,ox,dt))
Flow('slowsqrd','lambda1 lambda2 azimuthvol beta',
'''
math l1=${SOURCES[0]} l2=${SOURCES[1]} a=${SOURCES[2]} b=${SOURCES[3]}
output="((l1*cos(a-b)*cos(a-b)+l2*sin(a-b)*sin(a-b)))"
''')
slowslices('slowsqrd','NMO slowness squared')
End() |