from rsf.proj import *
from rsf.recipes.tpx import FPX
import math
def velplot(title,label1='Depth',unit1='km',max1=2):
return '''
window max1=%g |
grey color=j allpos=y title="%s" scalebar=y
barlabel=Velocity barunit=km/s
label1="%s" unit1="%s" label2=Lateral unit2=km
barreverse=y pclip=100
''' % (max1,title,label1,unit1)
def graph(transp,o2,d2,n2,col,fat,extra=''):
return '''
window max1=2 |
graph transp=%d yreverse=y pad=n min2=%g max2=%g
plotcol=%d plotfat=%d wantaxis=n wanttitle=n %s
''' % (transp,o2,o2+(n2-1)*d2,col,fat,extra)
def graphw(min1,max1,transp,o2,d2,n2,col,fat,extra=''):
return '''
window min1=%g max1=%g |
graph transp=%d yreverse=y pad=n min2=%g max2=%g
plotcol=%d plotfat=%d wantaxis=n wanttitle=n %s
''' % (min1,max1,transp,o2,o2+(n2-1)*d2,col,fat,extra)
def wiggle(title):
return '''
window max1=2 j2=2 |
wiggle transp=y yreverse=y poly=y
title="%s" label2=Offset unit2=km zplot=0.5
wherexlabel=t wheretitle=b labelsz=12 titlesz=15
''' % title
Flow('modl',None,
'''
spike n1=1501 o1=-10 d1=0.02 n2=4
nsp=4 k2=1,2,3,4 mag=0.4,0.7,1,1.5
''')
Flow('refl',None,
'''
spike n1=1501 n2=4 nsp=4 k2=1,2,3,4
mag=0.0909091,0.1428570,0.1111110,0.2000000
''')
Flow('mod1','modl','window min1=0')
Flow('rmodl','modl',
'''
pad n2=100 | noise rep=y seed=112012
type=n mean=2.0 range=1
''')
Flow('amodl','modl rmodl','cat axis=2 ${SOURCES[1]}')
Flow('rrefl','modl',
'''
pad n2=100 | noise rep=y seed=122012 |
math output="input^3"
''')
Flow('prefl','rrefl','clip2 lower=10')
Flow('mrefl','rrefl','clip2 upper=-10')
Flow('drefl','prefl mrefl','add scale=0.01,0.01 ${SOURCES[1]}')
Flow('arefl','refl drefl','cat axis=2 ${SOURCES[1]}')
Flow('unif','mod1','unif2 n1=101 d1=0.02 v00=5,6,8,10,15')
Flow('mod2','unif','math output=1.5+2*x1')
Plot('modl','mod2',velplot('Velocity Model',max1=2))
Plot('modla','mod1',graph(0,0,0.02,101,0,20,'scalebar=y'))
Plot('modlb','mod1',graph(0,0,0.02,101,7,5,'scalebar=y'))
Flow('diffr','rmodl drefl',
'''
kirmod nt=600 dt=0.004 freq=25 refl=${SOURCES[1]}
nh=24 dh=0.05 h0=0
ns=501 ds=0.02 s0=0 cmp=y
vel=2.0 gradz=1 type=v |
put label2=Offset unit2=km label3=Midpoint unit3=km |
window | pow pow1=1
''',split=[1,1501],reduce='add')
Flow('tiffr','diffr','costaper nw1=400 nw3=40')
Flow('data','tiffr',
'''
spray axis=4 n=1 |
put label4=CMP_Y |
transp plane=23 |
transp plane=34 |
put d4=0.025
''')
v0=2.0
nv=151
dv=0.01
Flow('mig_no_halfint','data','preconstkirch aal=y zero=n vel=%g' %v0, split=[4,24])
Flow('mig','mig_no_halfint','transp plane=24 | transp plane=34 | halfint inv=y adj=y | transp plane=23 | transp plane=34')
pad=1000
padft=501
nw=231
Flow('warp','mig','window | t2warp pad=%i'%(pad))
np=351
p0=-1.7
FPX('fpx','warp',np=np,p0=p0,nw=nw,v0=0.0)
offset_num = 0
Flow('txp','fpx','pad n1=%i | fft1 inv=y | t2warp inv=y | transp plane=23 memsize=1000'%padft)
Flow('f_hall_kp','fpx','fft3 axis=3 | transp plane=24 memsize=30000')
Flow('f_hs_pk','fpx','sfwindow n4=1 f4=%d | fft3 axis=3 | transp plane=24 memsize=1000 | transp plane=34 memsize=1000'%(offset_num))
Flow('vc_f_hall_kp_psovc','f_hall_kp','psovcp nv=%d dv=%g v0=%g' % (nv,dv,v0),split=[4,np])
Flow('vc_f_hs_pk_psovc','f_hs_pk','psovc nv=%d dv=%g v0=%g' % (nv,dv,v0),split=[4,1024])
Flow('fvkp_hs','vc_f_hs_pk_psovc',
'''
transp memsize=50000 plane=34
''')
Flow('tvxp_hs','fvkp_hs','fft3 axis=3 inv=y | pad n1=%i | fft1 memsize=100 inv=y | t2warp inv=y'%padft,split=[4,np])
Flow('tvxp','vc_f_hall_kp_psovc','fft3 axis=3 inv=y | pad n1=%i | fft1 memsize=100 inv=y | t2warp inv=y'%padft,split=[4,np])
Flow('tvx2_hs','tvxp_hs','mul $SOURCE | stack axis=4 norm=n')
Flow('tvx2','tvxp','mul $SOURCE | stack axis=4 norm=n')
Flow('tvx_hs','tvxp_hs','stack axis=4 norm=n')
Flow('tvx','tvxp','stack axis=4 norm=n')
Flow('semb_hs','tvx_hs tvx2_hs',
'''
mul ${SOURCES[0]} |
divn den=${SOURCES[1]} niter=50 rect3=1000 rect1=5 |
clip2 lower=0
''')
Flow('semb','tvx tvx2',
'''
mul ${SOURCES[0]} |
divn den=${SOURCES[1]} niter=50 rect3=1000 rect1=5 |
clip2 lower=0
''')
Flow('semb_hs_2','semb_hs','stack axis=3 | math output="input^2"')
Flow('semb_2','semb','stack axis=3 | math output="input^2"')
Plot('diffr_hs','diffr',
'''
window n2=1 f2=%d |
grey min1=0.75
'''%(offset_num))
Flow('muted_hs','semb_hs_2',
'''
scale axis=2 |
mutter x0=2.0 inner=y v0=0.5 half=n t0=0.25 |
mutter x0=2.2 inner=n v0=0.7 half=n t0=-0.25
''')
Flow('muted','semb_2',
'''
scale axis=2 |
mutter x0=2.0 inner=y v0=0.5 half=n t0=0.25 |
mutter x0=2.2 inner=n v0=0.7 half=n t0=-0.25
''')
Flow('pik_hs','muted_hs',
'''
pick rect1=25 vel0=1.5 gate=100 an=5 |
spray axis=2 n=501 d=0.02 o=0
''')
Flow('pik','muted',
'''
pick rect1=25 vel0=1.5 gate=100 an=5 |
spray axis=2 n=501 d=0.02 o=0
''')
Plot('muted_hs',
'''
grey min1=0.75 max1=1.9 color=j allpos=y labelsz=12 titlesz=15
label2=Velocity unit2=km/s title="Velocity Scan"
''')
Plot('muted',
'''
grey min1=0.75 max1=1.9 color=j allpos=y labelsz=12 titlesz=15
label2=Velocity unit2=km/s title="Velocity Scan"
''')
Plot('semb_hs_2',
'''
window min1=0.75 max1=1.9 |
grey color=j allpos=y labelsz=12 titlesz=15
label2=Velocity unit2=km/s title="Diffraction Velocity Scan"
''')
Plot('semb_2',
'''
window min1=0.75 max1=1.9 |
grey color=j allpos=y labelsz=12 titlesz=15
label2=Velocity unit2=km/s title="Diffraction Velocity Scan"
''')
Flow('vtrue','diffr','window n2=1 | math output="2.0*sqrt((exp(x1)-1)/x1)" ')
Flow('slice_hs','tvx_hs pik_hs',
'slice pick=${SOURCES[1]}')
Flow('slice_hs_true','tvx_hs vtrue',
'slice pick=${SOURCES[1]}')
Flow('slice','tvx pik',
'slice pick=${SOURCES[1]}')
Flow('slice_true','tvx vtrue',
'slice pick=${SOURCES[1]}')
Plot('vela','vtrue',graphw(0.75,1.9,1,v0,dv,nv,0,20))
Plot('velb','vtrue',graphw(0.75,1.9,1,v0,dv,nv,7,5))
Plot('pika_hs','pik_hs',graphw(0.75,1.9,1,v0,dv,nv,0,20))
Plot('pikb_hs','pik_hs',graphw(0.75,1.9,1,v0,dv,nv,7,5))
Plot('pika','pik',graphw(0.75,1.9,1,v0,dv,nv,0,20))
Plot('pikb','pik',graphw(0.75,1.9,1,v0,dv,nv,7,5))
Plot('vtrue','vela velb','Overlay')
Plot('pik_hs','pika_hs pikb_hs','Overlay')
Plot('pik','pika pikb','Overlay')
Flow('dadcig232','tvxp','window n3=1 min3=2.32 | transp plane=23 memsize=10000')
Flow('dadcig232_hs','tvxp_hs','window n3=1 min3=2.32 | transp plane=23 memsize=10000')
Flow('f_co_pk','fpx','window n4=1 f4=-1 | fft3 axis=3 | transp plane=24 memsize=1000 | transp plane=34 memsize=1000')
low = 0.1
true = 1.0
high = 1.9
mint = 0.8
maxt = 1.8
minp = -1.0
maxp = 1.0
Flow('vc_f_co_pk_low','f_co_pk','psovc nv=%d dv=%g v0=%g' % (1,low,v0),split=[4,1024])
Flow('vc_f_co_pk_true','f_co_pk','psovc nv=%d dv=%g v0=%g' % (1,true,v0),split=[4,1024])
Flow('vc_f_co_pk_high','f_co_pk','psovc nv=%d dv=%g v0=%g' % (1,high,v0),split=[4,1024])
Flow('vc_f_zo_pk_high','f_hs_pk','psovc nv=%d dv=%g v0=%g' % (1,high,v0),split=[4,1024])
cigplot = '''
grey min1=%g max1=%g min2=%g max2=%g labelsz=12. titlesz=12. d2num=0.25 n2tic=4 o2num=1.0
unit2="s\^2\_/km" title="Slope Gather (x=%g km, v=%g km/s)"
'''
Flow('dadcig232_co_low','vc_f_co_pk_low','window | fft3 axis=3 inv=y | window n3=1 min3=2.32 | pad n1=%i | fft1 inv=y | t2warp inv=y'%padft)
Flow('dadcig232_co_true','vc_f_co_pk_true','window | fft3 axis=3 inv=y | window n3=1 min3=2.32 | pad n1=%i | fft1 inv=y | t2warp inv=y'%padft)
Flow('dadcig232_co_high','vc_f_co_pk_high','window | fft3 axis=3 inv=y | window n3=1 min3=2.32 | pad n1=%i | fft1 inv=y | t2warp inv=y'%padft)
Flow('dadcig232_zo_high','vc_f_zo_pk_high','window | fft3 axis=3 inv=y | window n3=1 min3=2.32 | pad n1=%i | fft1 inv=y | t2warp inv=y'%padft)
Plot('a_dadcig232_co_low','dadcig232_co_low',cigplot %(mint,maxt,minp,maxp,2.32,v0+low))
Plot('a_dadcig232_co_true','dadcig232_co_true',cigplot %(mint,maxt,minp,maxp,2.32,v0+true))
Plot('a_dadcig232_co_high','dadcig232_co_high',cigplot %(mint,maxt,minp,maxp,2.32,v0+high))
Flow('dadcig232_zo_low','dadcig232_hs','window n3=1 min3=%g'%(v0+low))
Flow('dadcig232_zo_true','dadcig232_hs','window n3=1 min3=%g'%(v0+true))
Plot('a_dadcig232_zo_low','dadcig232_zo_low',cigplot %(mint,maxt,minp,maxp,2.32,v0+low))
Plot('a_dadcig232_zo_true','dadcig232_zo_true',cigplot %(mint,maxt,minp,maxp,2.32,v0+true))
Plot('a_dadcig232_zo_high','dadcig232_zo_high',cigplot %(mint,maxt,minp,maxp,2.32,v0+high))
Result('a-cigs-zo','a_dadcig232_zo_low a_dadcig232_zo_true a_dadcig232_zo_high','SideBySideAniso')
Result('a-cigs-co','a_dadcig232_co_low a_dadcig232_co_true a_dadcig232_co_high','SideBySideAniso')
Result('a-zo','diffr','window min1=0.8 max1=1.6 n2=1 min3=1.0 max3=9.0 | grey wanttitle=n')
Result('a-co','diffr','window min1=0.8 max1=1.6 n2=1 min2=1.0 min3=1.0 max3=9.0 | grey wanttitle=n')
Result('a-semb-zo','semb_hs_2',
'''
scale axis=2 |
grey min1=0.75 max1=1.9 color=j allpos=n bias=0.5 clip=0.5
label2=Velocity unit2=km/s wanttitle=n scalebar=y
''')
Result('a-semb-fo','semb_2',
'''
scale axis=2 |
grey min1=0.75 max1=1.9 color=j allpos=n bias=0.5 clip=0.5
label2=Velocity unit2=km/s wanttitle=n scalebar=y
''')
Result('a-slice-zo','slice_hs',
'''
window min1=0.8 max1=1.6 min2=1.0 max2=9.0 |
grey wanttitle=n clip=0.003
''')
Result('a-slice-fo','slice',
'''
window min1=0.8 max1=1.6 min2=1.0 max2=9.0 |
grey wanttitle=n clip=0.08
''')
End() |