sac2seg

NAME
SYNOPSIS
DESCRIPTION
FILES
SEE ALSO
BUGS
COPYRIGHT
AUTHOR

NAME

sac2seg - Converts a SAC file to BSEGY format, ASCII, and Gnuplot

SYNOPSIS

sac2seg [ -h | infile]

DESCRIPTION

Basic Seismic Utilities (BSU) reads a SAC file format (see https://www.iris.edu) from a file with one recording. SAC files have more detailed headers and differ from MiniSeed in that they contain a single recording. The single trace is then output as a BSEGY file. Due to the number of sample limitation in the BSEGY header (at most 65535 samples) longer traces are broken up into a sequence of traces and stored in the BSEGY file making it look like a multi-trace file. The first trace starts at the origin time, and each additional trace simply continues in time with the last trace ending at the latest recorded time, subject to a requirement that all traces be the same size. A search is made for the largest trace length with the smallest remainder. The smaller the remainder, the less data will be dropped at the end.

In addition, all the data are output as an ASCII file ending in *.dat. This permits one to import into MATLAB or OCTAVE as an alternative to BSEGY. Further, a GNUPLOT script is generated to read the *.dat file and generate a plot of the entire signal.

This code breaks with the other BSU codes in that it allows long file names for the input parameter, infile. C-language version .

Options

-h

Online help giving details on command line arguments

infile

Input file name (must be greater than or equal to 4 char, 131 char maximum).

NOTE:
If invoked with no options, will prompt user for input parameters.

EXAMPLE:
sac2seg IU.COR.60.BHZ.M.2020.091.235256.SAC

Converts SAC data from Corvalis Oregon station, vertical component, network IU, location 60, 40 samples per second. SAC files differ from MiniSeed in that they are not an archive, but are specific to a single station, channel, network, and location (and in this instance, that is apparent in the file name).

FILES

standard output

produces a progress bar

CORBHZ.lst

Name convention is unusual for BSU. First 3 to 4 characters are the station. Next 3 characters are the channel. Suffix is type of file (see examples below for above example). The *.lst file is a check of input parameters and header data available.

CORBHZ.seg

The BSEGY formatted file.

CORBHZ.dat

ASCII file with entire data in trace. There are two columns, (sample time, data value).

CORBHZ.gp

Gnuplot script to plot the entire signal. Produces a Postscript output by default. To view with persistence in X11, use -p option. Example

gnuplot -p CORBHZ.gp

The title will show Station, Channel, time of day for first sample, and date mm/day/yr.

SEE ALSO

bhelp(1), gnuplot(1), mseed2seg(1)

BUGS

No known bugs.

COPYRIGHT

Copyright © 2022 by Paul Michaels

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

AUTHOR

P. Michaels, PE. <paulmichaels@boisestate.edu>