[Seisunix] mistake in the script

1,172 views
Skip to first unread message

Georgios Moukos

unread,
May 23, 2011, 3:41:31 PM5/23/11
to seis...@mailman.mines.edu
All,
could anyone please help me. I am running the following script and i get the error message
"sushw: fgettr.c: bad first header

sustatic: fgettr.c: bad first header

sufilter: fgettr.c: bad first header

suwind: fgettr.c: bad first header. Can you help me fix the script?
The script is the following:
segyread tape=profile2pos8ch1_reloc.segy conv=1 endian=1 verbose=1 vblock=1065 trmin=498 trmax=498 | segyclean \
| sugain mbal=1 > temp.su
awk '{print $2*1000}' 498obs8 | a2b n1=1 > cretac8plus.b
sushw < temp.su key=tstat infile=cretac8plus.b \
| sustatic hdrs=1 sign=1 \
| sufilter f=3,5,17,21 amps=0,1,1,0 \
| suwind key=offset min=0 max=35000 tmin=0 tmax=0.2 dt=0.004 > temp.su

What i want it to do is bring a certain pick of the 498th trace of a specific segy file to time zero and put all that into a file called temp.su so that when i run the command
sumax < temp.su output=ascii verbose=1 outpar=amp1 i will get the amplitude of the pick which i have specified in file 498obs8.
If you need more information let me know.
Thank you very much.
Georgios Moukos

Gery

unread,
May 23, 2011, 3:53:43 PM5/23/11
to Georgios Moukos, seis...@mailman.mines.edu
Be careful with the tstat, I don't remember well but you have to enter integer values, so if you're trying to put floats you have to use a scale value. Another point, it looks that your temp.su is the problem, after converting it you should make surange and display it in order to do some QC.

Sent from my iPod.
_______________________________________________
seisunix mailing list
seis...@mailman.mines.edu
https://mailman.mines.edu/mailman/listinfo/seisunix
Unsubscribe: seisunix-u...@mailman.mines.edu

Hyeong-Tae Jou

unread,
May 23, 2011, 7:23:25 PM5/23/11
to seis...@mailman.mines.edu
Hi Georgios,
 
For command like
"$ sucommand < input > ouput",
You should use different name for input and output.
 
Try with
sushw < temp.su .. | ......| suwind ... > tempout.su
 
Hyeong-Tae Jou
KORDI

2011/5/24 Georgios Moukos <egom...@yahoo.gr>

Leonard Lisapaly

unread,
May 23, 2011, 7:56:17 PM5/23/11
to Georgios Moukos, seis...@mailman.mines.edu

Hi Georgios,

 

Can you read the data properly (segyread)?

 

Try to execute this command :

 

sushw < temp.su key=tstat infile=cretac8plus.b >new_temp.su

 

and see whether you still get the error message.

 

If yes, probably problem in reading the file.

 

Regards,
Leo

 


Glenn Reynolds

unread,
May 23, 2011, 10:50:53 PM5/23/11
to Hyeong-Tae Jou, seis...@mailman.mines.edu
Yes. Using the same name will kill the original file. Check it's size afterwards. It is probably zero.


- glenn

Glenn Reynolds

unread,
May 24, 2011, 12:31:50 AM5/24/11
to Georgios Moukos, seis...@mailman.mines.edu
Georgios


You seem to have a file of picks and a SEGY file. However, you seem to be reading a single trace and trying to find the picked amplitude of its first sample after static correction (ie, of the pick value).

It may be more efficient to do all traces at once, rather than one at a time. If you have a file of picks, one for each trace, then this is one way to do it:

# MYSCRIPT - combines pick times and a SEGY file to create a text file of amplitudes at the picked locations.
#
# Requires a text file with one pick per SEGY trace
# also requires a SEGY file of course
#
# Georgios Moukos - 2011/05/24 (the week before Barcelona's epic defeat by Manchester United)


# set parameters
f=3,5,17,21

# generate statics file from a text file
awk '{print $2*1000}' 498obs8 | a2b n1=1 > cretac8plus.b
# if 
498obs8 contains picks for each trace. then we have made a binary header file cretac8plus.b which we can use in sustat to move the picks to time zero, for all traces.

# Read and apply balancing to all traces, bandpass filter the full trace and save in .SU format
segyread tape=profile2pos8ch1_reloc.segy conv=1 endian=1 verbose=1 vblock=1065 |
segyclean |
sugain mbal=1 |
sufilter f=$f  > temp.su 
# file now contains all traces from the SEGY file, with the mean subtracted from each trace, and a bandpass filter applied.

# set static header from file, apply static correction and get the amplitude of the first sample in the trace.
sushw < temp.su key=tstat infile=cretac8plus.b |
sustatic hdrs=1 sign=1 |
suwind tmax=0 |
suascii bare=1 >amplitudes.txt
# amplitudes.txt should now contain a list of amplitudes from the first sample of each trace. The first sample is the picked value, as we used the picks to apply a static shift upwards.


  • No need to put a \ character at the end of the line if the next line starts with a pipe.
  • Make sure the pipe is the last character on the line, as with the backslash \ character.
  • If you will be running the script a lot, then there is no need to recalculate the static file each time. That could be in a separate script. Or you could comment it out after running it the first time.
  • Note that the output file has been changed to amplitudes.txt
  • Comments have been added to make the script more readily understandable next year or by somebody else. The most important thing to include in a comment is why you are doing something, as that is the question you will also ask one year from now.
  • It may be wrong to apply sufilter after static correction, so it has been moved to a point before static correction to prevent artifacts.
  • You may not need to set dt=.004 in suwind, as it should already be set. Check surange to see.
  • sumax will not give you the pick you want - consider using suwind tmax=0 | suascii bare=1 instead. It removes all samples except the first and gets the amplitude of all samples in each trace
  • If you are doing a lot of parameter testing, then it is also a good idea to put the parameters at the top, so you can just change them in one place, as with f=3,5,17,21
  • It is useful to put some information at the start of the script so that you know what it does. Very helpful after the holidays.



Feel free to ignore this :-)

- glenn




Reply all
Reply to author
Forward
0 new messages