Changes between Version 1 and Version 2 of q2ew


Ignore:
Timestamp:
04/08/12 17:16:47 (9 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • q2ew

    v1 v2  
    1717 
    1818== Configuration File Commands == 
     19On startup, q2ew reads the configuration file named on the command line. As always, the configuraton file contains comments: 
     20 
     21#  marks the line as a comment (example: # This is a comment). 
     22    
     23Command names must be typed in the control file exactly as shown in this document (upper/lower case matters!). q2ew supports one diagnostic command line option, -v is for verbose mode so that you can see packets coming in. 
     24 
     25=== Example Configuration File === 
     26{{{ 
     27# 
     28# q2ew configuration file 
     29# 
     30# This code receives MiniSEED records from COMSERV, converts them into 
     31# Earthworm trace buf messages, and stuffs them into a wave ring. 
     32# 
     33# 
     34 ModuleId       MOD_Q2EW        # module id for this import, 
     35 RingName       WAVE_RING       # transport ring to use for input/output, 
     36 
     37 HeartbeatInt   10              # Heartbeat interval in seconds 
     38                                # this should be half the q2ew.desc heartbeat! 
     39 
     40 LogFile        1               # If 0, don't write logfile at all, 
     41 
     42 LOG2LogFile    1               #  write LOG chans to log file 
     43                                # this is useful for debugging timing or 
     44                                # data logger problems.  
     45 
     46TimeoutNoSend   5               # If no data for X seconds from COMSERV for 
     47                                # ALL stations,  then kill process (HB and 
     48                                # main thread).  
     49                                # NOTE: this timeout does not take effect until 
     50                                # a trace data packet comes from comserv. That 
     51                                # is, LOG channels do not count!  
     52                                #  
     53                                # Iff TimeoutNoSend == 0, then this data 
     54                                # check is DISABLED and q2ew will only die 
     55                                # if EW or COMSERV dies. 
     56 
     57# For ATWC, set this next config param to CSQ_LAST 
     58 ComservSeqBuf  CSQ_LAST        # This is a comserv sequence control value 
     59                                # that can have the following settings: 
     60                                # CSQ_NEXT  = Get newer than already received 
     61                                # CSQ_LAST  = Get first available data (latest) 
     62                                # CSQ_FIRST = Get all data in DAQ 
     63                                # This effects what data are returned. 
     64 
     65# These are optional for those EW users who want to have a pin number 
     66# instead of a SCNL. The keyword here is SCNL2pinmap. No duplicate checking 
     67# occurs. Note that SCNL2pinmap replaces SCN2pinmap (q2ew now supports location code) 
     68 
     69# Example 
     70#               S       C       N       L       pin 
     71SCNL2pinmap     Q003    HHZ     AT      --      1 
     72SCNL2pinmap     Q003    HHN     AT      00      2 
     73SCNL2pinmap     Q003    HHE     AT      01      3 
     74}}} 
     75 
     76 
     77=== Functional Command Listing === 
     78Below are the configure commands recognized by q2ew, grouped by the function they influence. Most of the commands are required. Only SCNL2pinmap and LOG2LogFile are optional. 
     79{{{ 
     80         Earthworm system setup: 
     81                MyModuleId              required 
     82                RingName                required 
     83                ComservSeqBuf           required 
     84                HeartbeatInt            required 
     85                TimeoutNoSend           required 
     86         
     87        Output Control: 
     88                LogFile                 required 
     89                LOG2LogFile             optional 
     90                SCNL2pinmap             optional 
     91}}} 
     92 
     93 
     94== Alphabetic Command Listing & Description === 
     95In 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. 
     96 
     97The following list is organized by: 
     98 
     99command [argument here] 
     100 
     101'''!ComservSeqBuf [csqtype]'''[[BR]] 
     102Processed by: main[[BR]] 
     103Function: Main q2ew Thread 
     104 
     105This command is used to define how q2ew gets data from COMSERV. csqtype is the name of a #define as found in COMSERV's comserv/include/service.h file. csqtype can have the following values: 
     106{{{ 
     107        CSQ_NEXT 
     108        CSQ_LAST 
     109        CSQ_FIRST 
     110 
     111CSQ_LAST is what is being used for ATWC since they are only interested in the latest available data from the digitizer or DA (digitizer=DA in Quanterras documents). CSQ_NEXT gets only the data that are newer than that already receieved by COMSERV and CSQ_FIRST gets all the data in the DA's buffer. 
     112 
     113Default:  none 
     114Example:  
     115        ComservSeqBuf CSQ_LAST 
     116}}} 
     117 
     118'''!HeartbeatInt [beat]'''[[BR]] 
     119Processed by: !HeartBeat[[BR]] 
     120Function: Earthworm setup 
     121 
     122Beat the q2ew heart every beat seconds. This is implemented as a separate thread in q2ew. 
     123 
     124'''LOG2LogFile [switch]'''[[BR]] 
     125Processed by: logLOGchans[[BR]] 
     126Function: Main q2ew Thread 
     127 
     128Sets the on-off switch for writing Quanterra LOG channels to the !LogFile. If switch is 0, no LOG channels will be written to the log. If switch is 1, q2ew will write all LOG channels to the !LogFile. Turning this on will automatically turn on writing of a !LogFile. 
     129{{{ 
     130Default:  0 - do not use logit() for LOG channels 
     131}}} 
     132 
     133'''!LogFile [switch]'''[[BR]] 
     134Processed by: !GetConfig[[BR]] 
     135Function: Earthworm Setup 
     136 
     137Sets 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, q2ew will write a daily log file(s) called q2ewxx.log_yymmdd where xx is q2ew'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). 
     138{{{ 
     139Default:  none 
     140}}} 
     141 
     142'''!MyModuleId [mod_id]'''[[BR]] 
     143Processed by: !GetConfig[[BR]] 
     144Function: Earthworm setup 
     145 
     146Sets 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. 
     147{{{ 
     148Default:  none                           
     149Calnet:   MyModuleId MOD_Q2EW 
     150}}} 
     151 
     152'''!RingName [ring]'''[[BR]] 
     153Processed by: !GetConfig[[BR]] 
     154Function: Earthworm setup 
     155 
     156This is the ring into which the waveforms and messages are sent. 
     157{{{ 
     158Default:  none, required option                          
     159ATWC:   RingName WAVE_RING 
     160}}} 
     161 
     162'''SCNL2pinmap [S C N L pin]'''[[BR]] 
     163Processed by: insertSCNL[[BR]] 
     164Function: Main q2ew Thread 
     165 
     166This command is used to define how q2ew maps a Station Channel Name to a pin number for those installations who wish to define pins....This is a throwback to old digitizers and is not recommended since Quanterra digitizers can properly be configured to know SCNL information. Data from S C N L is compared to the SEED header of the waveform packets coming off the DA and the pin number is substituted into the tracebuf struct passed to Earthworm. S is for station name, C is for channel identifier, and N is for network code. Note that station, channel, and network names in Quanterra follow the SEED convention and can be 5, 3, and 2 chars in length respectively. 
     167{{{ 
     168Default:  none, optional command 
     169SCNL2pinmap     Q003 HHZ AT --  1 
     170SCNL2pinmap     Q003 HLN AT --  2 
     171SCNL2pinmap     Q003 HLE AT --  3 
     172}}} 
     173 
     174'''!TimeoutNoSend [timeout]'''[[BR]] 
     175Processed by: !HeartBeat[[BR]] 
     176Function: Earthworm setup 
     177 
     178If no waveform packets come from the DA after timeout seconds, the q2ew module will notify statmgr and die. If timeout is set to 0, then the q2ew module will never check for this timeout. If set to 0, q2ew will only die if COMSERV dies, or if the Earthworm system calls for its termination. This timeout begins once the first Waveform packet is received from ANY DA served by COMSERV. It is not specific to any one DA. 
     179{{{ 
     180Default:  none, required option                          
     181ATWC:   TimeoutNoSend 0 
     182}}} 
     183 
     184 
     185=== Descriptor File Example === 
     186Here is a copy of the q2ew.desc file as implemented. Note that all causes of death for q2ew feed through the function q2ew_die() which logs all causes of death using logit() and sends a message to the statmgr utility. 
     187{{{ 
     188modName  q2ew 
     189modId    MOD_Q2EW 
     190instId   INST_ATWC 
     191 
     192restartMe       # restart this sucker as it is critical to data collection 
     193# 
     194# 
     195#    Heartbeat Specification.  If the status manager does not receive 
     196#    a heartbeat message every  seconds from this module, an 
     197#    error will be reported (client module dead).   is the maximum 
     198#    number of pager messages that will be reported and  is the 
     199#    maximum number of email messages that will be reported.  If the 
     200#    page or mail limit is exceeded, no further errors will be reported 
     201#    until the status manager is restarted. 
     202# 
     203tsec: 20  page: 0  mail: 99 
     204 
     205# these are the statmgr messages that q2ew will send before dieing 
     206# 
     207err: 0  nerr: 1  tsec: 0  page: 5  mail: 20 
     208text: "COMSERV has a problem and died" 
     209# 
     210err: 1  nerr: 1  tsec: 0  page: 5  mail: 20 
     211text: "COMSERV Recv NO DATA TIMEOUT and died" 
     212# 
     213err: 2  nerr: 1  tsec: 0  page: 5  mail: 20 
     214text: "SIGNAL caused q2ew to die" 
     215# 
     216err: 3  nerr: 1  tsec: 0  page: 5  mail: 20 
     217text: "EW tport_putmsg() failed, q2ew dead" 
     218# 
     219err: 4  nerr: 1  tsec: 0  page: 5  mail: 20 
     220text: "EW TERMINATE recv'd, q2ew dead" 
     221# 
     222err: 5  nerr: 1  tsec: 0  page: 5  mail: 20 
     223text: "EW config problems on startup, q2ew dead" 
     224# 
     225# BELOW: WARNINGS, NOT FATAL YET  
     226err: 6  nerr: 1  tsec: 0  page: 5  mail: 20 
     227text: "qlib2 decompression errors" 
     228# 
     229}}} 
    19230 
    20231 
     
    23234 
    24235 
    25 The following list is organized by: 
    26  
    27 command [argument here]