From p_palacios_ec at hotmail.com Mon Jan 12 06:23:24 2009 From: p_palacios_ec at hotmail.com (Pablo Palacios) Date: Mon, 12 Jan 2009 09:23:24 -0500 Subject: [SAC-HELP] how to find the value of tn marker ? In-Reply-To: <406b435e0811060937i26790f33sb64914c9fd76e9d3@mail.gmail.com> References: <406b435e0811060937i26790f33sb64914c9fd76e9d3@mail.gmail.com> Message-ID: 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<! 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< From george at gly.bris.ac.uk Mon Jan 12 08:15:57 2009 From: george at gly.bris.ac.uk (George Helffrich) Date: Mon, 12 Jan 2009 16:15:57 +0000 Subject: [SAC-HELP] how to find the value of tn marker ? In-Reply-To: References: <406b435e0811060937i26790f33sb64914c9fd76e9d3@mail.gmail.com> Message-ID: <876984c1c076a91664fc738faf6d5ff3@gly.bris.ac.uk> Dear Pablo - See the list (below) of built-in numeric functions in MacSAC. SAC2000 has all except GETVAL, I believe. You can do what you want by using something like this example in any version of SAC: --- funcgen seismogram cutim ((GETTIME MAX) - (&1,DELTA / 2)) ((GETTIME MAX) + (&1,DELTA / 2)) message "Maximum value is &1,depmax& at (GETTIME MAX)" --- Change (GETTIME MAX) to something else for another value in memory, e.g. &1,t0& It only works on one trace in memory, however, and destroys the memory copy it. --- fg seismogram message "Only in MacSAC, max value is (GETVAL (GETTIME MAX)) at (GETTIME MAX)" --- It would be nice if SAC2000 implemented GETVAL; the query arises regularly enough to put it on the to do list. Numeric functions Name Num. args. Example Notes ------------------------------------------------------------------------ ------ PI 0 (PI) Value of pi ADD >0 (ADD 1 2) SUBTRACT >0 (SUBTRACT 2 1) MULTIPLY >0 (MULTIPLY 1 2 3 4) DIVIDE >0 (DIVIDE 12 3) MINIMUM >0 (MINIMUM 0.78 -3.5 15.2) MAXIMUM >0 (MAXIMUM 0.78 -3.5 15.2) SQRT 1 (SQRT 2) Square root EXP 1 (EXP 2) Powers of e ALOG 1 (ALOG 2.5) Natural logarithm POWER 1 (POWER 3) Powers of 10 ALOG10 1 (ALOG10 1000) Base 10 logarithm SINE 1 (SINE 0.37) Argument in radians ARCSINE 1 (ARCSINE 0.37) Result in radians ASINE 1 (ASINE 0.37) Synonym COSINE 1 (COSINE 0.37) Argument in radians ARCCOSINE 1 (ARCCOSINE 0.37) Result in radians ACOSINE 1 (ACOSINE 0.37) Synonym TANGENT 1 (TANGENT 0.37) Argument in radians ARCTANGENT 1 (ARCTANGENT 1.00) Result in radians ATANGENT 1 (ATANGENT 1.00) Synonym INTEGER 1 (INTEGER 1.05) Integer part of expression ABSOLUTE 1 (ABSOLUTE 1.05) GETTIME 1,2 (GETTIME 17.05) Time of first occurrence of (GETTIME MAX 17.05) value in file, or value greater (GETTIME MIN -7.05) than (MAX) or less than (MIN) in (GETTIME MAX) file, or DEPMAX or DEPMIN if no (GETTIME MIN) value provided GETVAL 1,3 (GETVAL 157.32) Data values of at 157.32 s in each file in memory. (GETVAL FILE N 157.32) Data value at 157.32 s in file N in memory; N integer > 0. String functions Name Num. args. Syntax Description ------------------------------------------------------------------------ ------ CHANGE 3 (CHANGE X Y Z) Changes X to Y in Z DELETE 2 (DELETE X Y) Deletes X in Y BEFORE 2 (BEFORE X Y) Returns text in Y preceding X AFTER 2 (AFTER X Y) Returns text in Y following X SUBSTRING 3 (SUBSTRING X Y Z) Returns characters X to Y in Z Index starts with 1; X or Y may be END to indicate last character CONCATENATE - (CONCATENATE X Y Z ...) Joins all strings together On 12 Jan 2009, at 14:23, Pablo Palacios wrote: > 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< 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< 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<! 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< 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! Try it! > _______________________________________________ > sac-help mailing list > sac-help at iris.washington.edu > http://www.iris.washington.edu/mailman/listinfo/sac-help > George Helffrich george at geology.bristol.ac.uk From saccorotti at pi.ingv.it Mon Jan 12 09:24:09 2009 From: saccorotti at pi.ingv.it (Gilberto Saccorotti) Date: Mon, 12 Jan 2009 18:24:09 +0100 (CET) Subject: [SAC-HELP] Troubles on compiling SAC on a 64-bit machine Message-ID: <19203480.11711231781049599.JavaMail.root@email.pi.ingv.it> Dear all: I'm repetitively trying to compile SAC on my 64-bit HP machine (mandriva 2007 linux arch) using: % ./configure --x-libraries=/usr/X11R6/lib I also tried to force 32-bit detection: % env CFLAGS="-m32" but I always get the same weirdness: ***************************************************************** configure: error: C compiler cannot create executables ***************************************************************** due to some 'imultilib' unrecognised option, as depicted by the log file. Any clue on possible workarounds? hanks in advance, Gilberto Saccorotti -- ************************************************************** Gilberto Saccorotti Istituto Nazionale di Geofisica e Vulcanologia Sezione di Pisa - Via U. della Faggiola, 32 - 56126 PISA (I) Tel +39 050 83119 60 Fax +39 050 83119 42 ************************************************************** From s.peacock at blacknest.gov.uk Mon Jan 12 09:25:12 2009 From: s.peacock at blacknest.gov.uk (Sheila Peacock) Date: Mon, 12 Jan 2009 17:25:12 +0000 Subject: [SAC-HELP] suggestions on finding maximum value of spectrum Message-ID: <496B7CF8.1050800@blacknest.gov.uk> Dear all, These were suggested by my colleague. I can take no credit for them. Some of the SAC commands have been abbreviated. Regards, Sheila Peacock. Sheila, if they want to know the frequency at which the maximum amplitude occurs, then r $1 rtr taper fft * add any smoothing in here keepam markptp lh t1 does the trick. The maximum value of an amplitude spectrum can be simply obtained by fft keepam lh depmax Do they want to know the frequency when this occurs? the value of the time series at a marker, say t1, can be found by something like this: r $1 evaluate to x1 &1,t1 - ( &1,delta / 2 ) evaluate to x2 &1,t1 + ( &1,delta / 2 ) cut %x1 %x2 r lh depmax From mdsilveira at fc.ul.pt Tue Jan 13 03:50:01 2009 From: mdsilveira at fc.ul.pt (=?ISO-8859-1?Q?Gra=E7a?= Silveira) Date: Tue, 13 Jan 2009 11:50:01 +0000 Subject: [SAC-HELP] How to concatenate several sac files Message-ID: <1231847401.7427.27.camel@matos> Dear All Does someone know a sac command (or several in a script) to concatenate several sac files? Thanks Gra?a Silveira -- Gra?a Silveira Professora Adjunta ?rea Cient?fica de F?sica Instituto Superior de Engenharia de Lisboa Rua Conselheiro Em?dio Navarro 1959-007 Lisboa tel: 218317135 Centro de Geof?sica da Universidade de Lisboa Edif?cio C8 Campo Grande 1749-016 LISBOA email: mdsilveira at fc.ul.pt tel: 217500812 From meixue.geo at gmail.com Tue Jan 13 06:35:37 2009 From: meixue.geo at gmail.com (Mei Xue) Date: Tue, 13 Jan 2009 22:35:37 +0800 Subject: [SAC-HELP] How to concatenate several sac files In-Reply-To: <1231847401.7427.27.camel@matos> References: <1231847401.7427.27.camel@matos> Message-ID: <9cda3feb0901130635i6049bd32h41ec3cd3cc58c9f1@mail.gmail.com> I use merge commands. The following is the shell script I use: ## merge the data segmental files from the same station to one file ## and remove the extra segmental files for that station ## merge before simplify file name, as which can cause some files overwritten foreach wave (BHZ BHE BHN HHZ HHE HHN BH1 BH2 BH3 HH1 HH2 HH3 EHZ EHE EHN EH1 EH2 EH3) ls -1 *.$wave.*SAC | gawk -F. '(NR>=1){if($1==station){printf("merge %s\n w over\n",$0)} else{station=$1;printf("r %s\n",$0)}}' >! m erge.tmp echo q >> merge.tmp sac2000 merge.tmp ls -1 *.$wave.*SAC | gawk -F. '(NR>=1){if($1==station){printf("rm -f %s\n",$0)} else{station=$1}}' >! rmsegments.tmp chmod 777 rmsegments.tmp rmsegments.tmp end Note: here I rename all the files in a certain sequence, and the following is the shell script I used to process the raw sac files extracted using rdseed: ## reorder file names to make station name 1st, channel name 2nd, for the convenience of ## merging files for the same station; and keep all other information to make sure ## no files is overwritten ls -1 *.?HE.*SAC | awk -F. '{ printf "mv %s %s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s\n",$0,$8,$10,$1,$2,$3,$4,$5,$6,$7,$9,$11,$12}' >! rena me.tmp ls -1 *.?HN.*SAC | awk -F. '{ printf "mv %s %s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s\n",$0,$8,$10,$1,$2,$3,$4,$5,$6,$7,$9,$11,$12}' >> rena me.tmp ls -1 *.?HZ.*SAC | awk -F. '{ printf "mv %s %s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s\n",$0,$8,$10,$1,$2,$3,$4,$5,$6,$7,$9,$11,$12}' >> rena me.tmp ls -1 *.?H[123].*SAC | awk -F. '{ printf "mv %s %s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s.%s\n",$0,$8,$10,$1,$2,$3,$4,$5,$6,$7,$9,$11,$12}' >> rename.tmp chmod 777 rename.tmp rename.tmp Hope it helps, Mei Xue 2009/1/13, Gra?a Silveira : > Dear All > > Does someone know a sac command (or several in a script) to concatenate > several sac files? > > Thanks > > Gra?a Silveira > > > -- > Gra?a Silveira > Professora Adjunta > > ?rea Cient?fica de F?sica > Instituto Superior de Engenharia de Lisboa > Rua Conselheiro Em?dio Navarro > 1959-007 Lisboa > tel: 218317135 > > Centro de Geof?sica da Universidade de Lisboa > Edif?cio C8 > Campo Grande > 1749-016 LISBOA > email: mdsilveira at fc.ul.pt > tel: 217500812 > > _______________________________________________ > sac-help mailing list > sac-help at iris.washington.edu > http://www.iris.washington.edu/mailman/listinfo/sac-help > From sgao at mst.edu Wed Jan 14 12:18:16 2009 From: sgao at mst.edu (Gao, Stephen S.) Date: Wed, 14 Jan 2009 14:18:16 -0600 Subject: [SAC-HELP] sacio.a for 64 bit Linux Message-ID: <053AE1104879004E8F53E72AF0F9D31F3F7D7C@MST-VMAIL1.srv.mst.edu> Hi SAC experts, We have just obtained an X86-64 Redhat Linux server and I would like to install SAC on it. SAC itself works fine on the 64 bit machine but the lib/sacio.a file that came with the package cannot be compiled with FORTRAN codes. Please help. Thanks. Steve ---------------------------- Here is the error message when "make" was typed: g77 -g readsac.f -o readsac.exe \ /home/sgao/subs/wsac1gao.f \ /home/sgao/soft/sac/lib/sacio.a /usr/bin/ld: warning: i386 architecture of input file `/home/sgao/soft/sac/lib/sacio.a(getfhv.o)' is incompatible with i386:x86-64 output /usr/bin/ld: warning: i386 architecture of input file `/home/sgao/soft/sac/lib/sacio.a(rsac1.o)' is incompatible with i386:x86-64 output .... A *.exe file was created by when I tried to run it, it produced a Segmentation fault. ======================================= Stephen S. Gao, PhD, Associate Professor of Geophysics, Department of Geological Sciences and Engineering, Missouri University of Science & Technology (MST) 129 McNutt Hall, Rolla, Missouri 65409, E-mail: sgao at mst.edu Office Phone: (573)-341-6676, FAX:(573)-341-6935 http://www.mst.edu/~sgao http://mars.device.mst.edu/GG (Geology & Geophysics at MST) -------------------------------------------------------------------------------------------- MST History: 1870-1964: Missouri School of Mines and Metallurgy (MSM) 1964-2007: University of Missouri-Rolla (UMR) 2008------: Missouri University of Science & Technology (MST) ++++++++++++++++++++++++++++++++++++++++++++++++++++ From savage at uri.edu Wed Jan 14 13:33:26 2009 From: savage at uri.edu (Brian Savage) Date: Wed, 14 Jan 2009 16:33:26 -0500 Subject: [SAC-HELP] sacio.a for 64 bit Linux In-Reply-To: <053AE1104879004E8F53E72AF0F9D31F3F7D7C@MST-VMAIL1.srv.mst.edu> References: <053AE1104879004E8F53E72AF0F9D31F3F7D7C@MST-VMAIL1.srv.mst.edu> Message-ID: <5B0E70FA-F3F1-45C2-B9D1-83665D9AF469@uri.edu> Steve, Try compiling the fortran code with the -m32 option. Cheers Brian Savage savage!@uri.edu On Jan 14, 2009, at 3:18 PM , Gao, Stephen S. wrote: > Hi SAC experts, > > We have just obtained an X86-64 Redhat Linux server and I would > like to install SAC on it. SAC itself works fine on the 64 bit > machine but the lib/sacio.a file that came with the package cannot > be compiled with FORTRAN codes. > > Please help. > > Thanks. > > Steve > > ---------------------------- > > Here is the error message when "make" was typed: > > g77 -g readsac.f -o readsac.exe \ > /home/sgao/subs/wsac1gao.f \ > /home/sgao/soft/sac/lib/sacio.a > > /usr/bin/ld: warning: i386 architecture of input file `/home/sgao/ > soft/sac/lib/sacio.a(getfhv.o)' is incompatible with i386:x86-64 > output > /usr/bin/ld: warning: i386 architecture of input file `/home/sgao/ > soft/sac/lib/sacio.a(rsac1.o)' is incompatible with i386:x86-64 output > .... > > > A *.exe file was created by when I tried to run it, it produced a > Segmentation fault. > > > ======================================= > Stephen S. Gao, PhD, > Associate Professor of Geophysics, > Department of Geological Sciences and Engineering, > Missouri University of Science & Technology (MST) > 129 McNutt Hall, Rolla, Missouri 65409, > E-mail: sgao at mst.edu > Office Phone: (573)-341-6676, FAX:(573)-341-6935 > http://www.mst.edu/~sgao > http://mars.device.mst.edu/GG > (Geology & Geophysics at MST) > > ---------------------------------------------------------------------- > ---------------------- > MST History: > 1870-1964: Missouri School of Mines and Metallurgy (MSM) > 1964-2007: University of Missouri-Rolla (UMR) > 2008------: Missouri University of Science & Technology (MST) > ++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > _______________________________________________ > sac-help mailing list > sac-help at iris.washington.edu > http://www.iris.washington.edu/mailman/listinfo/sac-help From sebastian.heimann at zmaw.de Thu Jan 15 03:26:09 2009 From: sebastian.heimann at zmaw.de (Sebastian Heimann) Date: Thu, 15 Jan 2009 12:26:09 +0100 Subject: [SAC-HELP] sacio.a for 64 bit Linux In-Reply-To: <5B0E70FA-F3F1-45C2-B9D1-83665D9AF469@uri.edu> References: <053AE1104879004E8F53E72AF0F9D31F3F7D7C@MST-VMAIL1.srv.mst.edu> <5B0E70FA-F3F1-45C2-B9D1-83665D9AF469@uri.edu> Message-ID: <496F1D51.7030907@zmaw.de> Hi! > Try compiling the fortran code with the -m32 option. If you are lucky, this might work, but when I had the same problem, I had to drop SAC IO support from my application, because of 2 reasons: (1) My app uses more memory than I can address on 32 bit systems and (2) I would have had to recompile every other library, which my app depends on also with -m32. For small programs this is the way to go, but for large ones this can lead to much frustration. As far as i know, there is at least a SAC input routine in PQL2 which compiles on 64 bit Linuxes. I have not tried to use it, but maybe this would be a solution until SAC is rewritten for 64 bit. Cheers, Sebastian From b.shirishas at gmail.com Tue Jan 20 22:16:05 2009 From: b.shirishas at gmail.com (b shirisha) Date: Wed, 21 Jan 2009 11:46:05 +0530 Subject: [SAC-HELP] how to convert macro file to ps file Message-ID: Dear All is there any sac command to convert macro file to ps file. The macro file contains intial event and final event in the same graphical window. so by converting it to ps file format we got only intial event, the commands we used for ps file conversion are *SAC> bg sgf* *SAC> p2* *SAC>sgftops f001.sgf * ** the script of macro file is as follows *xlable "time @(s@)" size tiny xdiv power off fileid off beginframe color on i on l black blue gtext font 1 size small symbol off ylable off ylim -98341.4 85221.8 title "Final bsr , 1.03672" xvport 0.550000 0.900000 yvport 1.00000E-01 0.660000 xlim 1107.04 1548.04 read datf1.bsr synf1.bsr plot2 ylim -77907.1 78657.5 title "Intial bsr , 3.15267" xvport 1.00000E-01 0.450000 yvport 1.00000E-01 0.660000 xlim 1107.04 1548.04 read datf1.bsr syns1.bsr^@^@^@^@^@^@^@^@^@^@^@^@^@^@^^@^@^@^* -------------- next part -------------- An HTML attachment was scrubbed... URL: From b.shirishas at gmail.com Tue Jan 27 21:54:59 2009 From: b.shirishas at gmail.com (b shirisha) Date: Wed, 28 Jan 2009 11:24:59 +0530 Subject: [SAC-HELP] decimation Message-ID: Dear All, please can anybody tell me the use of decimation . thanking you sirisha -------------- next part -------------- An HTML attachment was scrubbed... URL: From Onur.Tan at mam.gov.tr Wed Jan 28 10:47:00 2009 From: Onur.Tan at mam.gov.tr (Onur Tan) Date: Wed, 28 Jan 2009 20:47:00 +0200 Subject: [SAC-HELP] cross-correlation time shift Message-ID: <9E88105FE4AC8C47BD6D00EB9831482F0BDA0241@posta.mam.gov.tr> Hi all, I need to get time shift of cross-correlation function of two signals. is there a way to learn the time shift value ? best regards Onur From m.tchelo at gmail.com Thu Jan 29 06:01:21 2009 From: m.tchelo at gmail.com (Marcelo Bianchi) Date: Thu, 29 Jan 2009 12:01:21 -0200 Subject: [SAC-HELP] readcss/writecss Message-ID: <89b338c10901290601r36b9dbd8q4535490f67dd83a8@mail.gmail.com> Hi guys, Does someone noticed that SAC can read it's own written CSS files ? try for your self: fg seismograph writecss lala readcss lala.wfdisc I searched and find that it says inm the wfdisc file that the .w file is IEEE big endian (t4 css datatype) and actually it writes IEEEE little endian files (f4 css datatye). Does anyone has a patch to fix that ? regards, marcelob -- :: "This is all about life !" :: :: Find me @ http://www.foo4fun.net/ ::