up [pdf]
from rsf.proj import *

# typical basic preprocessing is:
#   gain - appoy spreading correction
# surface consistant scaling
#   predecon mute
#   decon (surface consistant)
#   spectral whitening (zero phase)
#   relative static
#   nmo
#   mean static
#   residual static (surface consistant)
#   stack with mute

#Flow('npr3_field_hdr.rsf','../Fetchpaper/npr3_field_hdr.rsf','sfcp')
#Flow('npr3_field.rsf','../Fetchpaper/npr3_field.rsf','sfwindow n1=2047')

Flow(['shotdecon.rsf','shotdecon_hdr.rsf'],
     ['../Fetchpaper/npr3_field.rsf','../Fetchpaper/npr3_field_hdr.rsf'],
     '''
     sftahsort verbose=1 input=${SOURCES[0]} 
       sort='sx sy'
     | sftahwindow tmax=4.092
     | sftahgain 
       tpow=2
     | sftahmute
       tmute=-.050,-.050,.275,2.0 
       xmute=0,880,1760,18000 
       ntaper=80 
     | sftahagc
       wagc=1.000 verbose=1
     | sftahscdecon
       key="sx,sy"
       minlag=.002 maxlag=.140  pnoise=.1 mincorr=0 maxcorr=3 
       verbose=1
     | sftahwrite    
        verbose=1
        mode=seq                        
        output=${TARGETS[0]}
     ''',stdout=0,stdin=0)

Flow(['s-g-decon.rsf','s-g-decon_hdr.rsf'],
     ['shotdecon.rsf','shotdecon_hdr.rsf'],
     '''
     sftahsort verbose=1 input=${SOURCES[0]} 
       sort='gx gy'
     | sftahscdecon
       key="gx,gy"
       minlag=.002 maxlag=.140  pnoise=.1 mincorr=0 maxcorr=3 
       verbose=1
     | sftahwrite 
        verbose=1    
        mode=seq                        
        output=${TARGETS[0]}
     ''',stdout=0,stdin=0)

Flow(['scdeconstack141.rsf','scdeconstack141_hdr.rsf'],
     ['s-g-decon.rsf','s-g-decon_hdr.rsf'],
     '''
     sftahsort verbose=1 input=${SOURCES[0]} sort='iline:141,141 xline offset'
     | sftahagc 
       wagc=1.000 verbose=1 
     | sftahstatic sign=-1   
     | sftahnmo 
       verbose=1
       tnmo=0,.617,.769,.913,1.027,1.196,1.767,3.010.00
       vnmo=9132.86,10764.47,10941.73,11235.75,11902.71,12580.03,14513.85,16982.86
     | sftahstack key=iline,xline verbose=1 ntaper=40
       tmute=0,1.20,1.82 
       xmute=0,7358,18000 
       ntaper=80 
     | sftahwrite 
        verbose=1                           
        label2="xline" o2=1 n2=188 d2=1   

        label3="iline" o3=141 n3=1 d3=1   
        output=${TARGETS[0]}
        outheaders=${TARGETS[1]} 
     ''',stdout=0,stdin=0)

Result('scdeconstack141',
       '''
       window n1=1000 
       | sfgrey title='scdecon il 141 with tpow, agc, pef, static' 
         clip=.94 polarity=y
       ''')

Flow(['scdeconcdps.rsf','scdeconcdps_hdr.rsf'],
     ['s-g-decon.rsf','s-g-decon_hdr.rsf'],
     '''
     sftahsort verbose=1 input=${SOURCES[0]} sort='iline:141,141 xline:10,180,10 offset'
     | sftahagc 
       wagc=1.000 verbose=1 
     | sftahstatic sign=-1   
     | sftahnmo 
       verbose=1
       tnmo=0,.617,.769,.913,1.027,1.196,1.767,3.010.00
       vnmo=9132.86,10764.47,10941.73,11235.75,11902.71,12580.03,14513.85,16982.86
     | sftahmute 
       tmute=0,1.20,1.82 
       xmute=0,7358,18000 
       ntaper=80 
     | sftahwrite 
        verbose=1                           
        mode=seq 
        output=${TARGETS[0]}
        outheaders=${TARGETS[1]} 
     ''',stdout=0,stdin=0)

Result('scdeconcdps',
       '''
       window n1=1000 
       | sfgrey title='scdecon il 141 cdps'
         clip=.94 polarity=y
       ''')

End()

sftahsort
sftahwindow
sftahgain
sftahmute
sftahagc
sftahscdecon
sftahwrite
sftahstatic
sftahnmo
sftahstack
sfwindow
sfgrey
sfclip2
sfbyte
sfgrey3
sfdd
sftransp
sflinear
sfgraph
sfdix
sfbandpass
sfspray
sftime2depth
sfput
sfmath
sffft1
sfreal
sfzomig3
sfdepth2time
sfsegyread

http://s3.amazonaws.com/teapot/filt_mig.sgy