up [pdf]
from rsf.proj import *
import sys
sys.path.append('..')
import fdmod,wemva

# ------------------------------------------------------------
par = {
    'nz':550, 'oz':5.000, 'dz':0.050, 'uz':'km',
    'nx':500, 'ox':10.925,'dx':0.150, 'ux':'km',
    'nt':2000,'ot':0,     'dt':0.004, 'ut':'s',
    'nw':140,'ow':1,'jw':1,
#
    'vel':10,
    'frq':6,
    'tmin':3.0,
    'tmax':8.0
    }

par['ft2km']=0.3048

par['ox']=par['ox']*par['ft2km']
par['dx']=par['dx']*par['ft2km']
par['oz']=par['oz']*par['ft2km']
par['dz']=par['dz']*par['ft2km']

par['vel']=par['vel']*par['ft2km']

par['pscale']=0.75
par['pshift']=-4.25

#par['nspk']=9
#par['ospk']=-4
#par['jspk']=30

par['nspk']=1
par['ospk']=2
par['jspk']=30

par['k1']=50
par['l1']=par['nx']-par['k1']

wemva.param(par)
fdmod.param(par)

# ------------------------------------------------------------
# VELOCITY
#velo = 'sigsbee2a_migvel.sgy'
velo = 'sigsbee2a_stratigraphy.sgy'
Fetch(velo,'sigsbee')
Flow('zvelo tzvelo ./vhead ./bvhead',velo,
     '''
     segyread
     tape=$SOURCE
     tfile=${TARGETS[1]}
     hfile=${TARGETS[2]}
     bfile=${TARGETS[3]}
     ''',stdin=0)
Flow('vpad','zvelo','window n1=1 f1=1200 | spray axis=1 n=50')

Flow('vel','zvelo vpad',
     '''
     put d1=0.0076200 o2=3.0556200 d2=0.0076200 label1=z label2=x |
     window n1=500 min1=%(oz)g j1=2 |
     cat axis=1 ${SOURCES[1]} |
     scale rscale=0.001 |
     scale rscale=%(ft2km)g 
     ''' % par)
Plot('vel',fdmod.cgrey('allpos=y bias=1.5',par))

# REFLECTIVITY
Flow('ref',None,
     '''
     spike nsp=1 mag=1 
     n1=%(nx)d d1=%(dx)g o1=%(ox)g k1=%(k1)g l1=%(l1)g
     n2=%(nz)d d2=%(dz)g o2=%(oz)g k2=490 |
     smooth rect1=25 repeat=3 |
     spray axis=2 n=1 o=0 d=1 |
     put label1=x label2=y label3=z 
     ''' % par )
Plot('ref','window | transp | smooth rect1=3 |'
       + fdmod.cgrey('pclip=100',par))
# ------------------------------------------------------------
Flow('vvv','ref','window | transp | math output=%(vel)g' % par)
Flow('img',['ref','vvv'],
     '''
     window | transp |
     depth2time velocity=${SOURCES[1]} dt=%(dt)g nt=%(nt)d |
     ricker1 frequency=%(frq)g |
     time2depth velocity=${SOURCES[1]} dz=%(dz)g nz=%(nz)d |
     transp |
     spray axis=2 n=1 o=0 d=1 |
     put label1=%(lx)s label2='' label3=%(lz)s 
     ''' % par )
Plot('img','window | transp |' + fdmod.cgrey('pclip=99.9',par))

# ------------------------------------------------------------
Flow('jsk','ref',
     '''
     window |
     smooth rect2=15 repeat=2 |
     scale axis=123 |
     clip clip=0.1 |
     scale axis=123 |
     transp plane=23
     ''')
Flow('msk','jsk jsk','cmplx ${SOURCES[1]}')
Result('msk','real | window | transp |' + fdmod.cgrey('pclip=99.9',par))

# ------------------------------------------------------------
wemva.test(par)
# ------------------------------------------------------------


End()

sfsegyread
sfwindow
sfspray
sfput
sfcat
sfscale
sfgrey
sfspike
sfsmooth
sftransp
sfmath
sfdepth2time
sfricker1
sftime2depth
sfclip
sfcmplx
sfreal
sfdd
sfgraph
sffft1
sfpad
sfrtoc
sfzomig3
sfzomva
sfsrmod3
sfsrsyn
sfsrmig3
sfsrmva

data/sigsbee/sigsbee2a_stratigraphy.sgy