On startup, nq2pgm reads the configuration file named on the command line. As always, the configuraton file contains comments:
Command names must be typed in the control file exactly as shown in this document (upper/lower case matters!). nq2pgm supports one diagnostic command line option, -v is for verbose mode so that you can see packets coming in.# marks the line as a comment (example: # This is a comment).
Below are the configure commands recognized by nq2pgm, grouped by the function
they influence. Most of the commands are required.
In the following section, all configuration file commands are listed
in alphabetical order. Listed along with the command (bold-type) are
its arguments (in red), the name of the subroutine that processes the
command, and the function within the module that the command influences.
A detailed description of the command and is also given. Default values
and example commands are listed after each command description.
Here is a copy of the nq2pgm.desc file as implemented. Note that all causes of
death for nq2pgm feed through the function nq2pgm_die() which logs all causes of
death using logit() and sends a message to the statmgr utility.
1. EXAMPLE CONFIGURATION FILE
#
# nq2pgm configuration file
#
# This code receives MiniSEED records as files, calculates peak ground
# motions and spectral amplitudes by the method of Nigam and Jennings.
# Results are sent to transport ring as strong motion messages and
# an XML file is written.
#
#
ModuleId MOD_NQ2PGM # module id for this import,
RingName HYPO_RING # shared memory ring for input and output
HeartBeatInt 10 # Heartbeat interval in seconds
# this should match the nq2pgm.desc heartbeat!
LogFile 1 # If 0, don't write logfile;; if 1, do
# if 2, log to module log but not stderr/stdout
# Directory where we should put the strong motion XML files
XMLDir /home/luetgert/sendfiles/nqxmls/
# Directory where we should look for the NetQuakes miniSEED files
NQFilesInDir /home/luetgert/getfiles/netquakes/nq2pgm
StationList /home/earthworm/run/params/netquake.db1 # The file with all the station metadata.
# Debug switch: the token "Debug" (without the quotes) can be stated.
# If it is, lots of weird debug messages will be produced
Debug
2. FUNCTIONAL COMMAND LISTING
Earthworm system setup:
MyModuleId required
RingName required
RingName required
HeartbeatInt required
Output Control:
LogFile required
3. ALPHABETIC COMMAND LISTING & DESCRIPTION
command arg1 processed by function
HeartbeatInt beat HeartBeat Earthworm setup
Beat the nq2pgm heart every beat seconds.
Default: 0 - do not use logit() for LOG channels
LogFile switch GetConfig Earthworm Setup
Sets the on-off switch for writing a log file to disk. If switch
is 0, no log file will be written. If switch is 1, nq2pgm
will write a daily log file(s) called q2ewxx.log_yymmdd
where xx is nq2pgm's module id (set with "MyModuleId" command)
and yymmdd is the current UTC date (ex: 960123) on the system clock.
The file(s) will be written in the EW_LOG directory (environment
variable).
Default: none
MyModuleId mod_id GetConfig Earthworm setup
Sets the module id for labeling all outgoing messages. mod_id is
a character string (valid strings are listed in earthworm.d) that
relates (in earthworm.d) to a unique single-byte number.
Default: none
Calnet: MyModuleId MOD_nq2pgm
RingName ring GetConfig Earthworm setup
This is the ring into which the waveforms and messages are sent.
Default: none, required option
ATWC: RingName WAVE_RING
4. DESCRIPTOR FILE EXAMPLE
modName nq2pgm
modId MOD_nq2pgm
instId INST_MENLO
restartMe # restart this sucker as it is critical to data collection
#
#
# Heartbeat Specification. If the status manager does not receive
# a heartbeat message every