up [pdf]
from rsf.proj import *

# create a model
amp=1
rad=1
Flow('model',None,
     '''
     math n1=301 d1=0.01 o1=0 n2=1001 d2=0.01 o2=0 output="1+2*x1+0.5*x2" |
     math output="input+%g*exp(-((x1-1.5)*(x1-1.5)+(x2-5)*(x2-5))/(%g*%g))" |
     put label1=Depth unit1=km label2=Position unit2=km
     ''' % (amp,rad,rad))

# plot the model
Plot('model','model','grey color=j scalebar=y label1=Depth unit1=km label2=Position unit2=km barlabel=Velocity barunit=km/s barreverse=y title=Model allpos=y')

# do a ray-tracing
Flow('ray','model','rays2 yshot=5 nt=500 dt=0.001 a0=180 nr=1')

# plot the ray
Plot('ray','graph transp=y yreverse=y min1=0 max1=3 min2=0 max2=10 wantaxis=n wanttitle=n scalebar=y plotcol=7 plotfat=3')

# overlay model and ray
Result('overlay','model ray','Overlay')

End()

sfmath
sfput
sfgrey
sfrays2
sfgraph