Search:
wiki:waveman2disk
Last modified 19 months ago Last modified on 02/27/12 17:44:36

# Earthworm Module: waveman2disk

Contributed by:

## Function

Manual, interactive program to save trace data from Earthworm Wave_servers to disk.

## Details

waveman2disk is a manual, interactive version of trig2disk. Its purpose is to save trace data to disk in variuos supported formats - currently ah_xdr, sac, pc-suds, seisan, gse, wfdisc, and tankplayer. Like any good earthworm program, it has a configuration file waveman2disk.d allowing for extensive configuration. This is where we tell it, among other things, which waveservers to interrogate, where and it which format to store the trace output,

waveman2disk works in two modes:

(1) Interactive: the config file lists the output format and directory, as well as the channels to save. The user is prompted for the start and end time of trace data to be saved.

(2) Trigger-saving: a file, specified in the config file, contains ascii text of one or more TYPE_TRIGLIST2K messages. These are processed one at a time, and the trace data of the channels listed in the TRIGLIST2K message, are saved to disk.

Note on output formats:

The trig2disk module has been extensively re-packaged to allow for easier addition and modification of output formats. Basically, all functionality dealing with producing output on disk has been moved into libsrc/util. The putaway.c file contains entry points into the trace writing system. This is where any new output format should be added. Associated with it are files like sacputaway.c, sudsputaway.c and ahputaway.c that actually implement the writing of various output formats to disk.

PSN4 format was added for windows in Earthworm 7.1 (contact www.webtronics.com for details).

MSEED format was added for solaris in Earthworm 7.1.

WFDISC format was added for Linux in Earthworm 7.4.
wfdisc format can take advantage of a wfdisc params config file which must be located at "EW_PARAMS/wfdisc_waveman.d" where EW_PARAMS is the EW_PARAMS env variable. The content of this file is very specific and allows one to specify station/channel specific information on chanid, calib, calper, instype and segtype, as well alternative locations for .w datafiles and wfdisc consolidation rules. See the command document for file syntax and formatting

### EXAMPLE CONFIGURATION FILE

    # Configuration file for waveman2disk:
    #
    # If you wish to write PC-SUDS files suitable for viewing with
    # sudsplot you will need to run waveman2disk on a Windows 2000 machine AND
    # with all earthworm modules compiled with the /Zp1 flag (accomplished
    # by adding /Zp1 to %EW_HOME%\%EW_VERSION%\environment\tools.ini file)
    #   (Lucky Vidmar Mon Mar 15 12:04:59 MST 1999)
    #
    #

    LogFile 		1		# 0 means don't create a disc log file. 1=> do.

    #
    # Debug switch: the token "Debug" (without the quotes) can be stated.
    # If it is, lots of weird debug messages will be produced
    #Debug

    #
    # Data input method:
    #  triglist - read the file specified by TrigFile option, and
    #             process the TYPE_TRIGLIST2K messages in there
    #
    #  interactive - specify one of more SaveSCNL entries in this file
    #                 or an external file included with @. Then, the
    #                 user is prompted for start and end time of trace
    #                 snippets to be saved
    #
    #InputMethod triglist
    InputMethod interactive

    #
    # TrigFile - name of the file containing TYPE_TRIGLIST2K msgs
    #  required only if InputMethod is triglist.
    #
    TrigFile /home/lucky/working/src/waveman2disk/trigmsg

    #
    # SaveSCNL - List SCNLs to save in the interactive mode. The user
    #           will specify start and end time
    #  required only if InputMethod is interactive.
    #
    #SaveSCNL * EHZ MB *
    SaveSCNL LYMT EHZ MB --
    SaveSCNL CHMT EHZ MB 10
    SaveSCNL LRM EHZ MB 01

    #
    # OPTIONAL - specify StartTime and Duration for the interactive
    #   trace request. If these are not specified, waveman2disk will
    #   prompt the user for them.
    #   StartTime Format: yyyymmddhhmmss
    #

    StartTime 19990804140000
    Duration  60

    # Setup for WaveServers we'll interrogate:
    # list of ip addresses and ports of the  WaveServers we're to use
    WaveServer aaa.bbb.ccc.ddd 16022

    # If a WaveServer doesn't talk to us in this
    # many seconds, we'll abort that request
    #
    # NOTE: If you are requesting large blocks of time, e.g
    #  in the tank mode, you will want to set this value to
    #  something quite high - longer than the time interval
    #  requested.
    #

    #TimeoutSeconds 30
    TimeoutSeconds 500

    # Sizes of trace memory. Determines how much memory we'll try to grab
    # Max number of traces we'll ever see in one event
    MaxTraces 100

    # largest trace snippet we'll ever have to deal with
    # in bytes/1000.
    # NOTE: if you intend to produce PC-SUDS files for viewing
    # with sudsplot viewer, you will want to keep this number
    # low (around 1000) because of sudsplot's memory limitations
    TraceBufferLen 1000

    #
    # number of sample periods to declare a gap
    #
    GapThresh 20

    #
    # SCNL list of stations to write for each trigger message,  these get
    #      written in addition to scn's in the trigger message, or
    #      those listed in SaveSCN section
    # This is OPTIONAL and only meaningful in triglist mode
    #
    TrigStation GCMT EHZ MB --
    TrigStation BZMT EHZ MB *
    #
    # Minimum length duration (in integer seconds) for stations in StationFile
    #
    MinDuration 60
    #
    # format of data output (sac, ah, suds, seisan, gse, and tank are currently supported)
    #
    # output base directory for trigger files
    #       subdirectory is made in this directory
    #
    # SUDS
    #
    #DataFormat                  suds
    #OutDir                      "/home/earthworm/SUDS"
    #
    # SAC
    #
    DataFormat                   sac
    OutDir                       "c:\earthworm\SAC"
    #
    # AH
    #
    #DataFormat                  ah
    #OutDir                     "/home/earthworm/AH"
    #
    # SEISAN
    #
    #DataFormat                  seisan
    #OutDir                     "/home/earthworm/seisan"
    #
    # GSE
    #
    #DataFormat                  gse_int
    #OutDir                     "/home/earthworm/gse_int"
    #
    # Tankplayer
    #
    #DataFormat                 tank
    #OutDir                     "./tanks/"
    #
    #
    # Mini-SEED
    # Mini-SEED output format is currently only available on Solaris
    #
    #DataFormat                 mseed
    #OutDir                     "/earthworm/data/mseed"# PSN4
    #
    # NOTE PSN4 output format is only avialable for WINDOWS!
    #  a station.lst file must also exist in the EW_PARAMS directory too (see example in docs)
    #
    #DataFormat                 psn4
    #OutDir                     "c:\earthworm\psn4"

    #
    # WFDISC
    #
    # NOTE WFDISC output format is only avialable for Linux!
    #DataFormat                 wfdisc
    #OutDir                     "/home/earthworm/wfdisc_ouput"

    # Specify on what platform the output files will be used:
    # intel or sparc - with this information, files will be written out
    # in the correct byte order.
    OutputFormat sparc

### EXAMPLE wfdisc_waveman.d CONFIGURATION FILE

This file must be located in the EW_PARAMS directory to be used.

    #w_location directory
    #Allows you to specify a different directory than the wfdisc saved directory
    #You can specify a relative or absolute path here
    w_location ./w
    #calib station channel chanid calib calper instype segtype
    calib I59H1  BDF              1         1.000000         1.000000 Geotec   d
    calib I59H1  LWS              2         1.000000         1.000000 Geotec   d
    calib I59H1  LWD              3         1.000000         1.000000 Geotec   d
    calib I59H1  LKO              4         1.000000         1.000000 Geotec   d
    calib I59H2  BDF              5         1.000000         1.000000 Geotec   d
    calib I59H3  BDF              6         1.000000         1.000000 Geotec   d
    calib I59H4  BDF              7         1.000000         1.000000 Geotec   d
    #wfdisc_spec output_dir station channel
    #These commands are processed in the order written
    #So if a more general line is above a more specific line,
    #The more specific line will have no effect.
    #For wildcard use the * symbol
    #output_dir can be no longer than 8 characters long
    #wfdisc_spec test I59H1 *
    #wfdisc_spec test2 * *

## Helpful Hints

### Download in other formats:

- Plain Text