Conversion of KISR Seisan files to Sac

Introduction

The purpose of this document is to show how to convert Seisan files to a sac format for analysis by other programs.
To convert Seisan files to sac, the FORTRAN code of the seisan distribution is not used. Instead I have written a program completely in C, since it is easier to handle the byte-swapping in that language.  The seisan file consists of unformatted sequential IO in FORTRAN.  Many lines are in ASCII and present no problem in reading the file on different machines.  However, the waveform data are given as 2-byte or 4-byte integers, and must be swapped when moving the traces between big-endian (e.g., SPARC, powerPC, Motorola) and little-endian (Intel) architectures.  Although it seems as if the wavefrorm data are created on Intel machines,  there is always the possibility that they are created on big-endian machines.  The C-codes worries about both the architecture of the machine being used as well as the byte-order in the data itself.

KISR Test Case

1. Download the file kisr.tgz.

2. Unpack the contents by using the command
         gunzip -c kisr.tgz | tar xvf -
    This will create the following directory structure:

KISR
|-- 00README
|-- MAKENEW
|-- PROTO.KW
| |-- DOMAKESAC
| |-- IDODEC
| |-- IDODIST
| |-- IDOEVT
| |-- IDOGCARC
| |-- IDOQC
| |-- IDOQCTEL
| |-- IDOROT
| `-- KWDOEVT
|-- Response
| |-- kisr_bh.pz
| `-- kisr_sh.pz
|-- SEISAN_FILES
| |-- 2007-02-12-1830-30S.KSN___018
| |-- 2007-02-28-0940-38S.KSN___021
| |-- 2007-05-17-0916-53S.KSN___015
| |-- 2008-01-28-0427-01S.KSN___015
| |-- 2008-02-15-0203-37S.KSN___015
| |-- 2008-07-28-0901-29S.KSN___012
| `-- 2008-09-10-1101-29S.KSN___003
`-- bin
|-- Makefile
|-- Makefile.LNX
|-- Makefile.SOL
|-- sacsubc.c
|-- sacsubc.h
`-- seisac.c
In the listing the blue color indicates a directory, a red color indicates an executablem and the black color indicates ordinary files.

3. Compile to make the program seisac
       cd KISR/bin
       If you are on a SPARC computer,
             cp Makefile.SOL Makefile
       if you are on an Intel computer (LINUX or Cygwin)
             cp Makefile.LNX Makefile

       make all

       You will then find an executable seisac in the bin directory.

4. The distribution contains several Seisan traces files from KISR. To unpack them, do the following from within the KISR main directory:

     MAKENEW SEISAN_FILES/2007-02-28-0940-38S.KSN___021

     This will create a directory 2007-02-28-0940-38S.KSN___021.dir  with the following

2007-02-28-0940-38S.KSN___021.dir/
|-- DOMAKESAC
|-- IDODEC
|-- IDODIST
|-- IDOEVT
|-- IDOGCARC
|-- IDOQC
|-- IDOQCTEL
|-- IDOROT
|-- KWDOEVT
|-- Orig
| |-- 2007-02-28-0940-38S.KSN___021
| |-- KB11.BHZ.sac
| |-- KB12.BHN.sac
| |-- KB13.BHE.sac
| |-- MI11.SHZ.sac
| |-- MI12.SHN.sac
| |-- MI13.SHE.sac
| |-- NA11.SHZ.sac
| |-- NA12.SHN.sac
| |-- NA13.SHE.sac
| |-- QR11.SHZ.sac
| |-- QR12.SHN.sac
| |-- QR13.SHE.sac
| |-- RD11.SHZ.sac
| |-- RD12.SHN.sac
| |-- RD13.SHE.sac
| |-- RS11.SHZ.sac
| |-- RS12.SHN.sac
| |-- RS13.SHE.sac
| |-- UM11.SHZ.sac
| |-- UM12.SHN.sac
| `-- UM13.SHE.sac
`-- Sac
|-- KBDKWBHE.SAC
|-- KBDKWBHN.SAC
|-- KBDKWBHZ.SAC
|-- MIBKWSHE.SAC
|-- MIBKWSHN.SAC
|-- MIBKWSHZ.SAC
|-- NAYKWSHE.SAC
|-- NAYKWSHN.SAC
|-- NAYKWSHZ.SAC
|-- QRNKWSHE.SAC
|-- QRNKWSHN.SAC
|-- QRNKWSHZ.SAC
|-- RDFKWSHE.SAC
|-- RDFKWSHN.SAC
|-- RDFKWSHZ.SAC
|-- RSTKWSHE.SAC
|-- RSTKWSHN.SAC
|-- RSTKWSHZ.SAC
|-- UMRKWSHE.SAC
|-- UMRKWSHN.SAC
|-- UMRKWSHZ.SAC
|-- kisr_bh.pz
`-- kisr_sh.pz

The organization here is that the SEISAN file is placed in the Orig subdirectory, the traces are extraced and put into a sac file format using the seisac program compiled above, and finally the sac files are renamed and have had the station latitude, longitude and elevation placed into the sac headers and these files are now in the Sac directory, e.g., NAYKWSHZ.SAC.

The output screen output of the script MAKENEW for this waveform set is

Edit the KWDOEVT file to add the information about the earthquake.
Next enter the following commands in exact order:

KWDOEVT
IDOROT

The rotated 3-component ground velocities will be in 2007-02-28-0940-38S.KSN___021.dir/FINAL

These indicate the next steps. 

Edit the KWDOEVT and modify the lines giving the epicenter origin time and coordinates.
Run the KWDOEVT which will place files in the GOOD directory, which it creates.
Run the script IDOROT which rotates the ground velocity traces in m/s to Z, R and T and places the traces in the FINAL directory.

Evaluation of the KISR Network

For each of the  Seisan files provided for the KISR event,  I used the location/phase information  from the KISR Antelope system to set the  location parameters in the KWDOEVT file in the   seisan_file.dir   directory created by the script.  I  next ran the IDOROT script to roate the traces to Z R and T.  Finally I created  a map using gsac and displayed the traces using gsac, with the 'ylim all' command to be able to compare amplitudes.

In the specific examples given below, only the initial lines of the KWDOEVT differ from event to event. The differences are in the specific event coordinates.

The deconvolution uses the pole-zero files kisr_bh.bz and kisr_sh.pz taht provide the transfer function from gound displacement in nanometers to digital counts.

2007-02-12-1830-30S.KSN___018

Station - location map
Waveform comparison
KWDOEVT for this event

This event in Iran was well recorded by the network. The trace display presents the broadband velocity in meters/sec. The plot shows all traces at the same scale. The similarity of amplitudes indicates that the gains of all instruments are known at least in a relative sense. A test of the absolute calibration would require a well recorded teleseism.

2007-02-28-0940-38S.KSN___021

Station - location map
Waveform comparison
KWDOEVT for this event

this is a teleseism from New Guinea. The waveform comparison is dominated by low frequency noise on several stations.  However if we focus on only the vertical components of the teleseismic P wave, and filter using the sac/gsac commands 'hp c 0.25 n 3' and 'lp c 1 n 3'  the maximum trace amplitudes are


DEPMAX 6.589585e-07 KSTNM KBD

DEPMAX 7.451779e-07 KSTNM MIB

DEPMAX 6.851945e-07 KSTNM NAY

DEPMAX 7.587316e-07 KSTNM QRN

DEPMAX 5.15693e-07 KSTNM RDF

DEPMAX 1.181471e-06 KSTNM RST

DEPMAX 5.898481e-07 KSTNM UMR
which indicates an amplitude variation from smallest to largest fo a factor of 2, which may be due to local site effects., or perhaps absolute calibration. The plot of the filtered trace is (Filtered vertical ground velocity)

2007-05-17-0916-53S.KSN___015

Station - location map
Waveform comparison
KWDOEVT for this event

The amplitudes are in agreement for this event.

2008-01-28-0427-01S.KSN___015

Station - location map
Waveform comparison
KWDOEVT for this event

This event occurred near the southern oilfields.  The broadband station KDB has very large amplitudes espeically on the north-south component

2008-02-15-0203-37S.KSN___015

Station - location map
Waveform comparison
KWDOEVT for this event

For some reason the epicenter did not plot at 29N 47.5E on my plot. The KDB N-S is again very large

2008-07-28-0901-29S.KSN___012

Station - location map
Waveform comparison
KWDOEVT for this event

The KDB N-S is again large.

2008-09-10-1101-29S.KSN___003

Station - location map
Waveform comparison
KWDOEVT for this event

This is a recording of a large earthquake in Iran.  The amplitudes of the different components are

GOOD/KBDBHE.KW..sac (0):
DEPMAX 0.0001050675
GOOD/KBDBHN.KW..sac (1):
DEPMAX 0.007570861
GOOD/KBDBHZ.KW..sac (2):
DEPMAX 3.330675e-05
we see that the maximum amplitude on the NS component is 75 times larger than that on the E-W component. Since the back azimuth to the event is approximately 135 degrees, I would expect the amplitude on the Ns and EW components to be very similar, and they are not.

Summary

For some reason the sensitivity of the broadband station changes some time after May 17, 2007.  The exact date and the reason for the change in gain must be determined.

For 2007 the relative gains for the stations seem to be correct.

I would like to see a good telesiesmic signal for an earthquake in 2007 recorded by all stations.