up [pdf]
from rsf.proj import *
def Grey(data,other):
        Result(data,'grey transp=y yreverse=y  label2=Trace unit2="" label1=Time label2=Trace unit1="s" title="" wherexlabel=b labelsz=10  wheretitle=t %s'%other)

#### sythetic data
Flow('spike1',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=46 | ricker1 freq=0.1')

Flow('spike2',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike3',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike4',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike5',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike6',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=54 | ricker1 freq=0.1')

Flow('spike7',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike8',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike9',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('spike10',None,'spike n1=100 nsp=1 mag=1 d1=0.004 o1=0 k1=50 | ricker1 freq=0.1')

Flow('syn','spike1 spike2 spike3 spike4 spike5 spike6 spike7 spike8 spike9 spike10',
     '''
     cat axis=2 ${SOURCES[1:10]} | 
     put o2=1 | noise seed=1 type=y mean=0 var=0.00011
     ''')


Result('syn','syn','wiggle  transp=y yreverse=y poly=y label2=Trace labelsz=10 title="NMO corrected gather" screenratio=0.8')

Result('syn1','syn stack','pad n2=12 | cat axis=2 ${SOURCES[1]} | wiggle  transp=y yreverse=y poly=y label2=Trace labelsz=10 title="NMO corrected gather" screenratio=0.8')
### initial stack

Flow('stack','syn','stack')
Plot('stack','stack','put o2=0 | wiggle  transp=y yreverse=y poly=y label2=Amplitude labelsz=12 title="c)" screenratio=0.8')

## SNR stack
Flow('snrstack','syn','snrstack  w=45 eps=5000')
Plot('snrstack','snrstack','wiggle  transp=y yreverse=y poly=y label2=Amplitude labelsz=12 title="e)" screenratio=0.8')

## 
Flow('stacks','stack','spray axis=2 n=10')
## similarity
Flow('weights', 'syn stacks',
     '''similarity other=${SOURCES[1]} niter=30 rect1=11 rect2=1
     ''')
Grey('weights','color=j scalebar=y title="Local similarity" wanttitle=y labelsz=10 screenratio=0.83')




End()

sfspike
sfricker1
sfcat
sfput
sfnoise
sfwiggle
sfpad
sfstack
sfsnrstack
sfspray
sfsimilarity
sfgrey