The CWP/SU (Seismic Unix) package is an seismic processing and research environment developed at the Center for Wave Phenomena (CWP) at the Colorado School of Mines. The package is distributed freely, with full source code. SeismicUnix (SU) should be installed on a Unix-compatible operating system (e.g. Linux). However, installation on Microsoft Windows is possible if you have previously installed Cygwin/X, also freely available on internet. Cygwin/X consists of two parts. The first part, Cygwin, is a port of the GNU tools to Win32 and provides a UNIX-like environment in Windows without graphical interface. The second, Cygwin/X, is a port of the X Window System to Win32 and allows the display of Cygwin programs in standard Windows windows (Hunt, 2000). The two first sections of this chapter present the installation of Cygwin/X and SeismicUnix. The third section provides information and tips on how to use SU. The last section lists useful internet links.
Cygwin/X Installation
Packages installation
Go to http://x.cygwin.com and start the cygwin/X setup by clicking on "Install Cygwin/X now". Go through the first install steps keeping the default options. When asked for a download site, choose one located near your location (e.g. mirror.switch.ch in Switzerland). At the Select Packages screen, you have to select the Unix components to install. Leave the default selection and add the components listed in table 1. To select an entire category, click on Skip or Default until Install appears. For packages, click on skip until the version number appears. Since Cygwin setup program automatically selects dependencies, do not unselect any dependent packages.
Devel
Doc
cygwin-x-doc man
Shells
bash
Text Utils
X11
All packages
xfree86-prog
When you have selected the appropriate packages, click next to continue the installation. If download fails, you can try again with a different server without having to reselect the components. When Install is complete, press Finish. Put a shortcut to C:\cygwin\usr\X11R6\bin\startxwin.bat on the desktop. You will click on this shortcut every time you want to start Cygwin/X.
3. Create a new variable called DISPLAY and give it the value 127.0.0.1:0.0
Windows 95/98
In Windows 95/98, it is necessary to manually edit the file AUTOEXEC.BAT in a text editor to add or change the value of an environment variable. To add the DISPLAY variable, add the following line:
set DISPLAY=127.0.0.1:0.0
To update the PATH variable, you have to add the following string the end of the PATH line:
;C:\cygwin\bin;C:\cygwin\usr\X11R6\lib
2. Edit the file C:\cygwin\usr\X11R6\bin\startxwin.bat and add the following line at the end of the file :
xmodmap /etc/X11/Xmodmap.ch_fr
3. Double-click the Cygwin icon on the desktop to open a cygwin terminal. Enter the following command:
cp /etc/X11/Xmodmap.ch_fr ~/.Xmodmap
Download
Go to http://www.cwp.mines.edu/cwpcodes/ and download the latest version of Seismic Unix. It is distributed as a compressed file called cwp.su.all.XX.tar.gz where XX corresponds to the version number. Create the folder C:\cygwin\cwp and download the file into this emplacement.
Decompression
When the download is finished, right-click on the C:\cygwin\cwp folder and choose Cygwin here in the context menu to run a Cygwin terminal. In this terminal, type the two following commands to decompress the file (replace XX by the version number):
zcat cwp.su.all.XX.tgz | tar -xvf
Environment variables
To add environment variables, open the file the following lines:
CWPROOT="/cwp" export CWPROOT
C:\cygwin\etc\profile
On Windows NT/2000/XP, right click My Computer and select Properties > Advanced > Environment Variables. In the System variable part, click New... to create a new variable. Name the new variable CWPROOT and give it the following value: C:\cygwin\cwp (without quotes). If you are on Windows 95/98, you have to edit AUTOEXEC.BAT in a text editor to add the line below (and then reboot):
set CWPROOT= C:\cygwin\cwp
Compilation
In order to run Seismic Unix, you must compile the source code. Edit the file C:\cygwin\cwp\src\Makefile.config in a text editor. Makefile.config permits to set the options for the installation on your PC. Read carefully the comments and modify the file to correspond to a PC Cygwin installation. If you need help, look at my makefile or the makefile of Lee (2004), but they may be outdated for your current version of SU. Once you have done the necessary changes to the makefile, you can compile the source codes. Open a Cygwin terminal and change the current location via:
cd /cwp/src
(to install the basic set of codes, answer y to any question) (to install the X-toolkit codes, see note below) (to install the Fortran codes) (to install Mesa/Open GL codes, optional) (to install X-Motif codes , optional) (to install SFIO materials and SEGDREAD)
note: if you get a Nothing to be done for `xtinstall message when trying to compile the xtinstall package, you can compile xtinstall via the following command lines:
cd $CWPROOT/src/ cd ./Xtcwp; make; cd .. cd ./xplot; make; cd ..
If problems occur during compilation, you can recompile the codes via:
make remake make xtremake make fremake make mglremake make xmremake make sfremake
To test the installation, start Cygwin/X by double-clicking enter: suplane | suxwigb & A synthetic profile should appear (Fig. 1).
startxwin.bat.
In the terminal,
Fig. 1. Screenshot of a Cygwin terminal and a SU synthetic profile on the Windows desktop
This section presents to the new user basic informations about SU in association to Cygwin/X, particularly the way of displaying SU profiles. For more complete documentation on SU, you can download a clear and detailed SU manual (Stockwell and Cohen, 2002) from the CWP/SU website. To get information about a specific SU module (e.g. sufilter for frequency filtering), just enter the module name at the command prompt. To get a description of a header field, type sukeyword followed by the header field name (e.g. sukeyword dt). When you enter commands within a Cygwin window, be careful of the case (lowercase or uppercase) because Cygwin is case-sensitive. Note also that paths in Cygwin are expressed with a slash (/) and not a backslash (\) and that the root of the Cygwin file system corresponds to C:/cygwin/. If you want to access locations outside this root folder, you have to use the word cygdrive, which corresponds to My Computer under Windows. Table 2 presents examples of equivalences between Windows and Cygwin paths.
Windows path
C:\Cygwin D:\seismic\Data C:\Cygwin\Home\user
Cygwin path
/ /cygdrive/d/seismic/Data
~
Table 2
lists the current directory content. changes directory. Example: cd clears the terminal screen. closes the terminal. at the end of a command, runs the command in the background in order to use the same terminal to enter another command. is the piping symbol and allows you to redirect the output of a first operation as an input for the following one. The symbol also works. Example:
suplane | suxwigb & /cygdrive/d/seismic/Data
cat sh toto.sh
executes the shell script toto.sh. A shell script is a text file containing a sequence of commands, useful for writing a seismic processing flow. Equivalent to a batch script in MS-DOS.
Special keys
up/down arrows browse through the past command lines you entered to avoid retyping them. Right-click copy the highlighted text or paste the clipboard content. To enable copy/paste in Windows XP, you have to turn on the 'quick edit' mode for the command shell: Right-click on the window title bar, choose Properties, select Quick Edit, click OK, right-click again on the tiltle bar and choose default. completes the filename. Example: to open the file a01_neuchatel, just type a01 and press tab, the filename will complete automatically if there is no other file in that folder starting with the same characters. when reading online help, goes to the following screen. quits the online help.
tab
space q
To avoid typing the entire filename, you can enter the first letters and press the Tab key to auto-complete it. The perc parameter is optional and its default value is 100. By lowering this value, you increase the contrast of the profile. To zoom-in, draw a rectangle with the mouse while pressing the left button. To zoom-out, left-click once on the profile. When viewing seismic lines with suximage, you can browse through RGB colorscales pressing r (next one) or R (previous one). If you want to label the traces according to a particular header word, use suxwigb and the key parameter. The following example labels the traces according to the field record number (header word fldr):
suxwigb < input.su perc=97 key=fldr &
The suximage aud suxwigb commands can be combined to other commands by piping ( | )to suit your needs. Examples: Display the first 500 traces:
suwind min=0 count=1000 < input.su | suximage perc=97
Display a pre-stack SU file and sort the traces by channel to track the bad channels :
susort < input.su tracf fldr | suximage perc=97
Combining the two previous command lines, you can display the 500 first traces, sorted by channel :
suwind min=0 count=1000 < input.su | susort tracf fldr | suximage perc=97
Useful Links
Cygwin/X http://x.cygwin.com Bash shortcuts to enter command lines more easily http://hajek.stat.ubc.ca/~harry/local/bash.html SeismicUnix http://www.cwp.mines.edu/cwpcodes/ Tips for SeismicUnix installation under Cygwin http://www.geocities.jp/kyotoalien/seismicunix.html Add Cygwin to Windows context menu http://www.mindview.net/Etc/Cygwin/BashHere Using Seismic Unix to Teach Seismic Processing http://www.geo.mtu.edu/spot/Teaching_Seismic/TBenz_Seismic.htm