from rsf.proj import *
n1 = 401
n2 = 801
d1 = 1./(n1-1)
d2 = 2./(n2-1)
Flow('modl',None,
'''
math n1=%d n2=%d d1=%g d2=%g output="1.+3.*x1" |
put label1=z unit1=km label2=x unit2=km
label=Velocity unit=km\/s
''' % (n1,n2,d1,d2))
Plot('modl',
'''
grey color=j scalebar=y allpos=y screenratio=0.455
title=Model labelsz=5 titlesz=7 barreverse=y
labelsz=10.5 titlesz=12.5 labelfat=5 titlefat=5
nc=100 plotfat=7
''')
Flow('dsr fdsr','modl','dsreiko flag=${TARGETS[1]}')
Flow('dsrg','dsr fdsr modl',
'''
math output=1. | cut n1=%d f1=1 | cut n2=%d | cut n3=%d f3=1 |
dsrtomo what=l adj=y reco=${SOURCES[0]} flag=${SOURCES[1]} grad=${SOURCES[2]}
''' % (n1-1,n2-1,n2-1))
Plot('dsrg',
'''
grey color=j scalebar=y allpos=y screenratio=0.455
title="DSR Gradient" barreverse=y barlabel=Slowness-squared barunit="s\^2\_/km\^2\_"
label1=z label2=x minval=0. maxval=0.0002 clip=0.0002
labelsz=10.5 titlesz=12.5 labelfat=5 titlefat=5
''')
Flow('stemp2',None,
'math n1=1 d1=%g o1=0. output=x1 | transp' % d2)
Flow('stemp1','stemp2','math output=0.')
Flow('shots','stemp1 stemp2',
'cat axis=1 ${SOURCES[1]} ${SOURCES[0]}')
Flow('std','modl shots','spray axis=3 n=1 d=%g | eikonal order=1 shotfile=${SOURCES[1]}' % d2)
Flow('stdg','std',
'''
math output=1. | cut n1=%d f1=1 | cut n2=%d |
ftoper adj=y time=${SOURCES[0]} |
scale dscale=0.5
''' % (n1-1,n2-1))
Plot('stdg','stdg',
'''
grey color=j scalebar=y allpos=y screenratio=0.455
title="Standard Gradient" barreverse=y barlabel=Slowness-squared barunit="s\^2\_/km\^2\_"
label1=z label2=x minval=0. maxval=0.0002 clip=0.0002
labelsz=10.5 titlesz=12.5 labelfat=5 titlefat=5
''')
Plot('cmodl','std',
'''
contour allpos=y scalebar=y screenratio=0.455
nc=100 plotfat=8 plotcol=7
wanttitle=n wantaxis=n
''')
Plot('cmodl0','modl cmodl','Overlay')
Plot('cdsr','dsr',
'''
window n3=1 n1=1 |
graph labelsz=10 titlesz=12 labelfat=5 titlefat=5
dash=1 title="Forward Modeling" max2=1.3 min2=-0.01 screenratio=0.5
plotcol=3 plotfat=7
''')
Plot('cstd','std',
'''
window n4=1 n1=1 |
graph labelsz=10 titlesz=12 labelfat=5 titlefat=5
dash=0 wanttitle=n wantaxis=n max2=1.3 min2=-0.01 screenratio=0.5
plotcol=6 plotfat=7
''')
Plot('curve','cdsr cstd','Overlay')
Result('modl','modl curve','OverUnderIso')
Result('grad','cmodl0 stdg dsrg','OverUnderIso')
End() |