Project

General

Profile

Dump details from SAC formatted files

(man page 2011/03/22)

Synopsis

sacdump [options] file1 [file2 file3 ...]

Description

sacdump prints header values and data samples for files in SAC format. By default the format of the input files is automatically detected: alpha or binary (byte order autodetected). The format can also be specified with the -f option. If an input file name is prefixed with an '@' character the file is assumed to contain a list of input data files, see LIST FILES below.

Options

-V

Print program version and exit.

-h

Print program usage and exit.

-v

Be more verbose. This flag can be used multiple times ("-v -v" or "-vv") for more verbosity.

-p header

Print header variable. This option may be used multiple times to print many header variables on the same line. The header variables are printed in the same order specified.

-a

Print a list of all defined header variables.

-b

Print bare output, without file name and data sample header. By default the file name is printed before all requested output and the data samples are prefixed with an identifying line.

-d

Print the first 20 sample values as time-value pairs.

-D

Print all sample values as time-value pairs.

-tf format

Specify the time stamp format for sample value lists. The format can be one of the following (default = 0):

  0 = SEED time, e.g. "2005,068,00:00:01.000000" 
  1 = ISO time, e.g. "2005-03-09T00:00:01.000000" 
  2 = Epoch seconds, e.g. "1110326401.000000" 

-s

Print basic statistics for the sample values, these include: minimum, maximum, mean, standard deviation and RMS.

-m metafile

For each input SAC file write a one-line summary of channel metadata metafile. The one-line summary is a comma-separated list containing: network, station, location, channel, latitude, longitude, elevation, depth, azimuth, incidence, instrument name, scale factor, sampling rate and start and end times. In SAC the component azimuth is in degrees clockwise from north, the component incident angle is in degrees from vertical and the elevation and depth are both in meters.

-s factor

When writing data to an integer (Mini-SEED) encoding format apply this scaling factor to each input floating point data sample before truncating to an integer. By default autoscaling is used and a scaling factor is determined that will scale the maximum sample value to a minimum of 6 digits. If none of the input sample values include fractional components the scaling factor will be 1 and the floating point data will simply be truncated to their integer components.

-f format

By default the format of each input file is autodetected, either alpha or binary (little or big endian byte order autodetected as well). This option forces the format for every input file:

0 : Autodetect SAC format (default)
1 : Alphanumeric SAC format
2 : Binary SAC format, autodetect byte order
3 : Binary SAC format, little-endian
4 : Binary SAC format, big-endian

List Files

If an input file is prefixed with an '@' character the file is assumed to contain a list of file for input. Multiple list files can be combined with multiple input files on the command line. The last, space separated field on each line is assumed to be the file name to be read.

An example of a simple text list:

TA.ELFS..LHE.SAC
TA.ELFS..LHN.SAC
TA.ELFS..LHZ.SAC

Examples

Printing the network, station, khole (location) and channel:

$ sacdump -p KNETWK -p KSTNM -p KHOLE -p KCMPNM TA.ELFS..LHZ.SAC
TA.ELFS..LHZ.SAC:
TA  ELFS    LHZ

Printing all defined variables with the first 20 samples:

$ sacdump -a -d TA.ELFS..LHZ.SAC
TA.ELFS..LHZ.SAC:
    DELTA = 1
        B = 0
        E = 2282
   KZDATE = MAY 03 (123), 2006
   KZTIME = 15:36:19.069
    NVHDR = 6
     NPTS = 2283
   IFTYPE = 1
    LEVEN = 1
    KSTNM = ELFS
    KHOLE =
   KCMPNM = LHZ
   KNETWK = TA
Data samples:
2006,123,15:36:19.069000  -180
2006,123,15:36:20.069000  -87
2006,123,15:36:21.069000  150
2006,123,15:36:22.069000  191
2006,123,15:36:23.069000  -110
2006,123,15:36:24.069000  -293
2006,123,15:36:25.069000  69
2006,123,15:36:26.069000  181
2006,123,15:36:27.069000  -82
2006,123,15:36:28.069000  -157
2006,123,15:36:29.069000  -19
2006,123,15:36:30.069000  131
2006,123,15:36:31.069000  16
2006,123,15:36:32.069000  -112
2006,123,15:36:33.069000  -28
2006,123,15:36:34.069000  1
2006,123,15:36:35.069000  -57
2006,123,15:36:36.069000  27
2006,123,15:36:37.069000  90
2006,123,15:36:38.069000  -169

About Sac

Seismic Analysis Code (SAC) is a general purpose interactive program designed for the study of sequential signals, especially timeseries data. Originally developed at the Lawrence Livermore National Laboratory the SAC software package is also available from IRIS.

Author

Chad Trabant
IRIS Data Management Center