from rsf.proj import *
Flow('wavelet',None,
'''
spike n1=1500 d1=0.001 k1=201 |
ricker1 frequency=10
''')
Result('spectra','wavelet',
'''
spectra |window n1=50 |
graph title="Source Spectra"
''')
Flow('source',None,
'''
spike n1=501 n2=501 d1=0.01 d2=0.01
label1=x1 unit1=km label2=x2 unit2=km
k1=201 k2=251
''')
Flow('v0','source','math output=2.')
Flow('detv',None,
'''
spike n1=501 d1=0.01 o1=0 k1=300,301,302 mag=0.02 |
spray axis=2 n=501 d=0.01 o=0 |
costaper nw2=25
''')
Flow('vel','v0 detv','add ${SOURCES[1]}')
Result('vel',
'''
grey scalebar=y barreverse=y
color=j bias=2.01 title="Velocity"
''')
def modeling(born):
return'''
./${SOURCES[1]} wav=${SOURCES[2]}
v=${SOURCES[3]} detv=${SOURCES[4]}
snapshot=${TARGETS[1]}
born=%s ft=200 jt=20
nr=301 r0=100 rz=200
''' %born
def plot(title):
return'''
cat ${SOURCES[1]} axis=3 |
window n2=1 f2=150 min1=1. max1=1.4 |
graph dash=0,1 title="%s"
label2=Amplitude unit2=
wheretitle=bottom wherexlabel=top
screenratio=0.33 screenht=4.5
labelsz=7 titlesz=8
labelfat=3 plotfat=9 titlefat=4 plotcol=4,7
''' %title
proj=Project()
exe_wave = proj.Program('born_c.c')
Flow('full_c full_snap_c','source %s wavelet vel detv' %exe_wave[0], modeling('n'));
Flow('diving_c diving_snap_c','source %s wavelet v0 detv' %exe_wave[0], modeling('n'));
Flow('diff_c','full_c diving_c','add ${SOURCES[1]} scale=1,-1')
Flow('born_c born_snap_c','source %s wavelet v0 detv' %exe_wave[0], modeling('y'));
Result('comp_c','diff_c born_c', plot('C: U-U\_0\^ (solid) vs. \F10 d\F3 U (dashed)'))
exe_wave = proj.Program('born_cc.cc',
LIBS=['rsf++']+proj.get('LIBS'))
Flow('full_cc full_snap_cc','source %s wavelet vel detv' %exe_wave[0], modeling('n'));
Flow('diving_cc diving_snap_cc','source %s wavelet v0 detv' %exe_wave[0], modeling('n'));
Flow('diff_cc','full_cc diving_cc','add ${SOURCES[1]} scale=1,-1')
Flow('born_cc born_snap_cc','source %s wavelet v0 detv' %exe_wave[0], modeling('y'));
Result('comp_cc','diff_cc born_cc', plot('C++: U-U\_0\^ (solid) vs. \F10 d\F3 U (dashed)'))
exe_wave = proj.Program('born_f90.f90',
LIBS=['rsff90']+proj.get('LIBS'))
Flow('full_f90 full_snap_f90','source %s wavelet vel detv' %exe_wave[0], modeling('n'));
Flow('diving_f90 diving_snap_f90','source %s wavelet v0 detv' %exe_wave[0], modeling('n'));
Flow('diff_f90','full_f90 diving_f90','add ${SOURCES[1]} scale=1,-1')
Flow('born_f90 born_snap_f90','source %s wavelet v0 detv' %exe_wave[0], modeling('y'));
Result('comp_f90','diff_f90 born_f90', plot('F90: U-U\_0\^ (solid) vs. \F10 d\F3 U (dashed)'))
Result('comps','Fig/comp_c.vpl Fig/comp_cc.vpl Fig/comp_f90.vpl','OverUnderAniso')
End() |