from rsf.proj import *
import math
s02 = 1.
qx = 0.052/2
min2 = 0.5
max2 = 6.5
Flow('slow2',None,
'''
math n1=101 n2=361 d1=0.02 d2=0.02 output="%g-2*%g*x2"
label1=Depth unit1=km label2=Position unit2=km
label=Slowness-squared unit="s\^2\_/km\^2"
''' % (s02,qx))
Flow('v2','slow2','math output="1/input" ')
Plot('v2',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="True w(x,z)"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=1 maxval=1.5 bias=1 clip=0.5
screenratio=0.75 screenht=9 allpos=y barlabel="v\^2\_" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Flow('depsigma','slow2',
'''
math output="sqrt(((%g-2*%g*x2)-sqrt((%g-2*%g*x2)^2-4*%g*%g*x1*x1))/(2*%g*%g))" |
put label=Sigma unit=
''' % (s02,qx,s02,qx,qx,qx,qx,qx))
Flow('ax0','depsigma',
'''
math output="x2+%g*input*input/2" |
put label=Position unit=km
''' % qx)
Plot('ax0',
'''
window min2=%g max2=%g |
grey color=j scalebar=y allpos=y barreverse=y
labelsz=15 titlesz=16 titlefat=8 labelfat=6
title="Analytical x\_0\^" screenratio=0.75 screenht=9
minval=0 maxval=7.5 clip=7.5
''' % (min2,max2))
Plot('cax0','ax0',
'''
window min2=%g max2=%g |
contour nc=100 scalebar=y plotcol=7 plotfat=7
wantaxis=n wanttitle=n screenratio=0.75 screenht=9
''' % (min2,max2))
Plot('x0','ax0 cax0','Overlay')
Flow('at0','ax0 depsigma',
'''
math sigma=${SOURCES[1]}
output="(%g-2*%g*input)*sigma+%g*%g*sigma*sigma*sigma/3" |
put label=Time unit=s
''' % (s02,qx,qx,qx))
Plot('at0',
'''
window min2=%g max2=%g |
grey color=j scalebar=y allpos=y barreverse=y
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=0 maxval=2 clip=2
title="Analytical t\_0\^" screenratio=0.75 screenht=9
''' % (min2,max2))
Plot('cat0','at0',
'''
window min2=%g max2=%g |
contour nc=40 scalebar=y plotcol=7 plotfat=7
wantaxis=n wanttitle=n screenratio=0.75 screenht=9
''' % (min2,max2))
Plot('t0','at0 cat0','Overlay')
Flow('ageo','slow2',
'''
math output="2*((%g-2*%g*x2)^2-4*%g*%g*x1*x1)/(%g-2*%g*x2)/(%g-2*%g*x2+sqrt((%g-2*%g*x2)^2-4*%g*%g*x1*x1))"
''' % (s02,qx,qx,qx,s02,qx,s02,qx,s02,qx,qx,qx))
Plot('ageo',
'''
window min2=%g max2=%g |
grey color=j scalebar=y allpos=y
labelsz=15 titlesz=16 titlefat=8 labelfat=6
barlabel="Q\^2\_" barunit= minval=0.65 maxval=1 bias=0.65 clip=0.35
title="Geometrical Spreading" screenratio=0.65 screenht=9
''' % (min2,max2))
Flow('timsigma',None,
'''
math n1=626 n2=361 d1=0.004 d2=0.02
output="((3*x1+sqrt(9*x1*x1+4*(%g-2*%g*x2)^3/(%g*%g)))/(2*%g*%g))^(1./3)-(%g-2*%g*x2)/%g*(2/(3*%g*x1+sqrt(9*%g*%g*x1*x1+4*(%g-2*%g*x2)^3)))^(1./3)"
label1=Time unit1=s label2=Position unit2=km
label=Sigma unit= |
cut n1=1
''' % (s02,qx,qx,qx,qx,qx,s02,qx,qx,qx,qx,qx,s02,qx))
Flow('dix','timsigma',
'''
math output="sqrt(%g-2*%g*x2)/(%g-2*%g*x2-%g*%g*input*input)" |
put label=Velocity unit=km/s
''' % (s02,qx,s02,qx,qx,qx))
Plot('dix',
'''
window min2=%g max2=%g | math output="input^2"|
grey color=j scalebar=y allpos=y bias=1
labelsz=15 titlesz=16 titlefat=8 labelfat=6
title="w\_d\^(x\_0\^,t\_0\^)" barlabel="v\^2\_" barunit="km\^2\_/s\^2"
screenratio=0.65 screenht=9 minval=1 maxval=1.35 bias=1 clip=0.35
''' % (min2,max2))
Flow('dixdepth','dix',
'''
time2depth velocity=$SOURCE intime=y twoway=n nz=101 dz=0.02 |
put label1=Depth unit1=km
''')
Result('model-slow','v2 x0 t0','OverUnderAniso')
Flow('slowz','dixdepth','window n2=1 f2=180 | math output="1/input" | spray axis=2 n=361 o=0 d=0.02')
Flow('dslow','slowz slow2','math true=${SOURCES[1]} output="sqrt(input^2-true)"')
Plot('slowz',
'''
window min2=%g max2=%g |
grey color=j scalebar=y allpos=y title="Reference V(z)" pclip=100
labelsz=15 titlesz=16 titlefat=8 labelfat=6 barlabel="Slowness" barunit="s/km"
minval=0.12 maxval=0.95 clip=0.95 screenratio=0.65 screenht=9
''' % (min2,max2))
Flow('ax0z','slowz',
'''
math output="x2" |
put label=Position unit=km
''')
Flow('at0z','slowz',
'''
math output="x1*input" |
put label=Time unit=s
''')
Flow('dv2dt0','dix','math output="input^2" | smoothder')
Flow('dv2dx0','dix','math output="input^2" | transp | smoothder | transp')
Flow('beta','dv2dt0 dix',
'''
time2depth velocity=${SOURCES[1]} intime=y twoway=n nz=101 dz=0.02 |
put label1=Depth unit1=km
''')
Flow('alpha','dv2dx0 dix',
'''
time2depth velocity=${SOURCES[1]} intime=y twoway=n nz=101 dz=0.02 |
put label1=Depth unit1=km
''')
Plot('alpha',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="dw\_d\^/dx\_0" pclip=100
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=0 allpos=y
screenratio=0.75 screenht=9 allpos=y barlabel="dw\_d\^/dx\_0\^" barunit="km/s\^2"
''' % (min2,max2))
Plot('beta',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="dw\_d\^/dt\_0" pclip=100
labelsz=15 titlesz=16 titlefat=8 labelfat=6
screenratio=0.75 screenht=9 allpos=y barlabel="dw\_d\^/dt\_0\^" barunit="km\^2\_/s\^3"
''' % (min2,max2))
Flow('refdix','dixdepth','math output="input^2" ')
Flow('refvz','slowz','math output="1/input^2" ')
Plot('refdix',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Ref w\_dr\^(x,z)"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=1 maxval=1.5 bias=1 clip=0.5
screenratio=0.75 screenht=9 allpos=y barlabel="v\^2" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Plot('refvz',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Ref w\_r\^(z)"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=1 maxval=1.35 bias=1 clip=0.35
screenratio=0.75 screenht=9 allpos=y barlabel="v\^2" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Result('input-slow','refdix alpha beta','OverUnderAniso')
for i in ['refdix','refvz','alpha','beta']:
Flow(i+'_remap',i,'window')
Flow('depth dx0 dt0 dv','refdix_remap refvz_remap alpha_remap beta_remap',
'''
time2depthweak zsubsample=10 nsmooth=3
velocity=$SOURCE refvelocity=${SOURCES[1]} dvdx0=${SOURCES[2]} dvdt0=${SOURCES[3]}
outdx0=${TARGETS[1]} outdt0=${TARGETS[2]} outdv=${TARGETS[3]}
''')
Flow('dt0true','at0 at0z','math est=${SOURCES[1]} output="input-est" ')
Plot('dt0true',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Analytical \F10 D\F3 t\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.15 maxval=0.15 clip=0.15 bias=0
screenratio=0.75 screenht=9 barlabel="Time (s)" barunit=
''' % (min2,max2))
Plot('dt0',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Estimated \F10 D\F3 t\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.15 maxval=0.15 clip=0.15 bias=0
screenratio=0.75 screenht=9 barlabel="Time (s)" barunit=
''' % (min2,max2))
Result('dt0compare','dt0true dt0','OverUnderAniso')
Flow('dt0err','dt0true dt0','math est=${SOURCES[1]} output="input-est"')
Plot('dt0err',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Error from estimated \F10 D\F3 t\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.15 maxval=0.15 clip=0.15 bias=0
screenratio=0.75 screenht=9 barlabel="Time (s)" barunit=
''' % (min2,max2))
Flow('dx0true','ax0 ax0z','math est=${SOURCES[1]} output="input-est" ')
Plot('dx0true ',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Analytical \F10 D\F3 x\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=0 maxval=0.1 clip=0.1 allpos=y
screenratio=0.75 screenht=9 barlabel="Position (km)" barunit=
''' % (min2,max2))
Plot('dx0',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Estimated \F10 D\F3 x\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=0 maxval=0.1 clip=0.1 allpos=y
screenratio=0.75 screenht=9 barlabel="Position (km)" barunit=
''' % (min2,max2))
Result('dx0compare','dx0true dx0','OverUnderAniso')
Flow('dx0err','dx0true dx0','math est=${SOURCES[1]} output="input-est"')
Plot('dx0err',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Error from estimated \F10 D\F3 x\_0"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=0 maxval=0.1 clip=0.1
screenratio=0.75 screenht=9 barlabel="Position (km)" barunit=
''' % (min2,max2))
Flow('dv2true','slow2 refvz','math est=${SOURCES[1]} output="1/input-est" ')
Plot('dv2true ',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Analytical \F10 D\F3 w"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.25 maxval=0.25 clip=0.25 bias=0
screenratio=0.75 screenht=9 barlabel="v\^2" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Plot('dv',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Estimated \F10 D\F3 w "
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.25 maxval=0.25 clip=0.25 bias=0
screenratio=0.75 screenht=9 barlabel="v\^2" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Result('dv2compare','dv2true dv','OverUnderAniso')
Flow('dv2err','dv2true dv','math est=${SOURCES[1]} output="(input-est)"')
Plot('dv2err',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Error from estimated \F10 D\F3 w"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 minval=-0.25 maxval=0.25 clip=0.25 bias=0
screenratio=0.75 screenht=9 barlabel="v\^2" barunit="km\^2\_/s\^2"
''' % (min2,max2))
Result('truecompare','dt0true dx0true dv2true','OverUnderAniso')
Result('estcompare-slow','dt0 dx0 dv','OverUnderAniso')
Result('errcompare-slow','dt0err dx0err dv2err','OverUnderAniso')
Flow('errvdix','slow2 dixdepth','math est=${SOURCES[1]} output="abs(1/sqrt(input)-est)" ')
Flow('errvest','slow2 refvz dv','math b=${SOURCES[1]} c=${SOURCES[2]} output="abs(1/sqrt(input)-sqrt(b+c))" ')
Plot('errvdix',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Velocity error from conventional Dix inversion"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=0 maxval=0.01 clip=0.01 bias=0
screenratio=0.75 screenht=9 barlabel="v" barunit="km/s"
''' % (min2,max2))
Plot('errvest',
'''
window min2=%g max2=%g |
grey color=j scalebar=y title="Velocity error from the proposed method"
labelsz=15 titlesz=16 titlefat=8 labelfat=6 allpos=y minval=0 maxval=0.01 clip=0.01 bias=0
screenratio=0.75 screenht=9 barlabel="v" barunit="km/s"
''' % (min2,max2))
Result('errvcompare','errvdix errvest','OverUnderAniso')
End() |