Event Waveform Archiving

After the AQMS RT system has detected and located an earthquake, we need to collect waveforms for the relevant SNCLs to make them available for human event review. As explained in Real-Time Processing Systems in the NCSS, request cards are generated on the active RT system. The request card generators are the programs that decide which SNCLs should be collected and for what time periods. The requests are written to the request_card table on local RT database. From there the request_card table is replicated to each of the “data center” or “archive” databases.

The basic information in a request card is: event ID, station, network, channel, location (SNCL), start and end time, request ID, retry count, date of last retry.

On whichever is the mast post-processing system, waveform archiver program called “wanc” processes these requests. There are several instances of wanc running at once, one for each of groups of networks of seismic stations. Breaking the work load up by networks provides an easy way to have several archivers working in parallel while ensuring they do not interfere with each other.

It is important that each instance of wanc is configured to operate on a unique list of networks. Otherwise the waveform tables are likely to become inconsistent.

The waveform archivers must be run under the dcmgr user so that they can create files and directories in the NCEDC archive.

Waveform archivers run continuously, doing the following actions in a loop:

Note that wanc works on lists of request cards, not on lists of events.

wanc configuration file

wanc.cfg has the following arguments:

Sample configuration file:

Logfile		../logs/wa.log
LoggingLevel	2
ProgramName	Wave_Archiver


#
# Application configuration parameters
#
RequestType			Triggered
Auth				NC
Subsource			RTTEST
MaxValidTime			7
WaveServer			transfrm:6500
PollInterval			60
Order				Oldest
ServerConnectTimeout		10
MaxRequests			128
GapThresh			0.1
WaveRoot			/data/ncedc/events
# optional list of one or more network codes to handle; default is to handle
# all network codes. Separate multiple nets by commas, no spaces.
NetList				BK,BP
DBService			service
DBUser				user
DBPasswd			passwd
DBConnectionRetryInterval	5
DBMaxConnectionRetries		5

Event Waveform Repopulation

The waveforms collected for an event may not always be what jiggle users want to see. For example, the event parameters (origin time, location, magnitude) available in the database when the request card generator first ran may be incorrect.

To address such problems, the NCSS developed some tools to effectively remove the existing waveform collection and replace it with a (hopefully) better collection. This starts with the Catalog maintenance web page. This lists all the earthquakes in the database for the last seven days, including events with their selectflag set to “0”, i.e. “deleted” from the catalog.

The user selects an event of interest. The event page shows the current status of event information as well as the status of collected waveforms and pending request cards. If the event information is sufficient (must have a valid location and magnitude) and the event is not too old (max is 12 days), the user is offered a “Repopulate Waveforms” button.

Pressing the “Repopulate Waveforms” button causes the event to be inserted into the PCS table in the TPP-TPP-REPOP state. From there the repopwfcont script takes action. When wanc sees the new request cards that are generated by repopwfcont, the requests are treated just like any other requests.

Starting and Stopping //wanc//

All the waveform archiving processes must be run as user dcmgr so that they have permission to write files on the NCEDC waveform filesystems.

Each instance of wanc has its own run script, e.g. run_wanc_NC. These scripts take one argument: either start or stop. There are also scripts start_all_wancs and stp_all_wancs. All these scripts are in the /home/dcmgr/run/bin directory on the post-processing systems.

wanc will not stop immediately. If it is processing a batch of request cards, it will continue until that batch is finished. Sometimes when wanc is idle, it will fail to stop. It's OK to give it a kill -9.

The wancs are NOT started automatically during the boot process. The consequences of having two sets of wancs running (on each of the post processing systems) are so bad that we only start the wanc processes by hand.

See post-proc active-standby switch for details on switching the running set of wancs between post-processing systems.

Maintenance

Provided that the wancs are configured correctly, they generally work well. When people complain about missing waveforms for one or more events, it usually is a problem with wave servers. Is the problem waveform available on the wave server(s) that wanc is configured to use for that network? Is that wave server configured correctly to serve that SNCL?