Plotting with SU

If you have installed Seismic Unix (SU), you might wish to use the example scripts xPlot-su and psPlot-su. The former can be used to generate a handy interactive X11 x-window plot. The latter creates a Postscript file, analogous to the BSU script psplot. The psPlot-su script is as follows:

{listpsPlot-su}
 #!/bin/sh
# Script to call Seismic Unix Plotting
# fill=2 for grey fill of troughs
# Trace equalization with sugain if pbal=1
# d1num controls time lines, f2 controls vertical axis label
# Author: P. Michaels
set -x
if test "$1" = ”
then
echo 'Enter input file name'
read FILEN
else
FILEN=$1
fi
if test "$2" = ”
then
echo 'Enter tmax'
read TMAX
else
TMAX=$2
fi
if test "$3" = ”
then
echo 'Enter Title'
read TITLET
else
TITLET=$3
fi
segyclean <$FILEN |     \
suwind tmax=$TMAX       |       \
sugain pbal=1           |
supswigp xcur=1. style=normal   \
clip=1                          \
fill=2                          \
linewidth=0                     \
        xbox=1.0  wbox=4.0      \
        perc=98.                \
        ybox=6.5  hbox=3.65     \
        nbpi=300 grid1=solid grid2=solid        \
        titlesize=10 labelsize=10  \
        title="$TITLET $FILEN"  \
        label1=" Time (s)"      \
        d1num=.05               \
        f2=-19.60 d2=.25 label1=" Time (s)" label2="Elevation (m)"      \
         >$FILEN.ps
gv $FILEN.ps
listpsPlot-su



The above script assumes you have ghost view “gv” installed at the end. If you don't, just comment out or delete that line and use your favorite tool to view the Postscript file generated. The script uses the SU program segyclean to remove BSEGY header info that conflicts with SU formatted data. The SU program, suwind windows the date for the time limits to be plotted. Then SU program, sugain, is analogous to BSU program bequ and trace equalizes the data. Finally, the SU program, supswigp does the actual plot generation. The line starting with “f2” is customized for the data set inquestion and sets the depth axis labels. Use BSU program, bdump to determine the deepest geophone depth (here that is $-19.6$ meters). The geophone increment is $0.25$ meters. Figure 5 is the result of the following command:


psPlot-su twav.seg .2 pbal=1



The command line arguments are the data file name, maximum time to plot, and an arbitrary text string to label the plot. Here, that string is “pbal=1”.

If you don't have SU, I recommend it highly, as it is well supported, but must be compiled from an unpacked TAR archive. To obtain SU, point your web browser to http://www.cwp.mines.edu/cwpcodes/index.html. Running SU is beyond the scope of this document. The CWP project has excellent documentation which also can be downloaded from their web site. The purpose here is to demonstrate the ease of processing between the two environments. This ease results from the similarity of the data formats unless ...

MAJOR CAUTION: Beginning around 1997, seismic unix can be compiled two different ways. They have a new external data floating point format, XDR. Seismic Unix provides a program that converts old format SU data to new XDR format. That command is suoldtonew <oldsu >newsu. It does not appear that a inverse program has been distributed. Because BSU does not use XDR format, you will not be able to enjoy the ease of mixing BSU with SU processes, should you compile SU with the XDR format chosen in the Makefile.in file. However, I have a work-around.

Work-A-Round: With this most recent release of BSU, you can now use the byte swap program, bswp, to toggle between the original SU data format and the XDR version. You could also generate a SEGY data set from a SU XDR data set (using SU program segywrite). Then use the BSU program, bcnv, to read it in to the BSU environment. But byte swapping is faster since both the traditional SU, BSU, and SUXDR are all IEEE encodings of floats. Only SEGY uses IBM big endian floats. What I do is ignore SU recommendations, and compile SU without XDR support. On personal computers running linux, this seems to be the easiest thing. There may be situations where different platforms are NFS sharing a data set that makes XDR desirable. That is not, however, a typical situation for most users.

Figure 5: Using Seismic Unix (SU) to plot BSEGY data, script psPlot-su used.
\includegraphics[scale=.8]{FigureE}