SAC2MSEED(1)

✨ sac2mseed β€” the SAC ➑️ miniSEED glow-up ✨

okay bestie, gather round πŸ’– this is sac2mseed(1), a General Commands Manual page, and it's literally the tool that takes your SAC waveform data and turns it into miniSEED format. slay. let's get into it 🫢


🌸 NAME 🌸

sac2mseed β€” the SAC to miniSEED converter, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

sac2mseed [options] file1 [file2 file3 ...]

πŸŽ€ DESCRIPTION πŸŽ€

so sac2mseed converts SAC waveform data into miniSEED format. that's the whole vibe ✨

By default, the format of the input files is automatically detected: alpha or binary (and yes, byte order is autodetected too, she's thorough like that πŸ’β€β™€οΈ). If you wanna force it instead of letting her figure it out, that's what the -f option is for.

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 down below, bestie πŸ‘‡

If the input file name ends in .sac (not case sensitive, she's not picky), the default output file name will be the same name with the extension replaced by .mseed. And if you'd rather send the output data somewhere else entirely, you can re-direct it to a single file or to stdout using the -o option. options, we love her πŸ’–


✨ OPTIONS ✨

  • -V β€” Print program version and exit. quick lil drive-by, love that for her πŸ’…
  • -h β€” Print program usage and exit.
  • -v β€” Be more verbose. and bestie, you can stack this one β€” use it multiple times (-v -v or -vv) for even more verbosity. the way that scales 😭πŸ”₯
  • -S β€” Include SEED blockette 100 in each output record with the sample rate in floating point format. so here's the tea: the basic format for storing sample rates in SEED data records is a rational approximation (numerator/denominator), which means precision will be lost if a given sample rate can't be well approximated 😬 This option should be used in those cases.
  • -n netcode β€” Specify the SEED network code to use. If not specified, the network code will be the value of the KNETWK variable in the SAC header, and if KNETWK is not specified, the network code will be blank. ngl it is highly recommended to specify a network code if no network is defined in the SAC file πŸ‘‘
  • -s stacode β€” Specify the SEED station code to use. If not specified, the station code will be the value of the KSTNM variable in the SAC header, and if KSTNM is not specified, the location ID will be blank. (yes she said location ID, we're just relaying the message πŸ’€)
  • -l locid β€” Specify the SEED location ID to use. If not specified, the location ID will be the value of the KHOLE variable in the SAC header, and if KHOLE is not specified, the location ID will be blank.
  • -c chancodes β€” Specify the SEED channel codes to use. If not specified, the channel code will be the value of the KCMPNM variable in the SAC header, and if KCMPNM is not specified, the location ID will be blank. As a special case, a dot (.) will be interpreted as the same character as the input channel name β€” for example, "L.." can be specified to only replace the first code with 'L' and leave the other two codes as they are. cute little wildcard moment πŸŽ€
  • -r bytes β€” Specify the miniSEED record length in bytes, default is 4096.
  • -e encoding β€” Specify the miniSEED data encoding format, default is 11 (Steim-2 compression). Other supported encoding formats include 10 (Steim-1 compression), 1 (16-bit integers) and 3 (32-bit integers). > heads up bestie: the 16-bit integers encoding should only be used if all data samples can be represented in 16 bits 🚨
  • -b byteorder β€” Specify the miniSEED byte order, default is 1 (big-endian or most significant byte first). The other option is 0 (little-endian or least significant byte first). It is highly recommended to always create big-endian SEED. periodt πŸ’…
  • -o outfile β€” Write all miniSEED records to outfile. If outfile is a single dash (-) then all miniSEED output will go to stdout. All diagnostic output from the program is written to stderr and should never get mixed with data going to stdout β€” she keeps her data and her chit-chat in separate rooms, as she should ✨
  • -m metafile β€” For each input SAC file write a one-line summary of channel metadata to metafile. That 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. so much lore in one line 🫢
  • -me β€” When writing out a metadata file, include the event name (kevnm) and user strings 0, 1 and 2 (kuser0, kuser1 and kuser2).
  • -s factor β€” When writing data to an integer (miniSEED) 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. math girlie behavior 🧚
  • -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

πŸ’œ SEED LOCATION IDS πŸ’œ

The contents of the SAC header variable KHOLE is used as the SEED location ID if it is set. And okay, technically the definition of KHOLE and the SEED location ID are not officially the same, but this is a known convention when converting between these two formats. iykyk πŸ’…


🌈 LIST FILES 🌈

If an input file is prefixed with an @ character, the file is assumed to contain a list of files 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. okay so the last field is the one that matters, don't get it twisted ✨

An example of a simple text list:

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

look at that lil trio, iconic πŸ₯Ή


πŸ‘‘ 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. history lesson and she ate πŸ’–


πŸ“ AUTHOR πŸ“

Chad Trabant IRIS Data Management Center


and that's the whole page bestie!! πŸ’– this came from the SAC2MSEED(1) manual page, dated 2017/04/03, from the source General Commands Manual β€” go forth and convert your SAC to miniSEED, you absolute main character πŸ¦‹βœ¨πŸ’