up [pdf]
from rsf.proj import *


Flow('syn',None,
     '''
     sfspike n1=500 d1=0.001  o1=0 n2=30 d2=0.001 o2=0 nsp=4 mag=1,1,1,1 k1=100,200,300,400  p2=0,0,0,0  | sfricker1 frequency=60 |
     cut f1=350 n1=100 f2=9 n2=20 | cut f1=250 n1=100 f2=0 n2=10 | noise range=0.050 seed=2010     
     ''')

#Result('data','syn','wiggle yreverse=y transp=y poly=y title=data')

Flow('real',None,
     '''
     sfspike n1=500 d1=0.001  o1=0 n2=1  o2=0 nsp=4 mag=1,1,1,1 k1=100,200,300,400  | sfricker1 frequency=60 
     
     
     ''')





Plot('real','real',
    '''
    put o1=0 d1=0.01 | wiggle yreverse=y transp=y poly=y 
    label1=Depth unit1=km label2=Amplitude unit2="" labelsz=10 title="c)" screenratio=0.8
    ''')


Plot('syn','syn',
     '''
     put o2=0 d2=2 o1=0 d1=0.01 | 
     wiggle yreverse=y transp=y poly=y label1=Depth unit1=km 
     label2=Angle unit2="\^o\_" labelsz=10 title="a)" screenratio=0.8
     ''')

Flow('stack','syn','stack')

Plot('stack','stack',
     '''
     put o1=0 d1=0.01 |
     wiggle yreverse=y transp=y poly=y label1=Depth unit1=km 
     label2=Amplitude unit2="" labelsz=10 title="d)" screenratio=0.8
     ''')

Flow('stacks','stack','spray axis=2 n=50')


Flow('weights', 'syn stacks',
     '''similarity other=${SOURCES[1]} niter=30 rect1=10 rect2=2
     ''')

Flow('tweights','weights','threshold pclip=70')

Plot('weights','tweights',
     '''
     put o2=0 d2=2 o1=0 d1=0.01 | 
     grey color=j scalebar=y label1=Depth unit1=km  title="b)"
     label2=Angle unit2="\^o\_" labelsz=10 wheretitle=top wherexlabel=bottom screenratio=0.8
     ''')

Flow('scale','tweights','stack | spray axis=2 n=30')

Flow('simistack','tweights syn scale',
     '''
     sfmath y=${SOURCES[1]} z=${SOURCES[2]} output="input*y/(z+0.05)" | stack  
     ''')

Plot('simistack','simistack',
     '''
     put o1=0 d1=0.01 |
     wiggle yreverse=y transp=y poly=y label1=Depth unit1=km 
     label2=Amplitude unit2="" labelsz=10 title="e)" screenratio=0.8
     ''')

Result('compare1','syn weights real stack simistack ', 'SideBySideAniso',vppen='txscale=2.4')






End()

sfspike
sfricker1
sfcut
sfnoise
sfput
sfwiggle
sfstack
sfspray
sfsimilarity
sfthreshold
sfgrey
sfmath