Software Library‎ > ‎

Seismic Handler to Sac converter (sh2sac)

This is my conversion program from Seismic Handler Q files to SAC (seismic analysis code) binary format. We can handle most of the headers values. The addiction of other headers fields is straight forward since the program is quite modular and written on plain C. It doesn't depend on any library others than the standard C library.


 Version  Date  
 0.1  19/02/2008 tar.gz
 0.2  27/01/2009 tar.gz
 0.3  18/02/2009 tar.gz
 0.5  20/02/2009 tar.gz
 0.5.2 09/08/2010tar.gz
 0.5.3 25/07/2011 tar.gz


The instalation is pretty straight forward. Unpack, [edit the makefile for setting the install dir,] make, make install. In steps:
tar xvzf sh2sac-0.5.tar.gz
[n,g,k]edit Makefile
make install

Usage Instructions:

The usage will depend on what you want. Since one seismic handler file can have many traces and the sac file format can handle only one trace per file we generate the names of the output SAC files automatically in two different modes. The first mode, we just use the trace start time and station name, and in the second mode, we try to generate the names by the event time and information contained in the seismic handler header.

The easy way:

sh2sac -h FILE.QHD -b FILE.QBN
and if you have seismic handler instaled and configured

sh2sac -h FILE.QHD -b FILE.QBN -stash
to show some help on usage just type in sh2sac, without any options to get the usage help. It also explain about the modes and ways to get the station coordinate into the final SAC file.

If you have questions about the usage of this software you can fell free to ask me directly or just, post a message to the seismic handler users list.

Revision History:

0.5.2 (09/08/2010)
 * [mbianchi] Minor correction on messages on the screen. "." removed from
   the name of the output file on debug mode. Added \n for messagem in
   generate name methods.
   Fix Email on INSTALL/README file.

0.5.1 (19/05/2009)
 * [mbianchi] Minor correction on the help text.

0.5 ?
  * [mbianchi] Major correction in the time strings.

0.4 (20/02/2009):
  * [mbianchi] Added a new separator type "," as described in timeconv.c SH
    source code. The formats are not so clear, so I assume that the order of
    variables doesn't change. I assume: DD?MM?YYYY?HH?MM?SS?MMM where ? can
    be one of: -_,.: and MM represents the months in names (JAN,FEV,MAR,ABR,
    MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC) or number (1 to 12). The mmm represents
    the decimals seconds (miliseconds).

    It doesn't get very clear for me if the order of the variables fields
    changes, as I look at the source code it looks like, but will not try to
    real understand this little bug format.

0.3 (18/02/2009):
  * [mbianchi] Fixed a serious bug in time parsing from seismic handler time
    string. The time string now parsed by the -/_/:/. characters instead of
    a fixed width.

0.2 (27/01/2009):
  * [mbianchi] Fixed bug in sac filename generation (parses.c) that created
    a filename with spaces that is illegible to sac program.

0.1 (19/02/2008):
  * [mbianchi] Fixed aleatory segfault bug on get_next_trace
  * [mbianchi] Added -o option that will force overwrite of existing sac files
  * [mbianchi] Created RELNOTES, version defined inside sh2sac.c and exported
  inside sh2sac.c