Enhancements Bug and Fixes 330

Introduction

The purpose of this page is to notify users of the Computer Program in Seismology (CPS) package of repairs or extensions made to the code. Whenever this page is updated, the down loadable version of CPS is updated at the download FTP site.,

Enhancements to Version 3.30 code: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013



 

 

December 15, 2012

December 10, 2012

October 22, 2012


Original code
Corrected code


September 20, 2012

September 9, 2012

August 6, 2012

July 26, 2012

April 9, 2012

March 26, 2012

February 8, 2012

January 14, 2012


 

November 23, 2011

November 1, 2011

October 20, 2011


OLD (problem)
NEW (Repaired)



October 13, 2011

September 23, 2011


October 24, 2010

October 12, 2010

Usage: Setup SOL WIN32 SOL-EGCS LINUX LINUX64 CYGWIN OSX
SOL SUN Solaris Compilers
SOL-GNU SUN Solaris with gcc/g77 compilers
CYGWIN CYGWIN 98/NT/2K/XP gcc/g77 Compilers
CYGWIN40 CYGWIN 98/NT/2K/XP gcc/gfortran Compilers
LINUX40 Linux with gcc/gfortran compilers
LINUX6440 Linux 64 bit with gcc/gfortran compilers
OSX40 Apple with gcc/gfortran compilers
OSX40-32 Apple with 32-bit gcc/gfortran compilers
Older systems - not modern
LINUX Linux with gcc/g77 compilers
LINUX64 Linux 64 bit with gcc/g77 compilers
OSX Apple with gcc/g77 compilers

The purpose of the OSX40-32 flag is to force a 32 bit compile. This is useful on some Mac's where the gfortran and gcc compilers such that one is 32 bit and the otehr 64 bit

October 3, 2010

September 30, 2010

Con Z  [B|O|A|T0|T1|T2|T3|T4|T5|T6|T7|T8|T9] File external_sac_file [Suffix suffix]
One marker must be set to define the zero time of the pulse in order to prevent incorrect delays. The following example creates an impulse, sets "O" to the start of the impulse, convolves with the internal function "Triangle" and then uses the "Convolve" command to do the same:
gsac << EOF
#####
# define the filter
#####
fg imp delta 0.1 npts 256
w imp.sac
r imp.sac
# set the o marker
ch o 0
w
triangle w 1.0
w tr.sac
#####
# define the impulse with a different sample rate
#####
fg imp delta 0.05 npts 512
w nimp.sac
r nimp.sac
conv z o f tr.sac s ".con"
w
q
EOF

A comparison of the files tr.sac and nimp.sac.con  shows that they are the same and have the same spectral amplitudes, except at high frequency because of the different sample rates.

September 20, 2010

September 17, 2010

August 30, 2010

tprep96 -M model.TI -L -R -NMOD 500 -d dfile -HS 10 -HR 0
tdisp96
tlegn96
tregn96
tpulse96 -V -p -l 4 -d dfile > tifile96
fprof96 -A < tifile96
Of course isotropic models can be used with these programs, also though the computations will take longer than for the corresponding isotropic codes.

August 20, 2010

July 15, 2010

June 17, 2010

The mt (moment tensor) command in gsac was modified to permit an explosion source, mt iso mw 5.0 FILE fileproto. In addition the generation of separate Z, R, T, N or E components can also the new syntax mt TO UZ  or in general one of UR, UZ, UT, UN or UE in place  of the previous R, Z, T, N or E, respectively. The current version of gsac is now V1.1.33 17 JUN 2010.

June 14, 2010

June 6, 2010

May 20, 2010

April 7, 2010

plotnps -F7 -W10 -EPS -K -BGFILL < SACPSD.PLT > 2.eps
convert -trim 2.eps im2.png
gm convert -trim 2.eps gm2.png

plotnps -F7 -W10 -EPS -K -I < SACPSD.PLT > 3.eps
convert -trim 3.eps im3.png
gm convert -trim 3.eps gm3.png

March 18, 2010

graysc.png
grayscinv.png
plotnps  -F7 -W10 -EPS -K < GRAYSC.PLT > t.eps
gm convert -trim t.eps graysc.png
plotnps  -F7 -W10 -EPS -K -I < GRAYSC.PLT > t.eps
gm convert -trim t.eps grayscinv.png

February 28, 2010

February 16, 2010

to move two declarations to the top of  update_type74 in output_seed.c and in parse_type11 in parse_11.c.  The Solaris cc compiler
did not like the declarations to be intermixed with code farther down.

STA   IWT       ARRIVAL TIME   PhIDQL PHASE  FM CHAN    LAT       LON      ELEV   
OK001 0 20100213053058.250 2 0 i S X Z 35.5611 -97.2895 350.00
OK001 0 20100213053057.219 1 0 i P C Z 35.5611 -97.2895 350.00
OK002 0 20100213053100.168 2 0 i S X Z 35.5493 -97.1966 354.00
... ... ... ... ...
HYPO71 Quality : BA
Gap : 84 deg

ch evla 35.5331 evlo -97.2982 evdp 5.52
ch ocal 2010 02 13 05 30 55 968
The last entries are used by cut here and pasting into the gsac command line.

January 11, 2010

            Digital Filter Designers Handbook with C++ algorithms
            C.  Britton Rorabaugh 2nd Edition
            McGraw Hill, New York, 479 pp 1997  Chapter 5
                                } else if (filt_lhp == BANDREJECT){
                                        wc = fwarp(Wc,dt);
                                        wl = fwarp(Wl/ffac,dt);
                                        wu = fwarp(Wu/ffac,dt);
                                        num[0] = wl*wu*dt*dt;
                                        num[1] = 0.0;
            to

                                } else if (filt_lhp == BANDREJECT){
                                        wc = fwarp(Wc,dt);
                                        wl = fwarp(Wl/ffac,dt);
                                        wu = fwarp(Wu/ffac,dt);
                                        num[0] = wc*wc*dt*dt;
                                        num[1] = 0.0;


December 4, 2009


October 8, 2009

       Summary of changes made since July 22, 2009
                     SDRPLANES stk1 dip1 rake1 stk2 dip2 rake2
                    The reason is that I wanted to examine the dip variation in the L'Aquila aftershock sequence
 RMS Error        :               0.150              sec
Travel_Time_Table: nnCIA
Latitude : 35.9288 +- 0.0130 N 1.4501 km
Longitude : 43.2796 +- 0.0173 E 1.5470 km
Depth : 13.65 +- 0.88 km
Epoch Time : 1247949147.952 +- 0.31 sec
Event Time : 20090718203227.952 +- 0.31 sec
Event (OCAL) : 2009 07 18 20 32 27 952
HYPO71 Quality : CD
Gap : 161 deg

In addition two more prototype velocity models were added. The KOREA model corresponding to my pre-computed Green's functions for Korea, and the nnCIA model corresponding to my pre-computed Green's functions for waveform of earthquakes in the Central Italian Appenines.

July 22, 2009

 June 19, 2009

         MEMORY          |     1    |     2    |     3    |     4    | ...
1-D real array | x(1) | x(2) | x(2) | x(4) | ...
2-D real array | x(1,1) | x(2,1) | x(1,2) | x(2,2) | ...
Complex array | Re[x(1)] | Im[x(1)] | Re[x(2)] | Im[x(2)] | …

This was carefully fixed by defining a revised routine zfour(z,npts,isign,dt,df) in all code. This is a step in defining every variable in a manner compatible with modern computer languages.

The program files  updated were as follow:
        VOLII/src/sacmat96.f
        VOLII/src/sacmft96.f
        VOLII/src/sacpom96.f
        VOLIII/src/spulse96.f
        VOLIV/src/rftndr96.f
        VOLIV/src/twofft.f
        VOLV/src/ffilt96.f
        VOLV/src/fspec96.f
        VOLVI/src/hpulse96.f
        VOLVI/src/hrftn96.f
        VOLVI/src/hudson96.f
        VOLVI/src/trftn96.f
        VOLVIII/src/sacdecon.f
        VOLVIII/src/sacevalr.f
        VOLVIII/src/sacfilt.f
        VOLVIII/src/saciterd.f
        VOLVIII/src/sacspc96.f
        VOLIX/src/cpulse96.f

The following documentation was updated:
          DOC/OVERVIEW.pdf/cps330o.pdf
          DOC/GSAC.pdf/cps330g.pdf
          DOC/STRUCT.pdf/cps330c.pdf
          DOC/SOURCE.pdf/cps330s.pdf
          CALPLOT.pdf/cps330p.pdf

June 11, 2009

May 23, 2009

March 30, 2009

The reason for this is that a field system had a broadband sensor with internal UVW sensors and also an accelerometer. As part of seismic network quality control, the recordings of each were corrected for instrument response and the derived ground motions were compared for that part of the signal with high signal-to-noise. These should be identical since the ground motion is the same.  For our field system, this did  not occur, and we returned the broadband and accelerometer to the university and compared the recordings to a reference system.  A similar comparison showed that the problem was with the broadband sensor. The rotate3 to uvw was added to gsac to isolate the internal UVW sensor that was the cause of the problem. To do this the ZNE motion of the test and reference systems were rotated to the UVW coordinate system of the test system and the individual UVW traces were compared. Because we compared two different 3-component sensors, recording of the UVW channels of each would not have worked since each was different.

A description of the coordinate system transformation inplemented now is gsac given in the PDF document rotate3.pdf

March 19,2009

March 18, 2009

March 3, 2009

February 21, 2009

February 18, 2009

January 5, 2009

       fmlpr "TITLE" "DATETIME" "GEOG" EVDP MW strike dip rake "FILE1" "FILE2" "FILE3"

              TITLE DATETIME and GEOG are enclosed in quotes
              FILE1 - name of file with stations used
              FILE2 - file with data summary: NSTA NCMP MINPER
             FILE3 - file with filtering commands

       fmlpr "USGS/SLU Moment Tensor Solution" "${YEAR} ${MO} ${DY} ${HR} ${MN} ${SEC} ${MSEC} ${LAT} ${LON} ${DEPTH} ${MAG}" "${STATE}" ${HS} ${MW} ${STK} ${DIP} ${RAKE} sumstaused.txt  sumswavendk.txt  sumwfilter.txt
         
       Here the first string provides a title for the printer plot, the second string provides information about the earthquake location and the third string provides a geographical description of the earthquake sourcce zone.  These nest items, e.g., HS, MW, STK, DIP and RAKE are the source depth, moment magnitude and double-couple source parameters. The last three items are text files for turther annotation. The sumstaused.txt lists the stations used for the source inversion, sumswavendk.txt consists of a single line with three numbers - the number of stations used, the number of components and the minimum period used in the inversion. The last file, sumwfilter.txt, lists the gsac signal preparation commands so that the filter band is known.

When invoked as

fmlpr "USGS/SLU Moment Tensor Solution" "2008 10 14 03 07 28 000  35.76  -100.704  5.0  3.80" "Texas" 11.0 3.65 285 70 -80 sumstaused.txt sumswavendk.txt sumwfilter.txt
 
with sumstaused.txt containing

IU.ANMO TA.MSTX US.CBKS US.JCT US.KSU1 US.OGNE US.SDCO
US.WMOK

and sumswavendk.txt contining

8 19 10

and sumwfilter.txt containing

hp c 0.05 n 3
lp c 0.10 n 3
br c 0.12 0.25 n 4 p 2

two files are created: 20081014030728.msg, which is the printer plot, and 20081014030728.ndk, which is the solution information in the Global CMT ndk format (http://www.seismology.harvard.edu/projects/CMT/catalog/allorder.ndk_explained ). The contents of the file 20081014030728.ndk are

ENS  2008/10/14 03:07:28:0  35.76 -100.70   5.0 3.8 0.0 EL SALVADOR
C20081014030728A B: 0 0 0 S: 8 19 10 M: 0 0 0 CMT: 1 TRIHD: 0.2
CENTROID: 0.0 0.0 35.76 0.00 -100.70 0.00 11.0 0.0 FREE S-20090105234025
21 -2.379 0.000 2.526 0.000 -0.147 0.000 2.681 0.000 -0.949 0.000 -0.064 0.000
V10 3.758 24 7 0.000 9 102 -3.758 64 211 3.758 285 70 -80 78 22 -116


January 2, 2008

             redodate 2009 01 01 00 01 02 456 -3660
returns
             2008 12 31 23 00 02 456
I require this in order to specify window segments for traces that I wish to download.  Previously i started at the origin time, but I needed more signal for inversion, so I would like to start some offset (a negative number) before the specified origin time.   This code segment indicates how this would be used in a shell script, where I would like to start 60 seconds before the origin time:

YEAR=2009
MONTH=01
DAY=01
HOUR=00
MINUTE=01
SECOND=02
MSEC=456
OFFSET=-60
redodate ${YEAR} ${MONTH} ${DAY} ${HOUR} ${MINUTE} ${SECOND} ${MSEC} ${OFFSET} >
tmp
read YEAR MONTH DAY HOUR MINUTE SECOND MSEC < tmp
echo "YEAR :" ${YEAR}
echo "MONTH :" ${MONTH}
echo "DAY :" ${DAY}
echo "HOUR :" ${HOUR}
echo "MINUTE :" ${MINUTE}
echo "SECOND :" ${SECOND}
echo "MSEC :" ${MSEC}
rm -f tmp

December 22, 2008



November 12. 2008

September 3, 2008

August 4, 2008

June 13, 2008

May 25-29, 2008

May 7, 2008

April 9, 2008

March 31, 2008

Hudson, J. A. (1969). A quantitative evaluation of seismic signals at teleseismic distances - II. Body waves and surface waves from an extended source, Geophys. J. Roy. astr. Soc. 18, 353-370.

March 14, 2008

February 8, 2008

January 28, 2008

January 22, 2008

January 17, 2008

January 10, 2008

January 3, 2008

A detailed tutorial on teleseismic synthetics and source inversion must be prepared.

This update changes the following programs: sdisp96, sregn96 and slegn96 in PROGRAMS.330/VOLIII/src, srfdis96, srfdrr96 and srfdrl96 in PROGRAMS.330/VOLIV/src, and hspec96 in PROGRAMS.330/VOLVI/src. Note hspec96 was modified on January 14, 2008 to correctly handle the source and receiver depth insertion for the flattening. The use fo the reference depth still needs work to handle atmospheric layers about the surface.



November 17, 2007

November 9, 2007

October 21. 2007

Hacked a fix for the distance computation used in gsac (gsac_subs.c) and udelaz.  The problem was that if the event - station latitude/longitude pair differed in coordinates by 0.0001 degree or less, then the computed distance in kilometers was incorrect because of roundoff error of the angles used for the elliptic integrals. The artifice used for distances less than 1.0 km, is to use the spherical relation  delkm = 6371.003 * delradian  for the short distances.

October 19. 2007

October 04, 2007

A problem with the distance/azimuth computations in gsac  was noticed in the process of computing epicentral distances less than 1 km.  This problem will also affect udelaz. This is currently under investigation.

August 30, 2007

August 19, 2007


> sac2000
 SEISMIC ANALYSIS CODE [8/8/2001 (Version 00.59.44)]
 Copyright 1995 Regents of the University of California

SAC> r ../*.sac
../imp.sac ...nimp.sac
SAC> w append .s
../imp.sac.s ...nimp.sac.s
SAC> ls
SAC> r
../imp.sac ...nimp.sac
SAC> w prepend p.
p.../imp.sac ...nimp.sac
 ERROR  101: opening file
SAC>                                     

GSAC - Computer Programs in Seismology [V1.1.19 01 AUG 2007]
       Copyright 2004, 2005, 2006, 2007 R. B. Herrmann
GSAC> r ../*.sac
../imp.sac ../nimp.sac
GSAC> w append .s
imp.sac.s nimp.sac.s   [Note write in local directory not original ]
GSAC> r
../imp.sac ../nimp.sac
GSAC> w prepend p.    [Note write in local directory not original - note Sac2000 ]
p.imp.sac p.nimp.sac      [cannot prepend in parent directory ]
GSAC> w append .S prepend P.   [Note write in local directory not original ]
P.imp.sac.S P.nimp.sac.S
GSAC> ls                      [show what was created in the current directory]
imp.sac.s  nimp.sac.s  p.imp.sac  P.imp.sac.S  p.nimp.sac  P.nimp.sac.S

One major difference is that although a  'w'  under both sac2000 and gsac will overwrite the original file in the upper directory, the gsac append and prepend will create files in the current directory.  Because gsac strips off the leading directory path prior to implementing the prepend command, this operation will work.

August 16, 2007

August 14, 2007

August 1, 2007

July 16, 2007

July 1, 2007

                ppk pq    or      ppk pquality

This is functionally similar to the previously introduced  'ppk quality'  except that the purpose is to simultaneously define a useful trace and to reset the P-time. For my source inversion, I set the theoretical P-time using the AK135 predicted times.  This is OK for source inversion since the inversion code permits a simple waveform time shift. However for broadband depth or energy determination, it is necessary to start at the P time.  To speed up the review, I added this new option. So now move the crosshair to the P-wave first arrival, and then click any mouse button. Simultaneously the P-arrival time is reset and the trace is marked as one to be used (IHDR20 is set to +1).



April 23, 2007

March 31, 2007

March 19, 2007

March 15, 2007

February 22. 2007

for i in *sac
do
GCARC=`saclhdr -GCARC $i`
EVDP=`saclhdr -EVDP $i`
A=`time96 -M ${MODEL} -GCARC ${GCARC} -T -EVDP ${EVDP}`
T0=`time96 -M ${MODEL} -GCARC ${GCARC} -T -EVDP ${EVDP} -SV`
echo ${GCARC} ${EVDP} ${A} ${T0}
gsac << EOF
rh $i
synchronize O
ch A ${A} T0 ${T0} T1 ${T0}
wh
quit
EOF
done

The 'synchronize O' is used to reset the time stamp so that 'O' , the offset of the origin time with respect to the reference time, is zero. In this case then the 'A' will be the travel time of the P first arrival.

February 20. 2007

February 8, 2007

January 24, 2007

timmod96 -TIMEP pfile
timmod96 -TIMES sfile

where pfile or sfile are ASCII files with a one distance – time pair per line, e.g.,

124.454140 20.464310
238.482346 35.048897
145.274033 24.015045
350.404083 48.721909

which can be created from the DIST and A (for P) sac header values through a loop

for i in *Z
do
saclhdr -NL -DIST -A >> ptime
done

This option permits plotting measured first arrivals on the same plot as the model predicted values

January 13, 2007

January 3, 2007

January 3, 2007

January 3, 2007



December 28, 2006

              triangle width 1.0
          is not the same as two commands
               boxcar width 1.0
               boxcar width 1.0
          even though this should be true by virtue of the convolution theorem.

December 15, 2006

December 12, 2006

November 8, 2006

October 18, 2006

October 14, 2006

October 1, 2006

September 16, 2006

     #!/bin/sh
#####
# generate a pulse and low pass filter it
#####
gsac << EOF
#####
# generate a pulse
#####
fg triangle delta 0.05 npts 1024
                  #        lowpass at 1 Hz
#####
lp c 1 n 2
#####
# save as the file LP.sac
#####
w LP .sac # a comment can be placed here too
quit
EOF

August 20, 2006



August 8, 2006

August 8, 2006

August 4, 2006

June 16, 2006

June 10, 2006

May 27, 2006

April 26, 2006

March 19, 2006

February 27, 2006

February 27, 2006

January 3, 2006



December 14, 2005

September 25, 2005

August 10, 2005

August 3, 2005

June 30, 2005

February 27, 2006

March 19, 2006

June 16, 2005

March 23, 2005

February 11, 2005

February 5, 2005

January 31, 2005



TO BE DONE