next up previous contents
Next: Extending SU by shell Up: Understanding and using SU Previous: Executing shell programs   Contents

A typical SU processing flow

Suppose you want to use sudmofk. You've read the self-doc, but a detailed example is always welcome isn't it? The place to look is the directory su/examples. In this case, we are lucky and find the shell program, Dmo. Again, the numbers in square brackets at the end of the lines shown below are not part of the listing.
#! /bin/sh
# dmo
set -x                                                            [1]

# set parameters
input=cdp201to800                                                 [2]
vnmo=1500,1550,1700,2000,2300,2600,3000                           [3]

# sort to common-offset, nmo, dmo, inverse-nmo, sort back to cmp
susort <$input offset cdp |                                       [4]
sunmo smute=$smute vnmo=$vnmo tnmo=$tnmo |                        [5]
sudmofk cdpmin=201 cdpmax=800 dxcdp=13.335 noffmix=4 verbose=1 |  [6]
sunmo invert=1 smute=$smute vnmo=$vnmo tnmo=$tnmo >$temp          [7]
susort <$temp cdp offset >$output                                 [8]
Discussion of numbered lines:

The core of the shell program (lines 5-7) is recognized as the typical dmo process: crude nmo, dmo, and then ``inverse'' nmo. The dmo processing is surrounded by sorting operations (lines 4 and 8). Here is a detailed discussion of the shell program keyed to the numbers appended to the listing (see also the discussion above for the Plot shell):

  1. Set a debugging mode that asks UNIX to echo the lines that are executed. You can comment this line off when its output is no longer of interest. An alternate debugging flag is set -v which echos lines as they are read by the shell interpreter. You can use both modes at once if you like.

  2. This line and the next two lines set filenames that, in this case, are in the same directory as the shell program itself. Again, the reason for using parameters here is to make it easy to ``clone'' the shell for use with other data sets. Those of us who work with only a few data sets at any given time, find it convenient to devote a directory to a given data set and keep the shells used to process the data in that directory as documentation of the processing parameters used. (SU does not have a built-in ``history'' mechanism.)

  3. The dmo process requires a set of velocity-time picks for the subsidiary nmo processes. Because these picks must be consistent between the nmo and the inverse nmo, it is a good idea to make them parameters to avoid editing mistakes. Again, note the format of SU parameter vectors: comma-separated strings with no spaces. The nmo program (sunmo) will give an error message and abort if the vnmo and tnmo vectors have different lengths.

  4. Note that susort allows the use of secondary sort keys. Do not assume that a secondary field that is initially in the ``right'' order will remain in that order after the sort--if you care about the order of some secondary field, specify it (as this shell program does). In this line, we sort the data according to increasing offsets and then, within each offset, we sort according to increasing cdp number.

  5. The forward nmo step.

  6. The dmo step.

  7. The inverse nmo step.

  8. Sort back to cdp and have increasing offset within each cdp.

If you want to thoroughly understand this shell program, your next step is to study the self-docs of the programs involved:

% sunmo

SUNMO - NMO for an arbitrary velocity function of time and CDP

sunmo <stdin >stdout [optional parameters]

Optional Parameters:
vnmo=2000         NMO velocities corresponding to times in tnmo
tnmo=0            NMO times corresponding to velocities in vnmo

Related shell programs are su/examples/Nmostack and su/examples/Mig.

next up previous contents
Next: Extending SU by shell Up: Understanding and using SU Previous: Executing shell programs   Contents
John Stockwell 2007-04-10