up [pdf]
from rsf.proj import *

Flow('vel1',None,
        '''
        math output=1.5 n1=40 n2=200 d1=0.005 d2=0.005
        label1=x1 unit1=km label2=x2 unit2=km 
        ''')
Flow('vel2',None,
        '''
        math output=1.6 n1=40 n2=200 d1=0.005 d2=0.005
        label1=x1 unit1=km label2=x2 unit2=km 
        ''')
Flow('vel3',None,
        '''
        math output=1.7 n1=40 n2=200 d1=0.005 d2=0.005
        label1=x1 unit1=km label2=x2 unit2=km 
        ''')
Flow('vel4',None,
        '''
        math output=1.8 n1=40 n2=200 d1=0.005 d2=0.005
        label1=x1 unit1=km label2=x2 unit2=km 
        ''')
Flow('vel5',None,
        '''
        math output=1.9 n1=40 n2=200 d1=0.005 d2=0.005
        label1=x1 unit1=km label2=x2 unit2=km 
        ''')
Flow('veladcig',['vel1','vel2', 'vel3','vel4','vel5'], 'cat axis=1 ${SOURCES[1:5]}')
Result('veladcig','grey title="velocity model:2 layers" color=j scalebar=y mean=y')

Flow('velsmooth','veladcig','smooth rect1=5 rect2=8 repeat=8')
Result('velsmooth','grey mean=y color=j scalebar=y title="smoothed background" ')

n1=200
n2=200
na=60
Flow('adcig vecx vecz','veladcig velsmooth',
        '''
        rtmadcig velsmooth=${SOURCES[1]} vecx=${TARGETS[1]} vecz=${TARGETS[2]} 
        nb=20 na=%d nt=1500 kt=450 fm=25 dt=0.001 ns=9 ng=200 csdgather=n
        sxbeg=20 szbeg=1 jsx=20 jsz=0 
        gxbeg=0 gzbeg=1 jgx=1 jgz=0 
        '''%(na))
Result('stackedimage','adcig',
        '''
        stack axis=3 |grey title="RTM Image" label1=Depth unit1=km label2=Distance unit2=km
        ''')
Plot('vecx','grey title="Vector-X" scalebar=y color=j mean=y')
Plot('vecz','grey title="Vector-Z" scalebar=y color=j mean=y')
Result('vecxz','vecx vecz','SideBySideIso')


Flow('myadcig','adcig','sftransp plane=23|sfput n1=%d n2=%d n3=1'%(n1,n2*na))
fronts = []
for icig in range(1,7,1):
    adcig = 'adcig%d' % icig
    location=icig*30
    Plot(adcig,'adcig',
         '''
         sfwindow f2=%d n2=1|sfput n1=%d n2=%d n3=1|
         grey label1=Depth unit1=km label2=Angle unit2=Degree scalebar=y
         '''%(location, n1,na))
Result('allcig','adcig1 adcig2 adcig3 adcig4 adcig5 adcig6','SideBySideAniso')


End()

sfmath
sfcat
sfgrey
sfrtmadcig
sftransp
sfsmooth
sfstack