MENCARI JATI DIRI ..
MENCARI ILMU DIMANA SAJA ..
KARNA NAMA BAIK LEBIH BERHARGA DARIPADA KEKAYAAN DUNIA ..

Monday, May 23, 2011

Learn to use SU

This homework is intended to get you familiar with creating a Unix shell program, storing it, and executing it. It will also get you familiar with several aspects of Seismic Unix itself. You will create some synthetic data and then migrate it, by simply following directions explicitly; then you will modify the model from which the data were created, and then you will modify the migration parameters. When you are done, you should feel pretty good about how straightforward this stuff is smile


You should have already looked at the SU User's Manual enough to have some familiarity with the programs, but also enough to be baffled by how it actually will work. Please read Chapter 1, Section 2.3, and skim Chapters 3 and 4 before attempting this homework.


1) Get Familiar with the directory system and the help files. Log into a Unix Machine. Open an x-term, and type seismicx . This will open another window, called SeismicX (the first time you do this, it will take a while, because you are creating a new area). Type pwd to see the directory in which you are now working; it should be in your home area, in a subdirectory called ge536. You can type ls to see a listing of the files or subdirectories in that directory, and you should see a subdirectory called demos. You can type cd demos to change directories to that subdirectory, and then type ls to see a listing within it. When you want to move back up one level of directory, you can type cd .. (yes, that is dot dot).

Type pwd to make sure you are in the ge536/demos subdirectory; use cd to move there if you aren't. At this point, let's impress your neighbors at the workstation by actually running a simple program. Type suplane | suxwigb & and you should get a nifty picture of some synthetic seismic data on your screen. (Act like you do this all the time, and your neighbors will in fact be very impressed.) You can get control back in your SeismicX window by hitting the return key, and you can delete the window with the seismograms by using the "KILL" command from the top left "button".

Repeatedly use cd to move throughout the ge536/demos subdirectory, making liberal use of ls and pwd to check where you are. You will want to look at a README file in the ge536/demos subdirectory that describes the use of the demo programs, and you can do this by typing more README when you are in that subdirectory. The text that appears on your screen can be advanced by hitting the spacebar to move to the next "page". You will probably want to print this file out, because it actually contains a lot of good hints. Type enscript README, and the file will magically appear at your default printer (usually geops). You may want to look at some of the demo subdirectories and files at this point, but they may prove a bit confusing .... don't worry about that (yet).


2) Enter a shell program, using a text editor. You will want to become good at creating what are called "shell" programs, and then running them. This is actually easy, and we will walk through an example right now. You will want to store all your shell scripts in a "bin" directory that has been created for you in your ge536 directory. cd to your ge536/bin subdirectory and get ready to type in a file. You can choose what text-editor you want to use, and you may already be familiar with vi or ed . If you aren't, I suggest using pico, because that is easy and gives you a list of commands at the bottom of the screen. To type in a file called "synmig" (because you will make some synthetic data and then migrate it), you would (using pico) type pico synmig . You should now be in the editor, and you should type in the following file (Note that all shell scripts should start and end with the lines that this one does):




#!/bin/sh

# shell synmig: make synthetic data and migrate it

n1=101

n2=101

#

# make synthetic data

susynlv nt=$n1 dt=0.04 ft=0.0 nxo=1 \

nxm=$n2 dxm=.05 fxm=0.0 er=0 ob=1 \

v00=1.0 dvdz=0 dvdx=0 smooth=1 \

ref="0,.5;1.0,.5;2.,.8;2.5,1.0;3.0,.8;4.0,.5;5.0,.5" |

sushw key=d2 a=.05 > junk.susyn

# show the synthetic data on the screen

suximage < junk.susyn label1="Time (sec)" label2="Distance (km)" \

title="Synthetic Data" &

# apply the Gazdag migration algorithm to the synthetic data

sugazmig < junk.susyn tmig=0.0 vmig=1.0 > junk.out

# show the resulting migrated data on the screen

suximage < junk.out label1="Migrated Time (sec)" \

label2="Midpoint (km)" title="Phase Shift Migration" &

# get out of this routine

exit


[Note: This example is taken from the class notes for Theory of Seismic Imaging by John Scales, available at Samizdat Press.]

After you have entered this and then saved it by using control-x, "y" and return (if you were in pico), you need to be able to execute it, so give yourself execute privileges by typing chmod +x synmig . In order to run this program, you simply type synmig at the Unix prompt. You should get first one screen displayed that has the synthetic data, then, after a few moments, another screen that has the migrated data. Hitting a return in the window where you were running this job returns the Unix prompt. Typing zap xmovie will remove all the display windows you have created.


3. Figuring out just what you have done. In order to understand the various parameters that you have typed in to your shell script synmig, you can use the SU help facility. Let's say you wonder how the synthetic seismogram package runs, so you type susynlv at the prompt, without including any arguments. SU interprets this as not knowing how to use susynlv, so it gives you the help file automatically. You see that the name stands for synthetic seismograms for linear v elocity function (all the Seismic Unix programs start with su) and that the various parameters describe things like the number of time samples and the velocity-depth function of the model. In order to make sure you understand what you have done, describe the velocity model used in this example, and sketch the locations of the reflectors in it (the reflections could have come from a density contrast rather than a velocity contrast). Look at more help files if you would like to; I encourage it.


4. Modifying and experimenting with this shell script. You will want to be able to print the images you have shown on your screen. This can be done by modifying the shell script so that the program supsimage (for seismic unix post-script image) is run rather than suxmovie. This program will create a postscript file as output rather than displaying it directly to the screen, and you can view the file with ghostview and print it directly to a postscript printer. Modify your script so that suxmovie is replaced with supsimage, and replace the & with the name of the output file, preceded by the output caret >. For example, the first suxmovie line becomes


supsimage < junk.susyn label1 = "Time (sec)" label2="Distance (km)" \

title="Synthetic Data" > synthetic_data.ps

You will want to change the second suxmovie call as well, perhaps naming its output file migrated_data.ps. After the new job (you can rename it if you want to when you leave the editor) has been executed, you should see two new .ps files in your subdirectory, and you can view them using ghostoview by typing

ghostview synthetic_data.ps

and you can print them to a postscript printer (your default, probably geops) by typing

lpr synthetic_data.ps

Print both the original shell script file and the modified one by using the enscript command (which is used to make a postscript file out of a regular text file and send it to the printer). Hand in all these printouts: two shell script files and two seismic displays.


5. Have some seismic fun and see what happens. You should have had some small familiarity with migration from earlier classes in seismology, but I'll bet it was all academic. You should have already figured out that the velocity used in this example (synmig) was a constant velocity field of one (arbitrary units), and that you used the exactly-correct velocity to migrate the seismic section. Try using different velocities (vmig) to over-migrate the data and to under-migrate it. Plot the results and hand them in as a way to show off your seismic-processing prowess.


Hints along the way:


For help on regular Unix commands, type man followed by the command you need help on. For example, if you wanted to learn how to remove a file you created, you could type

man rm

and get the help file on rm.


If, during the course, you make a mess of the demos subdirectory, you can simply remove it entirely and get a new one.


Useful Unix commands we have seen:

cd pwd ls chmod man rm lpr ghostview mkdir pico enscript | \ more



Congratulations: you are now a seismic unix user!

sumber:
READ MORE

Admin Cikadut's Blog