Version 3 (modified by branden, 10 years ago) (diff)


Earthworm Module: eqprelim

Contributed by:


Initiates preliminary event processing (alternate head of mega-module).


Eqprelim is a first process in the earthquake-processing mega-module (sometimes referred to as "the sausage") that produces preliminary earthquake locations for the Earthworm system. Eqprelim is very similar to eqroc, which produces Earthworm's final event locations. Only eqprelim, the first link in the mega-module, is listed in startstop's configuration file to be started by startstop. Eqprelim then starts the next process, specified in its "PipeTo" command, and communicates with it via a one-directional pipe. Each newly created sub-module starts the next link in the same way. From startstop's point of view, the whole mega-module inherits the name of the first link (eqprelim) and that's the only name it displays. From statmgr's point of view, all processes within the mega-module share one module id, one heartbeat, and one descriptor file. However, each sub-module has its own configuration file and its own log file.

After starting up the next link in "the sausage," eqprelim's main job is to gather information from picker(s) and binder, to decide when it's time to report a preliminary hypocenter for a given event, to assemble all the information related to that event, and to pass it on to the next event-processing sub-module.

Eqprelim collects messages from the picker(s) (TYPE_PICK2K and TYPE_CODA2K) and from binder (TYPE_QUAKE2K and TYPE_LINK). A TYPE_PICK2K message contains an observed P-wave arrival-time and amplitude for a given seismic channel along with the installation id, module id, and pick sequence number; the picker releases the pick message within ~3 seconds of a P-wave detection. A TYPE_CODA2K message contains coda duration and amplitude information along with the installation id, module id, and sequence number of the pick it relates to; the picker releases the coda message up to 144 seconds after its corresponding pick message. A TYPE_QUAKE2K message contains an event id number, origin time and hypocenter; binder issues a new quake message each time it associates a new pick with [or deletes pick(s) from] a given event id. A TYPE_LINK message contains an event id, an installation id, a picker module id, a pick sequence number and a phase identifier; binder issues a new link message for every pick it associates with (or deletes from) an active event.

Eqprelim maintains two circular buffers:

  1. Pick list Contains the most recent MAXPCK (=1000) picks and their coda and link information (related by installation id, module id and pick sequence number) and the system-time that the pick was entered.
  1. Quake list Contains the most recent location and status of the last MAXHYP (=100) event ids and the system-time that the location was entered.

Each time eqprelim receives a TYPE_QUAKE2K message, it checks to see how many phases are associated with that event id. If the number of P-arrivals associated the event is greater than or equal to "NumPickNotify" (set in the configuration file), eqprelim initiates preliminary earthquake processing.


  1. gathers from its pick list all picks linked to that event id. If some picks do not have coda information yet, eqprelim continues the preliminary processing with zeroed coda information for those picks.
  2. builds an ascii TYPE_EVENT2K message containing the event's location and all of its supporting phase information,
  3. pipes the TYPE_EVENT2K message to the next process in the mega-module,
  4. notes in its quake list that the status of this event id is "preliminary location done."

Eqprelim will initiate only one preliminary location per binder event id, so NumPickNotify should be set at the number of phases where most event locations become stable. Often, no coda information or only poor coda information is available at the time eqprelim initiates the preliminary location. Thus most preliminary locations will have poor or absent duration magnitudes.

Note: It is possible that binder may kill an event (decide it was not real) after eqprelim has initiated the preliminary location. Eqprelim does not send out any kind of "event killed" messages. One must assume that if a final location (via eqproc) does not arrive within a given time interval (say 5-10 minutes), then the preliminary location was for a busted event.

Configuration File Commands

On startup, eqprelim reads the configuration file named on the command-line. Commands in this file set up all parameters used in making preliminary earthquake notifications. In the control file, lines may begin with a valid eqprelim command (listed below) or with one of 2 special characters:

#  marks the line as a comment (example: # This is a comment).

@  allows control files to be nested; one control file can be
   accessed from another with the command "@" followed by
   a string representing the path name of the next control file
   (example: @model.d).

Command names must be typed in the control file exactly as shown in this document (upper/lower case matters!).


# This is eqprelim's parameter file

#  Basic Earthworm setup:
MyModuleId   MOD_EQPRELIM  # module id for this instance of eqprelim
RingName     PICK_RING     # ring to get input from
LogFile      1             # 0 to completely turn off disk log file
HeartbeatInt 30            # Seconds between heartbeats

# List the message logos to grab from transport ring
#              Installation       Module          Message Types
GetPicksFrom   INST_WILDCARD    MOD_WILDCARD    # pick2k & coda2k
GetAssocFrom   INST_MENLO       MOD_BINDER      # quake & link

LocalCode      W         # single char to identify local picks with
ReportS        0         # if 0, do not send S-phases to next process
NumPickNotify  25        # send preliminary event when it has this
                         # many picks associated with it

# Send output to the following command:
# PipeTo "eqbuf eqbuf.d"
# PipeTo "eqcoda eqcoda.d"
PipeTo "log_everything"

# Load station list
maxsite 1800
site_file "calsta.hinv"

# Load Central California crustal model
@ncal_model.d# Load the central California crustal model


Below are the commands recognized by eqprelim, grouped by the function they influence. Some of the commands are marked "required"; they describe the Earthworm system setup and the network model. These commands must be specified in the control file in order for eqprelim to operate.

	Earthworm system setup:
                GetAssocFrom    required
  		GetPicksFrom	required
 		MyModuleId	required
                PipeTo          required
		RingName	required

        Seismic network/model definition:
                lay             required
                site            \  site list required; specify with
                site_file       /  either "site" or "site_file"

	Event notification:
         	NumPickNotify	required
		LocalCode	required
		ReportS		required

	Output Control:
		LogFile		required

Helpful Hints