from rsf.proj import *
par = dict(
nx=200, ox=-10, dx=0.1, lx='x', ux='km',
nz=200, oz=-10, dz=0.1, lz='z', uz='km',
nt=1000, ot=0, dt=0.01,
ng=1801, og=-90, dg=0.1,
sig=1.5,
xsou=0, zsou=-10,
labelattr="titlefat=3 labelsz=5 labelfat=3"
)
par['xmin']=par['ox']
par['xmax']=par['ox'] + (par['nx']-1)*par['dx']
par['zmin']=par['oz']
par['zmax']=par['oz'] + (par['nz']-1)*par['dz']
par['ratio']=(par['nz']-1)*par['dz']/(par['nx']-1)/par['dx']
def hwtplot(custom,par):
return '''
graph
title="" screenratio=%(ratio)g
plotcol=0 plotfat=3 wantaxis=n yreverse=y
min1=%(zmin)g max1=%(zmax)g
min2=%(xmin)g max2=%(xmax)g
%(labelattr)s
'''%par + custom
def fmeplot(custom,par):
return '''
contour
title="" screenratio=%(ratio)g
nc=100 plotcol=6 plotfat=3
labelrot=n wantaxis=n wanttitle=n
%(labelattr)s
'''%par + custom
Flow('gg',None,
'''
math output="exp(-(x1^2+x2^2)/(2*%(sig)g^2))"
n1=%(nz)d d1=%(dz)g o1=%(oz)g
n2=%(nx)d d2=%(dx)g o2=%(ox)g |
put label1=%(lz)s unit1=%(uz)s
label2=%(lx)s unit2=%(ux)s
'''%par)
Result('gg',
'''
grey title="2D Gaussian"
pclip=100 screenratio=%(ratio)g
%(labelattr)s
'''%par)
Result('gg0','gg',
'''
window n1=1 min1=0 |
graph title="1D Gaussian"
plotfat=10 screenratio=0.5 screenht=7
%(labelattr)s
'''%par)
Flow('vel','gg',
'math output="3.0-input"')
Plot('vel',
'''
grey title="" pclip=100 color=g
screenratio=%(ratio)g mean=y %(labelattr)s
'''%par)
Result('vel','grey title="" pclip=100 screenratio=%(ratio)g mean=y %(labelattr)s'%par)
Flow( 'fme','vel',
'eikonal zshot=%(zsou)g yshot=%(xsou)g'%par)
Plot( 'fme',fmeplot('plotcol=1',par))
Result('fme',['vel','fme'],'Overlay')
Flow('hwt','vel',
'''
hwt2d xsou=%(xsou)g zsou=%(zsou)g
nt=1000 ot=0 dt=0.01
ng=1801 og=-90 dg=0.1
'''%par)
Plot('ray','hwt',
'transp | window f1=25 j1=25 j2=20 |'
+ hwtplot('plotcol=5',par))
Plot('wft','hwt',
'window f2=50 j2=25 j1=20 |'
+ hwtplot('plotcol=6',par))
Result('hwt',['vel','wft','ray'],'Overlay')
End() |