[SAC-HELP] how to find the value of tn marker ?
Pablo Palacios
p_palacios_ec at hotmail.com
Mon Jan 12 06:23:24 PST 2009
Dear Weitao,
I had the same necesity some time ago. I can not find a sac intruction for solve it. In my case I was looking for the maximum value of a spectrum. For reach it I made a csh script, the following lines are part of that script and could be useful. If you know another easy form to do, please tell me.
P.
# cutting the file between C1 and C2 marks and building the spectrum file
sac<<EOF
cut $C1 $C2
r ${stn}_${cmp}_${event}.sac
chnhdr A UNDEF
chnhdr F UNDEF
dft wom a
writesp am
EOF
# smoothig the spectrum and writting it as text file
sac<<EOF
r ${stn}_${cmp}_${event}.sac.am
smooth mean h 10
write over
write alpha change .am .am.alpha
EOF
# extracting the number of point of the file to compute de maximum frequency
sac<<EOF >! header
r ${stn}_${cmp}_${event}.sac.am
listhdr NPTS
EOF
# computing the spectrum variation between consecutive points
set delta = `awk '/NPTS/{print 25/($3-1)}' header`
# converting the spectrum text file to spectrum column file without header (30 first lines)
set spectrum = `echo ${stn}_${cmp}_${event}.sac.am.alpha`
awk 'NR>30{print $0}' $spectrum | awk 'BEGIN{OFS="\n"}{print $1,$2,$3,$4,$5}' > spectrum-c
# selecting the point of the maximum frequency and computing this value
set MaxFreq = `awk '{if(NR==1){max=$1}else if($1>max){max=$1;print NR,max}}' spectrum-c | tail -1 | awk '{print $1}'`
set MaxFreq = `echo $delta $MaxFreq | awk '{print $1*($2-1)}'`
# deleting temporal work files
rm -f header
rm -f ${stn}_${cmp}_${event}.sac.am.alpha
rm -f spectrum-c
# automatic picking in the spectrum file of the maximum frequency
sac<<EOF
r ${stn}_${cmp}_${event}.sac.am
chnhdr F $MaxFreq
write over
EOF
Date: Thu, 6 Nov 2008 10:37:05 -0700
From: wangwtustc at gmail.com
To: sac-help at iris.washington.edu
Subject: [SAC-HELP] how to find the value of tn marker ?
Dear All
Is there any sac command to find the value of tn marker ? I mean if t1=100. can I find out the Y-value at that time?
thanks all.
weitao
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20090112/26ad2742/attachment.html>
More information about the sac-help
mailing list