up [pdf]
from rsf.proj import *

Flow('vrms',None,
     'math d1=0.004 n1=1001 o1=0 output="x1*125+2000+50*sin(9*x1)" ')

Flow('synt',None,
     '''
     spike d1=0.004 n1=1001 |
     noise rep=y seed=2006 |
     cut n1=100 | 
     bandpass flo=4 fhi=20 |
     spray axis=2 n=141 d=25 o=0 label=Offset unit=m 
     ''')

Flow('cmpa','synt vrms',
     'inmo velocity=${SOURCES[1]} half=n | noise seed=2007 var=0.01')

Flow('top','synt','window n1=400')
Flow('mid','synt',
     'window f1=400 n1=300 | math output="input*(1-x2*%g)" ' % (2.0/3500))
Flow('bot','synt','window f1=700')

Flow('cmpb','top mid bot vrms',
     '''
     cat axis=1 ${SOURCES[1:3]} |
     inmo velocity=${SOURCES[3]} half=n |
     noise seed=2007 var=0.01
     ''')

for case in ('a','b'):
    cmp = 'cmp' + case
    Plot(cmp,'grey title="(%s)" ' % case)

    for avo in ('','avo'):
        scn = avo + 'scn' + case
        Flow(scn,cmp,'vscan half=n v0=2000 dv=10 nv=101 %ssemblance=y' % avo)
        Plot(scn+'0',scn,
             '''
             grey color=j allpos=y title="(%s)" pclip=100
             ''' % case)

        pik = avo + 'pik' + case
        Flow(pik,scn,'scale axis=2 | pick rect1=50')
        Plot(pik,
             '''
             graph yreverse=y transp=y min2=2000 max2=3000 pad=n
             plotcol=7 plotfat=7 wanttitle=n wantaxis=n
             ''')

        Plot(scn,[scn+'0',pik],'Overlay')

        slc = avo + 'slc' + case
        Flow(slc,[scn,'avopik'+case],'slice pick=${SOURCES[1]}')

        nmo = avo + 'nmo' + case
        Flow(nmo,[cmp,pik],'nmo half=n velocity=${SOURCES[1]} str=0.4')
        Plot(nmo,
             '''
             grey title="(%s)"
             grid2=y gridcol=6 gridfat=7 g2num=0.5
             ''' % case)

    attr = 'attr'+case
    Flow(attr,['avoslc'+case,'slc'+case],
         '''
         add mode=d ${SOURCES[1]} | smooth rect1=25 |
         spray axis=2 n=141 d=25 o=0
         ''')
    Plot(attr,['avonmo'+case,attr],
         '''
         add ${SOURCES[1]} |
         grey color=j title="(%s)" allpos=y clip=5
         ''' % case)

for plot in Split('cmp scn avoscn nmo avonmo attr'):
    Result(plot,[plot+'a',plot+'b'],'SideBySideAniso')

End()

sfmath
sfspike
sfnoise
sfcut
sfbandpass
sfspray
sfinmo
sfwindow
sfcat
sfgrey
sfvscan
sfscale
sfpick
sfgraph
sfslice
sfnmo
sfadd
sfsmooth