next up previous [pdf]

Next: Further exercises Up: Forward modeling Previous: Write your own code

A 2-D Modeling experiment using SConstruct

  1. Invoke RSF module to create a experiment environment. \begin{lstlisting}
from rsf.proj import *End()
\end{lstlisting} Almost every SConstruct for numerical test has to start with from rsf.proj import * and ends with End().

  2. In between, add several lines to create a very simple velocity model including 3 layers using Flow(target,source,command). The command here is sfmath. One may type the command name 'sfmath' to look up the manual in the terminal.
  3. Performing 2-D forward simulation with 1 point source (a Ricker wavelet) by specifying the parameters for the command sfmodeling2d. Again, one may type the command name to look up the manual in the terminal if you cannot keep everything in mind.

  4. Polish your resulting figures. Help yourself by self-documentation of the command, type the command name sfgrey or man sfgrey [*] in the terminal. For example, try color style: color=g bartype=h
The final SConstruct looks like
from rsf.proj import *

Flow('vel0',None,
     	'''
     	math output=1.6 n1=50 n2=200 d1=0.005 d2=0.005
     	label1=x1 unit1=km label2=x2 unit2=km 
     	''')

Flow('vel1',None,
     	'''
     	math output=1.8 n1=50 n2=200 d1=0.005 d2=0.005
     	label1=x1 unit1=km label2=x2 unit2=km 
     	''')
Flow('vel2',None,
     	'''
     	math output=2.0 n1=100 n2=200 d1=0.005 d2=0.005
     	label1=x1 unit1=km label2=x2 unit2=km 
     	''')
Flow('vel',['vel0','vel1','vel2'], 'cat axis=1 ${SOURCES[1:3]}')

Result('vel',
       '''
       grey title="velocity model: 3 layers" 
       color=j scalebar=y bartype=v
       ''')

Flow('shots','vel',
	'''
	modeling2d nt=1100 dt=0.001 ns=10 ng=200	
	sxbeg=5 szbeg=2 jsx=20 jsz=0 
	gxbeg=0 gzbeg=3 jgx=1 jgz=0 	
	''')

Result('shots',
	'''
       byte allpos=n gainpanel=all |
       grey3 flat=n frame1=300 frame2=100 frame3=5 
       label1=Time unit1=s
       label2="Receiver no." label3="Shot no."
       title="Shot records" point1=0.8 point2=0.8
	''')

Plot('shots','grey title=Shots',view=1)

#use sfwindow to select 5-th shot and display it using sfgrey


End()

We obtain the velocity model in Figure 1 and the shot gathers in Figure 2. To have a look at the movie by looping over each shot gather, run scons.

vel
vel
Figure 1.
A 3-layer velocity model
[pdf] [png] [scons]

shots
shots
Figure 2.
Shot gather
[pdf] [png] [scons]


next up previous [pdf]

Next: Further exercises Up: Forward modeling Previous: Write your own code

2021-08-31