up [pdf]
from rsf.proj import *

par = dict(
    ns=2201,
    dt=0.0005,
    dx=20*0.0003048,
    dz=20*0.0003048,

    seed=2011,
    eps=1.e-6,
    npk=30,

        ireconstruct=0,
    xrec1=0.0,
    zrec1=0.0,
    xrec2=0.0,
    zrec2=0.0,
    )

# =============================================================
# download Hess VTI models from 'ftp://software.seg.org'
# Depth grid: 1501 
# Horizontal grid: 3617
# Vertical and horizontal spacing are both 20ft.

import hessvti

hessvti.get_model('vp vs epsilon delta')

# =============================================================
# produce vp0 & vs0 model by scaling vp model 
Flow('vp0','vp',
     '''
     math output="input*1000" 
     ''')

Flow('vs0','vs',
     '''
     math output="input*1000"
     ''')

Flow('epsi','epsilon',
     '''
     math output=input
     ''')

Flow('del','delta',
     '''
     math output=input
     ''')

Flow('the','delta',
     '''
     math output=0.0
     ''')

name0='''
vp0
'''

name00='''
epsi del
'''

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

for gg in Split(name00):
        Result(gg,
        '''
        grey color=j scalebar=y allpos=n barreverse=y wanttitle=n screenht=4 screenwd=6
        ''')

# =================================================================================
# calculate separated wave-mode:         yes
# =================================================================================
name1='''
Elasticx Elasticz ElasticSepP ElasticSepSV
'''

Flow(['Elasticx',  'Elasticz',  'ElasticSepP', 'ElasticSepSV'],
         'vp0  vs0  epsi del the',
         '''
         tti2delrsep
         vp0=${SOURCES[0]}
         vs0=${SOURCES[1]}
         epsi=${SOURCES[2]} 
         del=${SOURCES[3]}
         the=${SOURCES[4]}
         Elasticz=${TARGETS[1]}
         ElasticSepP=${TARGETS[2]}
         ElasticSepSV=${TARGETS[3]}
         ns=%d 
         dt=%g
         eps=%g
         seed=%d
         npk=%d
         ''' % (par['ns'],par['dt'],par['eps'],par['seed'],par['npk'])
    )

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

# =================================================================================
# Vector decomposition
# =================================================================================
name4='''
ElasticX ElasticZ ElasticPx ElasticPz ElasticSVx ElasticSVz
'''

Flow(['ElasticX',  'ElasticZ',  'ElasticPx', 'ElasticPz', 'ElasticSVx', 'ElasticSVz'],
      'vp0  vs0  epsi del the',
         '''
         tti2delrdecomp2p
         vp0=${SOURCES[0]}
         vs0=${SOURCES[1]}
         epsi=${SOURCES[2]} 
         del=${SOURCES[3]}
         the=${SOURCES[4]}
         ElasticZ=${TARGETS[1]}
         ElasticPx=${TARGETS[2]}
         ElasticPz=${TARGETS[3]}
         ElasticSVx=${TARGETS[4]}
         ElasticSVz=${TARGETS[5]}
         ns=%d 
         dt=%g
         eps=%g
         seed=%d
         npk=%d
                 ireconstruct=%d
         xrec1=%g
         zrec1=%g
         xrec2=%g
         zrec2=%g
         ''' % (par['ns'],par['dt'],par['eps'],par['seed'],par['npk'],par['ireconstruct'],par['xrec1'],par['zrec1'],par['xrec2'],par['zrec2'])
    )

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

End()

sfsegyread
sfscale
sfput
sfmath
sfgrey
sfwindow
sftti2delrsep
sftti2delrdecomp2p

pub/datasets/2D/Hess_VTI/timodel_vp.segy.gz
pub/datasets/2D/Hess_VTI/timodel_delta.segy.gz
pub/datasets/2D/Hess_VTI/timodel_epsilon.segy.gz