Next: Problem Up: Maurice: Tutorial Previous: The RSF file format

# Exercise: convert command-line arguments into SConstruct

This command-line example is borrowed from Paul Sava. Let us do it step by step:
• Create 2D Gaussian function
```  sfmath output="exp(-(x1*x1+x2*x2)/(2*1.5*1.5))" n1=200 d1=0.1 \
o1=-10.  n2=200 d2=0.1 o2=-10. | sfput label1=z \
unit1=km label2=x unit2=km > gg.rsf
```

• Plot the 2D Gaussian function
```  < gg.rsf sfgrey pclip=100 screenratio=1 scalebar=y | xtpen
```

• Extract 1D subset from the 2D Gaussian function
```  < gg.rsf sfwindow n2=1 f2=100 | sfgraph | xtpen
```

• Create a velocity model including a Gaussian anomaly
```  < gg.rsf sfscale rscale=-1. | sfadd add=3 > vel.rsf
< vel.rsf sfgrey title="" pclip=100 screenratio=1 \
bias=3 scalebar=y| xtpen
```

• Compute traveltimes with an eikonal solver
```  < vel.rsf sfeikonal zshot=-10 yshot=0 > fme.rsf
< fme.rsf sfcontour title="" nc=200 screenratio=1 |xtpen
```

• Compute rays and wavefronts
```  < vel.rsf sfhwt2d xsou=0 zsou=-10 nt=1000 ot=0 dt=0.01 ng=1801 \
og=-90  dg=0.1 > hwt.rsf

< hwt.rsf sfwindow j1=20 j2=20 | sfgraph title="" yreverse=y \
screenratio=1   min1=-10 max1=+10 min2=-10 max2=+10 | xtpen
```
After running the previous command-lines, the Gaussian function is as shown in Figure 2. The velocity is Figure 3. With the eikonal solver, you will obtain the compuated traveltimes in Figure 4.The rays and the wavefronts can be overlaid in Figure 5.

gg
Figure 2.
2D Gaussian function

vel
Figure 3.
The resulting velocity model

fme
Figure 4.
Computed traveltimes

combined
Figure 5.
Rays and wavefronts can be overlaid.

Your assignment is to convert the command-line arguments into a SCons script, which can be used for reproducible research. The solution can be viewed in adapt/SConstruct.