up [pdf]
from rsf.proj import *

#==============================================================
# job running parameters
par = dict(
    ns=1200,
    dt=0.001,
        dx=12.5/1000,
    dz=12.5/1000,

    seed=2015,
    npk=200,
    eps=1.0e-6,
    )
# =============================================================
# download Hess VTI models from 'ftp://software.seg.org'
# Depth grid: 1501 
# Horizontal grid: 3617
# Vertical and horizontal spacing are both 20ft.

import bptti2007

bptti2007.get_model('Vp Vs Epsilon Delta Theta')

# =============================================================
# produce vp0 & vs0 model by scaling vp model 
Flow('vp0','Vp',
     '''
         math output="input" | resamp d1=%g d2=%g
     '''
         % (par['dx'],par['dz'])
         )
#        smooth rect1=10 rect2=10 | resamp d1=%g d2=%g

Flow('vs0','Vs',
     '''
         math output="input" | resamp d1=%g d2=%g
     '''
         % (par['dx'],par['dz'])
         )

Flow('epsi','Epsilon',
     '''
         math output="input" | resamp d1=%g d2=%g
     '''
         % (par['dx'],par['dz'])
         )

Flow('del','Delta',
     '''
         math output="input" | resamp d1=%g d2=%g
     '''
         % (par['dx'],par['dz'])
         )

#Flow('the','Theta',
#     '''
#        math output=0.0  | resamp d1=%g d2=%g
#     '''
#        % (par['dx'],par['dz'])
#        )

Flow('the','Theta',
     '''
     smooth rect1=60 rect2=60 | resamp d1=%g d2=%g
     '''
         % (par['dx'],par['dz'])
 )

name0='''
vp0 vs0
'''

name00='''
epsi del the
'''

for ff in Split(name0):
        Result(ff,
        '''
        grey color=j scalebar=y bias=1.5 allpos=n barreverse=y wanttitle=n}
        ''')

for gg in Split(name00):
        Result(gg,
        '''
        grey color=j scalebar=y allpos=n barreverse=y wanttitle=n}
        ''')
########################################################################################################
name3='''
ElasticxKS ElasticzKS ElasticPxKS ElasticPzKS ElasticSxKS ElasticSzKS
'''

Flow(['ElasticxKS',  'ElasticzKS',  'ElasticPxKS',  'ElasticPzKS', 'ElasticSxKS',  'ElasticSzKS'],
      'vp0 vs0 epsi del the',
         '''
         tti2devectorlrsvdkspace_double_stiffness
         vp0=${SOURCES[0]}
         vs0=${SOURCES[1]}
         epsi=${SOURCES[2]}
         del=${SOURCES[3]}
         the=${SOURCES[4]}
         Elasticz=${TARGETS[1]}
         ElasticPx=${TARGETS[2]}
         ElasticPz=${TARGETS[3]}
         ElasticSx=${TARGETS[4]}
         ElasticSz=${TARGETS[5]}
         ns=%d
         dt=%g
         eps=%g
         seed=%d
         npk=%d
         ''' % (par['ns'],par['dt'],par['eps'],par['seed'],par['npk'])
    )

for qq in Split(name3):
        Result(qq,
        '''
        grey color=j polarity=n scalebar=n screenratio=1. wanttitle=n pclip=99.7
        axisfat=5 axiscol=7 labelsz=10
        ''')

End()

sfsegyread
sfput
sfmath
sfgrey
sfwindow
sfresamp
sfsmooth
sftti2devectorlrsvdkspace_double_stiffness