from rsf.proj import *
from rsf.prog import RSFROOT
import copy
import random
random.seed(0)
Fetch('midpts.hh','midpts')
name = 'gom-'
to = 0
nt = 876
dt = 0.004
tf = to+(nt-1)*dt
xo = 7.705
nx = 250
dx = 0.0335
xf = xo+(nx-1)*dx
ho = 0.264
nh = 24
dh = 0.134
def getstring(par):
return "\`< ${SOURCES[1]} $RSFROOT/bin/sfget %s parform=n \`"%par
def getstring2(par):
return "`< ${SOURCES[1]} $RSFROOT/bin/sfget %s parform=n `"%par
def make_linear_vel(outfile,infile):
Flow(outfile,[infile,infile],
'''
window n2=1 |
math output="(%s-1)*%s/(%s-1)/%s*(x1-%s)+%s"
'''%(getstring2('n2'),getstring2('d2'),
getstring2('n1'),getstring2('d1'),
getstring2('o1'),getstring2('o2')))
cmps = name+'cmps'
Flow(cmps,'midpts.hh',
'''
dd form=native |
mutter half=n v0=1.5 |
put label1=Time unit1=s label2=Offset unit2=km |
mutter half=n |
put label2=Offset unit2=km label3=Midpoint unit3=km |
window max1=3.5
''')
vo =1.4
nv=121
dv=0.01
vf = vo+(nv-1)*dv
vscan = name+'vscan'
Flow(vscan,cmps,
'''
vscan half=n v0=%g nv=%i dv=%g semblance=y |
costaper nw1=50 | costaper nw2=3
'''%(vo,nv,dv))
mutestr = 0.35
muterect1 = 50
muterect2 = 15
velomute = name+'velomute'
veloguide = name+'veloguide'
watervel = 1.5
waterbot = 1.2
velsmth = 100
velsgma = 0.63
Flow(veloguide,vscan,
'''
window n3=1|
math output="exp(-(x2-%g)*(x2-%g)/%g)-1"|
cut min1=%g |
smooth rect1=%i |
math output="input+1" |
spray axis=3 n=%i d=%g o=%g
'''%(watervel,watervel,velsgma*velsgma,waterbot,velsmth,nx,dx,xo))
bar3 = vscan+'-bar3'
Flow(bar3,vscan,'window j3=3|bar allpos=y gainpanel=e minval=0 maxval=0.5 ')
bar = vscan+'-bar'
Flow(bar,vscan,'bar allpos=y gainpanel=e minval=0 maxval=0.5 ')
semb_in = vscan
minlevel=1
nsmoothings = 10
smoothstrong = 5
saniso1 = 6
saniso2 = 1
saniso3 = 3
semblst = []
derivlst = []
for i in range(nsmoothings):
j = i+minlevel
this_one = semb_in+'-smth-%i'%i
Flow(this_one,[semb_in,veloguide],
'''
scale dscale=%g|
smooth rect1=%i rect2=%i rect3=%i | costaper nw2=10|
add mode=p ${SOURCES[1]}
'''%((j),j*smoothstrong*saniso1, j*smoothstrong*saniso2, j*smoothstrong*saniso3))
deriv = semb_in+'-deriv-%i'%i
Flow(deriv,this_one,'transp plane=12 | sfderiv scale=y| transp plane=12')
semblst.append(this_one)
derivlst.append(deriv)
semblst.reverse()
derivlst.reverse()
lmbda = 5
rho = 0.01
niter = 20
epsilon = 0.001
rx = xf-xo
rt = tf-to
nc = 5
dc = (vf-vo)/(nc-1)
ndx = 5
ndt = 5
cutoffx = 1
cutofft = 1
modlst = []
wantvelplots = False
nmods = 9
randmodlst = random.sample(range(nc*ndx*ndt),9)
randmodlst.sort()
tracker = 0
modbar = name+'modbar'
Flow(modbar,vscan,'window n2=1 |math output="(x1-%g)*%g+%g" | byte allpos=y bias=%g'%(to,(vf-vo)/(tf-to),vo,vo))
nbar=6
rowlst = []
collst = []
for ic in range(nc):
const = dc*ic+vo
min_slopex = cutoffx*(vo-const)/(rx)
max_slopex = cutoffx*(vf-const)/(rx)
range_slopex = max_slopex - min_slopex
dslopex = range_slopex/(ndx-1)
min_slopet = cutofft*(vo-const)/(rt)
max_slopet = cutofft*(vf-const)/(rt)
range_slopet = max_slopet - min_slopet
dslopet = range_slopet/(ndt-1)
for idx in range(ndx):
slopex = min_slopex + idx*dslopex
for idt in range(ndt):
slopet = min_slopet + idt*dslopet
mod = name+'linear-model-%i-%i-%i'%(ic,idx,idt)
Flow(mod,semblst[0],
'''
window n2=1|
math output="%g+%g*(x2-%g)+%g*(x1-%g) "
'''%(const,slopex,xo+rx/2,slopet,to))
modid = idt+idx*ndt+ic*(ndt*nc)
if modid in randmodlst:
plotmod = name+'plotmod-%i'%tracker
Plot(plotmod,[mod,modbar],'clip2 lower=%g upper=%g |grey color=j bias=1.4 allpos=y scalebar=y barlabel=Velocity barunit="km/s" title="Starting Model %i" bar=${SOURCES[1]} '%(vo,vf,modid+1))
Result(plotmod,[mod,modbar],'clip2 lower=%g upper=%g |grey color=j bias=1.4 allpos=y scalebar=y barlabel=Velocity barunit="km/s" title="Starting Model %i" bar=${SOURCES[1]} '%(vo,vf,modid+1))
collst.append(plotmod)
tracker = tracker+1
modlst.append(mod)
if len(collst) == 3:
Plot(name+'row-%i'%(len(rowlst)),collst,'SideBySideAniso')
rowlst.append(name+'row-%i'%(len(rowlst)))
collst = []
Result(name+'starting-models',rowlst,'OverUnderAniso')
searchtype = 'lbfgs'
modoutlst = []
updateoutlst = []
costoutlst = []
for j in range(len(modlst)):
initial_model = modlst[j]
updatelst = [initial_model]
for i in range(len(semblst)):
if i == 0:
model_in = initial_model
else:
model_in = initial_model+'-velo-out-%i'%(i-1)
updates = initial_model+'-updates-%i'%(i)
vpicked = initial_model+'-velo-out-%i'%(i)
Flow([vpicked,updates],[semblst[i],derivlst[i],model_in],
'''
varipick dsemb=${SOURCES[1]} vo=${SOURCES[2]} updates=${TARGETS[1]}
lambda=%g rho=%g niter=%i epsilon=%g type=%s
'''%(lmbda+len(semblst)-1-i,rho,niter,epsilon,searchtype))
updatelst.append(updates)
upd = initial_model+'-updates'
Flow(upd,updatelst,'cat axis=3 o=0 d=1 ${SOURCES[1:%i]}'%(len(updatelst)))
costs = upd+'-costs'
Flow(costs,[upd,semblst[len(semblst)-1]],
'''
varicost semb=${SOURCES[1]}
lambda=%g epsilon=%g
'''%(lmbda,epsilon))
modoutlst.append(vpicked)
updateoutlst.append(upd)
costoutlst.append(costs)
bestmod = name+'best-model'
worstmod = name+'worst-model'
finalcosts = name+'final-model-costs'
models = name+'models'
Flow(models,modoutlst,'cat axis=3 o=0 d=1 ${SOURCES[1:%i]}'%len(modoutlst))
Flow([bestmod,finalcosts,worstmod],[models,semblst[-1]],
'''
variminim semb=${SOURCES[1]} costs=${TARGETS[1]}
lambda=%g epsilon=%g worst=${TARGETS[2]}
'''%(lmbda,epsilon))
maxiter = niter*(len(semblst) )
maxcost = 148
mincost = 128
costmin = name+'minimum-cost'
Flow(costmin,finalcosts,'stack axis=0 min=y| spray axis=1 n=%i d=1 o=0'%maxiter)
costoutlst.append(costmin)
costoutlst.reverse()
costplots = []
scr = .66
for c in range(len(costoutlst)):
color = c%6+1
dash = 0
cost = costoutlst[c]
if c == 0:
color = 7
dash = 3
Plot(cost,
'''
pad2 bottom=%i| window n1=%i|
graph title="Continuation Cost Convergence"
label2=Cost label1=Iteration unit1= unit2=
plotcol=%i dash=%i
min2=%g max2=%g min1=%g max1=%g screenratio=%g
'''%(maxiter,maxiter,color,dash,mincost,maxcost,0,maxiter-1,scr))
costplots.append(cost)
costplots.reverse()
Result(name+'costs',costplots,'Overlay')
want_h1 = True
if want_h1 :
bestdx = bestmod+'-dx'
derivx = 'transp | deriv scale=y | transp '
Flow(bestdx,bestmod,derivx)
bestdt = bestmod+'-dt'
derivt = 'deriv scale=y | add mode=d ${SOURCES[0]}'
Flow(bestdt,bestmod,derivt)
mis = models+'-mis'
Flow(mis,[bestmod,models],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
modsdt = models+'-dt'
modsdx = models+'-dx'
misdt = mis+'-dt'
misdx = mis+'-dx'
Flow(modsdx,models,derivx)
Flow(misdx,[bestdx,modsdx],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
Flow(modsdt,models,derivt)
Flow(misdt,[bestdt,modsdt],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)"|
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
h1mis = models+'-h1mis'
Flow(h1mis,[mis,misdx,misdt],'math A=${SOURCES[1]} B=${SOURCES[2]} output="sqrt(input+A+B)/%g"'%(len(modoutlst)))
convlst = []
for update in updateoutlst:
updatedx = update+'-dx'
Flow(updatedx,update,derivx)
updatedifdx = updatedx+'-diff'
Flow(updatedifdx,[bestdx,updatedx],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
updatedt = update+'-dt'
Flow(updatedt,update,derivt)
updatedifdt = updatedt+'-diff'
Flow(updatedifdt,[bestdt,updatedt],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
updatedif = update+'-diff'
Flow(updatedif,[bestmod,update],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
h1conv = update+'-h1conv'
Flow(h1conv,[updatedif, updatedifdx , updatedifdt],
'''
math A=${SOURCES[1]} B=${SOURCES[2]} output="input+A+B"
''')
convlst.append(h1conv)
maxmisfit = 2
minmisfit = -12
convplots = []
convlst.reverse()
for c in range(len(convlst)):
color = (c+1)%6+1
dash = 0
conv = convlst[c]
Plot(conv,
'''
math output="log(sqrt(input))"|
pad2 bottom=%i | window n1=%i |
graph title="Continuation Misfit With Best Model"
label2="log(H\^1\_ Misfit)" label1=Iteration unit1= unit2=
plotcol=%i dash=%i
min2=%g max2=%g min1=%g max1=%g screenratio=%g
'''%(maxiter,maxiter,color,dash,minmisfit,maxmisfit,0,maxiter-1,scr))
convplots.append(conv)
Result(name+'convergence',convplots,'Overlay')
nocont_modoutlst = []
nocont_updateoutlst = []
nocont_costoutlst = []
for j in range(len(modlst)):
model = modlst[j]
updates = model+'-nocont-updates-pre'
vpicked = model+'-nocont-velo-out'
Flow([vpicked,updates],[semblst[-1],derivlst[-1],model],
'''
varipick dsemb=${SOURCES[1]} vo=${SOURCES[2]} updates=${TARGETS[1]}
lambda=%g rho=%g niter=%i epsilon=%g type=%s
'''%(lmbda,rho,niter,epsilon,searchtype))
upd = model+'-nocont-updates'
Flow(upd,[model,updates],'cat axis=3 d=1 o=0 ${SOURCES[1]}')
costs = upd+'-costs'
Flow(costs,[upd,semblst[-1]],
'''
varicost semb=${SOURCES[1]}
lambda=%g epsilon=%g
'''%(lmbda,epsilon))
nocont_modoutlst.append(vpicked)
nocont_updateoutlst.append(upd)
nocont_costoutlst.append(costs)
nocont_bestmod = name+'nocont-best-model'
nocont_worstmod = name+'nocont-worst-model'
nocont_finalcosts = name+'nocont-final-model-costs'
nocont_models = name+'nocont-models'
Flow(nocont_models,nocont_modoutlst,'cat axis=3 d=1 o=0 ${SOURCES[1:%i]}'%len(nocont_modoutlst))
Flow([nocont_bestmod,nocont_finalcosts,nocont_worstmod],[nocont_models,semblst[-1]],
'''
variminim semb=${SOURCES[1]} costs=${TARGETS[1]}
lambda=%g epsilon=%g worst=${TARGETS[2]}
'''%(lmbda,epsilon))
costmin_nocont = name+'minimum-cost-for-nocont'
Flow(costmin_nocont,finalcosts,'stack axis=0 min=y| spray axis=1 n=%i d=1 o=0'%niter)
nocont_costoutlst.append(costmin_nocont)
nocont_costoutlst.reverse()
nocont_costplots = []
for c in range(len(nocont_costoutlst)):
color = (c)%6+1
dash = 0
cost = nocont_costoutlst[c]
if c == 0:
color = 7
dash = 3
Plot(cost,
'''
pad2 bottom=%i| window n1=%i|
graph title="Non-Continuation Cost Convergence"
label2=Cost label1=Iteration unit1= unit2=
plotcol=%i dash=%i
min2=%g max2=%g min1=%g max1=%g screenratio=%g
'''%(niter,niter,color,dash,mincost,maxcost,0,niter-1,scr))
nocont_costplots.append(cost)
nocont_costplots.reverse()
Result(name+'noncont-costs',nocont_costplots,'Overlay')
if want_h1 :
nocont_mis = nocont_models+'-mis'
Flow(nocont_mis,[bestmod,nocont_models],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
nocont_modsdt = nocont_models+'-dt'
nocont_modsdx = nocont_models+'-dx'
nocont_misdt = nocont_mis+'-dt'
nocont_misdx = nocont_mis+'-dx'
Flow(nocont_modsdx,nocont_models,derivx)
Flow(nocont_misdx,[bestdx,nocont_modsdx],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
Flow(nocont_modsdt,nocont_models,derivt)
Flow(nocont_misdt,[bestdt,nocont_modsdt],
'''
spray axis=3 n=%i d=%g o=%g|
math A=${SOURCES[1]} output="(input-A)*(input-A)"|
stack axis=3 mean=n
'''%(len(modoutlst),1,0))
nocont_h1mis = nocont_models+'-h1mis'
Flow(nocont_h1mis,[nocont_mis,nocont_misdx,nocont_misdt],'math A=${SOURCES[1]} B=${SOURCES[2]} output="sqrt(input+A+B)/%g"'%(len(modoutlst)))
nocont_convlst = []
for update in nocont_updateoutlst:
updatedx = update+'-dx'
Flow(updatedx,update,derivx)
updatedifdx = updatedx+'-diff'
Flow(updatedifdx,[bestdx,updatedx],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
updatedt = update+'-dt'
Flow(updatedt,update,derivt)
updatedifdt = updatedt+'-diff'
Flow(updatedifdt,[bestdt,updatedt],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
updatedif = update+'-diff'
Flow(updatedif,[bestmod,update],
'''
spray axis=3 n=%s d=1 o=0|
math A=${SOURCES[1]} output="(input-A)*(input-A)" |
stack axis=1 mean=n |
stack axis=1 mean=n
'''%(getstring2('n3')))
h1conv = update+'-h1conv'
Flow(h1conv,[updatedif, updatedifdx , updatedifdt],
'''
math A=${SOURCES[1]} B=${SOURCES[2]} output="input+A+B"
''')
nocont_convlst.append(h1conv)
nocont_convplots = []
for c in range(len(nocont_convlst)):
color = (c+1)%6+1
dash = 0
conv = nocont_convlst[c]
Plot(conv,
'''
math output="log(sqrt(input))"|
pad2 bottom=%i | window n1=%i |
graph title="Non-Continuation Misfit With Best Model"
label2="log(H\^1\_ Misfit)" label1=Iteration unit1= unit2=
plotcol=%i dash=%i
min2=%g max2=%g min1=%g max1=%g screenratio=%g
'''%(niter,niter,color,dash,minmisfit,maxmisfit,0,niter-1,scr))
nocont_convplots.append(conv)
Result(name+'nocont-convergence',nocont_convplots,'Overlay')
point1 = 0.9
point2 = 0.5
min1 = 0.1
max1 = 3.1
min2 = xo
max2 = xf
xwindow = nx/2+10
xlst = [8.5,11.5,14.1,15.7]
sembias = 0.05
larn=28
titlesz = 20
v0plt = 1.45
vfplt = vf
scr0 = 1.8
titlesz0 = 8
labelsz0 = 6
velplot = '''grey color=j
scalebar=y barlabel="Velocity" barunit="km/s"
min1=%g max1=%g min2=%g max2=%g'''%(min1,max1,min2,max2)
letterboxsemb = '''grey color=j allpos=y bias=%g pclip=100
scalebar=y barlabel=Semblance
min1=%g max1=%g min2=%g max2=%g screenratio=%g
labelsz=%g titlesz=%g'''%(sembias,min1,max1,v0plt,vfplt,scr0,labelsz0,titlesz0)
letterboxgraph = '''graph
transp=y min1=%g max1=%g min2=%g max2=%g
scalebar=y title= labelsz=%g titlesz=%g plotfat=12 screenratio=%g
label1= label2= unit1= unit2= n1tic=0 n2tic=0'''%(max1,min1,v0plt,vfplt,labelsz0,titlesz0,scr0)
letterboxgatherplot = '''grey min1=%g max1=%g labelsz=%g titlesz=%g pclip=95 screenratio=%g
'''%(min1,max1,labelsz0,titlesz0,scr0)
stkmin1 = .5
stkmax1 = 2.4
stkmin2 = 12.1
stkmax2 = 14.8
stkplot = ''' grey min1=%g max1=%g min2=%g max2=%g clip=1.5e7 screenratio=.85'''%(min1,max1,min2,max2)
stkplotb = ''' grey min1=%g max1=%g min2=%g max2=%g clip=1.5e7 scalebar=y barlabel=Amplitude'''%(min1,max1,min2,max2)
imgplot = ''' grey min1=%g max1=%g min2=%g max2=%g barlabel=Amplitude'''%(min1,max1,min2,max2)
stkplotz = ''' grey min1=%g max1=%g min2=%g max2=%g clip=1.5e7 screenratio=.85'''%(stkmin1,stkmax1,stkmin2,stkmax2)
wglplot = ''' window j2=4 f2=2|
wiggle min1=%g max1=%g min2=%g max2=%g
transp=y wherexlabel=top
wheretitle=bottom grid2=n'''%(max1,min1,min2,max2)
sembplot = '''grey color=j allpos=y bias=%g pclip=100
scalebar=y barlabel=Semblance
min1=%g max1=%g min2=%g max2=%g
larnersz=%g titlesz=%g'''%(sembias,min1,max1,v0plt,vfplt,larn,titlesz)
velgraph = '''graph
transp=y min1=%g max1=%g min2=%g max2=%g
scalebar=y title= larnersz=%g titlesz=%g plotfat=12
label1= label2= unit1= unit2= n1tic=0 n2tic=0'''%(max1,min1,v0plt,vfplt,larn,titlesz)
gatherplot = '''grey min1=%g max1=%g larnersz=%g titlesz=%g pclip=95
'''%(min1,max1,larn,titlesz)
cmplot = '''window f2=1 min1=%g|
byte gainpanel=e pclip=95|
grey3 frame1=0 frame2=0
flat=n point1=.7 point2=.7
framelabel1=n framelabel2=n
'''%(min1)
pksmbplot = '''grey color=j scalebar=y barlabel=Semblance
min1=%g max1=%g min2=%g max2=%g minval=0 maxval=0.5 bias=0.25
'''%(min1,max1,min2,max2)
if want_h1 :
Result(h1mis,
'''
grey color=j allpos=y scalebar=y barlabel="Mean H\^1\_ Misfit"
title="Mean Continuation H\^1\_ Misfit"
min1=%g max1=%g min2=%g max2=%g label2="Midpoint" unit2=km
'''%(min1,max1,min2,max2))
Result(nocont_h1mis,
'''
grey color=j allpos=y scalebar=y barlabel="Mean H\^1\_ Misfit"
title="Mean Non-Continuation H\^1\_ Misfit"
min1=%g max1=%g min2=%g max2=%g label2="Midpoint" unit2=km
'''%(min1,max1,min2,max2))
final = bestmod
for i in range(len(xlst)):
x = xlst[i]
semb = vscan+'-%i'%i
Flow(semb,vscan,'window n3=1 min3=%g'%x)
vend = final+'-%i'%i
Flow(vend,final,'window n2=1 min2=%g'%x)
Plot(semb,sembplot+' title="Velocity Pick"')
Plot(semb+'-0',semb,letterboxsemb+' title="NMO Scan at %g km"'%x)
Plot(vend,velgraph+' dash=0 plotcol=4')
Plot(vend+'-0',vend,letterboxgraph+' dash=0 plotcol=4')
scn = name+'scan-%i'%i
Plot(scn,[semb,vend],'Overlay')
Plot(scn+'-0',[semb+'-0',vend+'-0'],'Overlay')
Result(scn+'-0',[semb+'-0',vend+'-0'],'Overlay')
Result(cmps+'-%i'%i,cmps,cmplot+' frame3=%i title="CMP Gathers"'%((x-xo)/dx+1))
Result(vscan+'-%i'%i,[vscan,bar],
'''byte allpos=y gainpanel=e minval=0 maxval=0.5 |
grey3 color=j frame1=0 frame2=%i frame3=%i title="Semblance Scan"
bar=${SOURCES[1]} barlabel=Semblance flat=n point1=.9 point2=0.5 scalebar=y
'''%(nv/3,(x-xo)/dx+1))
vellist = [final]
titles = ['Best Model']
letters = ['NMO Gather']
nmolst = []
for i in range(len(vellist)):
vel = vellist[i]
title = titles[i]
nmo = vel+'-nmo'
Flow(nmo,[cmps,vel],'nmo half=n velocity=${SOURCES[1]} ')
smthcmp = vel+'-smthcmp'
Flow(smthcmp,[nmo,vel],'smooth rect2=10 rect3=4 | nmo half=n velocity=${SOURCES[1]} inv=y')
smb = vel+'-semb'
Flow(smb,[vscan,vel],'slice pick=${SOURCES[1]}')
Plot(smb,pksmbplot+' title="%s Semblance" '%(title))
Result(smb,pksmbplot+' title="%s Semblance" '%(title))
stk = nmo+'-stk'
Flow(stk,nmo,'stack axis=2 norm=n ')
slope = stk+'-slope'
Flow(slope,stk,'dip rect1=50 rect2=20')
refl = stk+'-refl'
Flow(refl,[stk,slope],'pwspray dip=${SOURCES[1]} ns=2 | stack axis=2')
Result(refl,stkplot+' title="%s Enhanced Reflections"'%title)
difr = stk+'-difr'
Flow(difr,[stk,refl],'math A=${SOURCES[1]} output="input-A"')
Result(difr,stkplot+' title="%s Separated Diffractions"'%title)
Result(difr+'-z',difr,stkplotz+' title="Zoomed %s Diffractions"'%title)
Result(vel,velplot+' title="%s" bias=%g allpos=y label2=Midpoint unit2=km'%(title,vo))
Plot(vel,velplot+' title= bias=%g allpos=y'%(vo))
Result(stk,stkplot+' title="%s NMO Stack"'%title)
Result(stk+'-b',stk,stkplotb+' title="%s NMO Stack" '%title)
Result(stk+'-z',stk,stkplotz+' title="Zoomed %s NMO Stack"'%title)
Plot(stk+'-w',stk,wglplot+' title="%s NMO Stack" scalebar=y '%title)
Result(vel+'-overlay',[vel,stk+'-w'],'Overlay')
for j in range(len(xlst)):
x = xlst[j]
gather = nmo+'-%i'%j
Flow(gather,nmo,'window n3=1 min3=%g'%x)
Plot(gather,gatherplot+' title="%s"'%letters[i])
Result(gather+'-0',gather,letterboxgatherplot+' title="%s"'%titles[i])
img = vel+'-image'
Flow(img,[stk,vel],'kirchnew velocity=${SOURCES[1]}')
Result(img,imgplot+' title="%s Image"'%(title))
difimg = vel+'-difr-img'
Flow(difimg,[difr,vel],'kirchnew velocity=${SOURCES[1]}')
Result(difimg,imgplot+' title="%s Diffraction Image"'%(title))
for i in range(len(xlst)):
gather = name+'gather-%i'%i
Result(gather,[name+'scan-%i'%i,final+'-nmo-%i'%i],'SideBySideAniso')
allvels = [bestmod,worstmod,nocont_bestmod,nocont_worstmod]
alltitles = ['Best Continuation Final Model','Worst Continuation Final Model','Best Non-Continuation Final Model','Worst Non-Continuation Final Model']
for iv in range(len(allvels)):
vel=allvels[iv]
title = alltitles[iv]
Result(vel+'-final-plot',vel,velplot+' title="%s" bias=%g allpos=y label2=Midpoint unit2=km'%(title,vo))
End() |