.. highlight:: rst .. _scevent: ####### scevent ####### **Associates an Origin to an Event or forms a new Event if no match is found. Selects the preferred origin, magnitude and focal mechanism.** Description =========== As a consequence of a real-time system the |scname| modules creates several :term:`origins ` (results of localization processes) for one earthquake or other seismic events because as time goes by more seismic phases are available. scevent receives these origins and associates the origins to :term:`events `. It is also possible to import and associate origins from other agencies. The main tasks of scevent are: * :ref:`Associate origins ` to events. * Set the :ref:`ID of events `. * Set the :ref:`preferred origin ` from all available origins. * Set the :ref:`preferred magnitude ` from all available magnitudes. * Set the :ref:`preferred focal mechanism ` from all available focal mechanisms. * *Optional:* Set the event type of automatic origins based by the plugin :ref:`evrc ` based on the hypocenter location of the preferred origin. This requires the configuration of the :ref:`evrc ` plugin and of geographic regions by :ref:`polygons in BNA or GeoJSON format `. .. _scevent-assocorg: Origin Association ================== scevent associates origins to events by searching for the best match of the new (incoming) origin to other origins for existing events: * Associate origins belonging to belonging to **the same seismic event** to the same event object in |scname|. * Associate origins belonging to **different seismic events** to different event objects in |scname|. If no match can be found, a new event can be formed. Origins can be filtered/ignored based on * ID of agency which has created the origin: :confval:`processing.blacklist.agencies`, :confval:`processing.whitelist.agencies` (global parameters), * Hypocenter parameters: :confval:`eventAssociation.region.rect`, :confval:`eventAssociation.region.minDepth`, :confval:`eventAssociation.region.maxDepth`. Origin match ------------ The new origin is matched to existing origins by comparing differences in epicenter, origin time, and :term:`arrivals ` (associated picks). The new origin is matched to an existing origin which has the highest rank in the following three groups (1, 2, 3): #. Location and Time (lowest) The difference in horizontal location is less than :confval:`eventAssociation.maximumDistance` (degrees) and the difference in origin times is less than :confval:`eventAssociation.maximumTimeSpan`. #. Picks The two origins have more than :confval:`eventAssociation.minimumMatchingArrivals` matching picks. Picks are matched either by ID or by time depending on :confval:`eventAssociation.maximumMatchingArrivalTimeDiff`. #. Picks and Location and Time (highest) This is the best match, for which both the location-and-time and picks criteria above are satisfied. If more than one origin is found in the highest ranking class, then the first one of them is chosen. .. note:: For efficiency events in the cache are scanned first and if no matches are found, the database is scanned for the time window :confval:`eventAssociation.eventTimeBefore` - :confval:`eventAssociation.eventTimeAfter` around the incoming Origin time. The cached events are ordered by eventID and thus in time. No origin match --------------- If no event with an origin that matches the incoming origin is found, then a new event is formed and the origin is associated to that event. The following criteria are applied to allow the creation of the new event: * The agency for the origin is not black listed (:confval:`processing.blacklist.agencies`). * The origin is automatic and it has more than :confval:`eventAssociation.minimumDefiningPhases` :term:`arrivals ` (associated picks). .. figure:: media/scevent/Association_of_an_origin_by_matching_picks.jpg :scale: 50 % :alt: alternate association of an origin by matching picks. :align: center Association of an origin to an event by matching picks. .. _scevent-preforg: Preferred Origin ================ The preferred origin is set by ranking of all associated origins. The ranking is controlled by :confval:`eventAssociation.priorities` and related configuration parameters. .. _scevent-prefmag: Preferred Magnitude =================== The preferred magnitude is set by ranking of the :ref:`summary magnitude ` and all :ref:`network magnitudes ` of the preferred origin. The ranking is mainly controlled by :confval:`eventAssociation.magTypes` and :confval:`eventAssociation.minimumMagnitudes` and related configuration parameters. .. _scevent-preffm: Preferred Focal Mechanism ========================= The most recent manual focal mechanism or, if no manual ones are unavailable, the most recent automatic focal mechnisms becomes preferred. .. _scevent-eventid: ID of Events ============ The ID of an event or eventID uniquely identifies an event. The ID is derived from the time of occurrence of the event within a year. As configured by :confval:`eventIDPattern` it typically consists of a prefix configured by :confval:`eventIDPrefix` and a string containing the year and a set of characters or numbers defining the time. .. _scevent-journals: Journals ======== scevent can be commanded by journals to do a certain action. Journal entries are being received via the messaging bus to any of the subscribed groups. A journal entry contains an action, a subject (a publicID of an object) and optional parameters. Journals can be interactively sent to the messaging by :ref:`scsendjournal`. If scevent has handled an action, it will send a reply journal entry with an action formed from the origin action name plus **OK** or **Failed**. The parameters of the journal entry contain a possible reason. The following actions are supported by scevent: .. function:: EvGrabOrg(objectID, parameters) Grabs an origin and associates it to the given event. If the origin is already associated with another event then its reference to this event will be removed. :param objectID: The ID of an existing event :param parameters: The ID of the origin to be grabbed .. function:: EvMerge(objectID, parameters) Merges an event (source) into another event (target). After successful completion the source event will be deleted. :param objectID: The ID of an existing event (target) :param parameters: The ID of an existing event (source) .. function:: EvName(objectID, parameters) Adds or updates the event description with type "earthquake name". :param objectID: The ID of an existing event :param parameters: An event name .. function:: EvNewEvent(objectID, parameters) Creates a new event based on a given origin. The origin must not yet be associated with another event. :param objectID: The origin publicID of the origin which will be used to create the new event. :param parameters: Unused .. function:: EvOpComment(objectID, parameters) Adds or updates the event comment text with id "Operator". :param objectID: The ID of an existing event :param parameters: The comment text .. function:: EvPrefFocMecID(objectID, parameters) Sets the preferred focal mechanism ID of an event. If a focal mechanism ID is passed then it will be fixed as preferred solution for this event and any subsequent focal mechanism associations will not cause a change of the preferred focal mechanism. If an empty focal mechanism ID is passed then this is considered as "unfix" and scevent will switch back to automatic preferred selection mode. :param objectID: The ID of an existing event :param parameters: The focal mechanism ID which will become preferred or empty. .. function:: EvPrefMagType(objectID, parameters) Set the preferred magnitude of the event matching the requested magnitude type. :param objectID: The ID of an existing event :param parameters: The desired preferred magnitude type .. function:: EvPrefMw(objectID, parameters) Sets the moment magnitude (Mw) of the preferred focal mechanism as preferred magnitude of the event. :param objectID: The ID of an existing event :param parameters: Boolean flag, either "true" or "false" .. function:: EvPrefOrgAutomatic(objectID, parameters) Releases the fixed origin constraint. This call is equal to :code:`EvPrefOrgID(eventID, '')`. :param objectID: The ID of an existing event :param parameters: Unused .. function:: EvPrefOrgEvalMode(objectID, parameters) Sets the preferred origin based on an evaluation mode. The configured priorities are still valid. If an empty evaluation mode is passed then scevent releases this constraint. :param objectID: The ID of an existing event :param parameters: The evaluation mode ("automatic", "manual") or empty .. function:: EvPrefOrgID(objectID, parameters) Sets the preferred origin ID of an event. If an origin ID is passed then it will be fixed as preferred solution for this event and any subsequent origin associations will not cause a change of the preferred origin. If an empty origin ID is passed then this is considered as "unfix" and scevent will switch back to automatic preferred selection mode. :param objectID: The ID of an existing event :param parameters: The origin ID which will become preferred or empty. .. function:: EvRefresh(objectID, parameters) Refreshes the event information. This operation can be useful if the configured fep region files have changed on disc and scevent should update the region information. Changed plugin parameters can be another reason to refresh the event status. :param objectID: The ID of an existing event :param parameters: Unused .. function:: EvSplitOrg(objectID, parameters) Remove an origin reference from an event and create a new event for this origin. :param objectID: The ID of an existing event holding a reference to the given origin ID. :param parameters: The ID of the origin to be split .. function:: EvType(objectID, parameters) Sets the event type to the passed value. :param objectID: The ID of an existing event :param parameters: The event type .. function:: EvTypeCertainty(objectID, parameters) Sets the event type certainty to the passed value. :param objectID: The ID of an existing event :param parameters: The event type certainty Plugins ======= * :ref:`RegionCheck ` evrc plugin for scevent .. _scevent_configuration: Module Configuration ==================== | :file:`etc/defaults/global.cfg` | :file:`etc/defaults/scevent.cfg` | :file:`etc/global.cfg` | :file:`etc/scevent.cfg` | :file:`~/.seiscomp/global.cfg` | :file:`~/.seiscomp/scevent.cfg` scevent inherits :ref:`global options`. .. confval:: eventIDPrefix Type: *string* Prefix for all Event IDs .. confval:: eventIDPattern Default: ``%p%Y%04c`` Type: *string* Defines the pattern to generate an event ID. %p : prefix %Y : year %[w]c: alpha character %[w]C: upper case alpha character %[w]d: decimal %[w]x: hexadecimal %[w]X: upper case hexadecimal [w] is an optional width parameter. .. confval:: eventIDLookupMargin Default: ``-1`` Type: *integer* Configures the number of event ID slots to look back and forth when an event ID is already taken. The default in previous versions was 5. Now \-1 means that the margin is determined automatically based on \"eventAssociation.eventTimeBefore\" and \"eventAssociation.eventTimeAfter\". According to the configured \"eventIDPattern\" a fixed time range per slot can be computed and with that width the number of look ahead slots and look back slots can be computed based on the given time ranges for event association. .. confval:: populateFERegion Default: ``false`` Type: *boolean* If enabled, then the EventDescription with type 'Flinn\-Engdahl region' will be populated with the Flinn\-Engdahl region name. .. confval:: processing.blacklist.eventIDs Type: *list:string* Defines a list of event ID patterns to be blocked. The items of this list are only matched against %c, %C, %d, %x and %X of the eventIDPattern description. Year \(%Y\) and prefix \(%p\) are not matched. The match is case\-sensitive, so 'abcd' would only by blocked in combination with %c. If %C is used, 'ABCD' is matched. .. note:: **eventAssociation.\*** *Criteria defining if Origins are associated to an event* *and which Origins and magnitudes become preferred.* .. confval:: eventAssociation.minimumDefiningPhases Default: ``10`` Type: *int* Minimum number of Picks for an Origin that is automatic and cannot be associated with an Event to be allowed to form an new Event. .. confval:: eventAssociation.minimumScore Type: *double* Minimum score of an automatic Origin to be allowed to form an new Event. This requires an activated score plugin and a score processor. Configure \"score\" for defining the score processor and the score processor parameters. If minimumScore is defined, \"minimumDefiningPhases\" has no effect on association as this phase check will be superseded by the score check. It is the task of the score processor to evaluate a proper score for all input Origins. .. confval:: eventAssociation.ignoreFMDerivedOrigins Default: ``true`` Type: *boolean* Ignore and do not associate Origins derived from CMT\/MT inversions. .. confval:: eventAssociation.eventTimeBefore Default: ``1800`` Type: *double* Unit: *s* Time range before the Origin time of an incoming Origin to search for matching events. .. confval:: eventAssociation.eventTimeAfter Default: ``1800`` Type: *double* Unit: *s* Time range after the Origin time of an incoming Origin to search for matching events. .. confval:: eventAssociation.minimumMatchingArrivals Default: ``3`` Type: *int* Minimum number of matching picks between two Origins to be associated to the same event. .. confval:: eventAssociation.maximumMatchingArrivalTimeDiff Default: ``-1`` Type: *double* Unit: *s* Negative time window: compare only pickIDs to find matching arrivals. A non negative value \(including 0\) compares pick times regardless of the pickID. Pass: \|pick1.time \- pick2.time\| <\= threshold .. confval:: eventAssociation.compareAllArrivalTimes Default: ``true`` Type: *boolean* This parameter is only used in conjunction with eventAssociation.maximumMatchingArrivalTimeDiff. If a station has multiple associated arrivals for a particular event, this flag defines if the time distance of a new pick to all arrivals must be within eventAssociation.maximumMatchingArrivalTimeDiff or if one matching arrival is enough. .. confval:: eventAssociation.allowLooseAssociatedArrivals Default: ``false`` Type: *boolean* Allows to match picks that are associated with weight 0. .. confval:: eventAssociation.maximumTimeSpan Default: ``60`` Type: *double* Unit: *s* Associates an Origin with an existing event if the Origin time differs not more than 60 seconds unless the minimumMatchingArrivals criteria matches. .. confval:: eventAssociation.maximumDistance Default: ``5`` Type: *double* Unit: *degrees* Allowed location difference between an incoming Origin compared with preferred Origins to get associated. .. confval:: eventAssociation.magTypes Default: ``M`` Type: *list:string* Magnitude type priority list for becoming a preferred magnitude for an event. Example: M, mBc, Mw\(mB\), Mwp, ML, MLh, MLv, mb .. confval:: eventAssociation.enableFallbackMagnitude Default: ``false`` Type: *boolean* If true, one magnitude will be preferred even if magnitude criteria are not fullfilled. .. confval:: eventAssociation.minimumMagnitudes Default: ``4`` Type: *int* Minimum number of station magnitudes referenced to a network magnitude to become a preferred magnitude. .. confval:: eventAssociation.minMwCount Default: ``8`` Type: *int* Minimum number of station magnitudes required for Mw\(mB\) to be considered as preferred magnitude. .. confval:: eventAssociation.mbOverMwCount Default: ``30`` Type: *int* Minimum number of station magnitudes which ensures that Mw\(mB\) will be preferred and not mb. .. confval:: eventAssociation.mbOverMwValue Default: ``6`` Type: *double* Average between mb and Mw\(mB\) which must be exceeded to become Mw\(mB\) preferred. .. confval:: eventAssociation.magPriorityOverStationCount Default: ``false`` Type: *boolean* If false then the station count rules out the magnitude priority which is only taken into account if two magnitudes have the same station count. If true then the priority rules out the station count which is only taken into account if two magnitudes have the same priority. .. confval:: eventAssociation.priorities Default: ``AGENCY, STATUS, PHASES_AUTOMATIC, TIME_AUTOMATIC`` Type: *list:string* The general priority list to decide if an Origin becomes preferred. The priority decreases in the order of the parameters. This list is not used unless this parameter is activated. Empty priority list: scevent replicates the default hard wired behaviour: AGENCY, STATUS, PHASES_AUTOMATIC, TIME_AUTOMATIC Each item in the list corresponds to a check that is performed. Each check computes a score of the incoming Origin \(s1\) and the current preferred Origin \(s2\). If the s1 is lower than s2, the incoming Origin is rejected and does not become preferred. All subsequent checks are ignored. If s1 is equal to s2, the next check in the list is performed. If s1 is larger than s2, the Origin becomes preferred and all subsequent checks are ignored. Available tokens: AGENCY: check based on agency priorities AUTHOR: check based on author priorities MODE: evaluation mode priority: 0 \= unset, 1 \= automatic, 2 \= manual, manual over\-rules automatic STATUS: priority combined from evaluation status and evaluation mode: \-100 \= status is rejected, \-1 \= status is reported, 0 \= status is preliminary or status is unset and mode is automatic, 1 \= status is confirmed or status is unset and mode is manual, 2 \= status is reviewed, 3 \= status is final, METHOD: check based on the method priorities PHASES: higher phase count \= higher priority PHASES_AUTOMATIC: only checks phase priorities for incoming automatic Origins RMS: lower rms \= higher priority RMS_AUTOMATIC: only check RMS on incoming automatic Origins TIME: more recent Origins \(creationTime\) have higher priorities TIME_AUTOMATIC: only check creationTime priority on incoming automatic Origins SCORE: evaluates the score according to a configured ScoreProcessor and prefers the Origin\/Focalmechanism with the highest score. .. confval:: eventAssociation.agencies Type: *list:string* The agencyID priority list. When the eventtool comes to the point to select a preferred Origin based on AGENCY it orders all Origins by its agency priority and selects then the best one among the highest priority agency. It also defines the agency priority for custom priority checks \(eventAssociation.priorities\). The parameter is only considered when defined in \"priorities\". .. confval:: eventAssociation.authors Type: *list:string* The author priority list. When the eventtool comes to the point to select a preferred Origin based on AUTHOR it orders all Origins by its author priority and selects then the best one among the highest priority author. It also defines the author priority for custom priority checks \(eventAssociation.priorities\). The parameter is only considered when defined in \"priorities\". .. confval:: eventAssociation.methods Type: *list:string* The method priority list. When the eventtool comes to the point to select a preferred Origin based on METHOD it orders all Origins by its methodID priority and selects then the best one among the highest priority method. It also defines the method priority for custom priority checks \(eventAssociation.priorities\). A defined method string must match exactly the string in Origin.methodID. The parameter is only considered when defined in \"priorities\". .. confval:: eventAssociation.score Type: *string* Defines the ScoreProcessor interface to be used along with priority \"SCORE\". The parameter is only considered when defined in \"priorities\". .. confval:: eventAssociation.declareFakeEventForRejectedOrigin Default: ``false`` Type: *boolean* If the preferred Origin has evaluation status 'rejected', the Event type will be set to 'not existing' unless the Event type has been fixed by an operator or the preferred Origin has been fixed. .. confval:: eventAssociation.delayTimeSpan Type: *int* Unit: *s* Configures a timespan to delay Event creation. If a new Origin arrives which cannot be associated to an existing Event, delay the Event creation for a certain timespan. .. note:: **eventAssociation.region.\*** *Region filter for creating events. Use with care! Origins* *outside may be ignored even if they would* *become preferred otherwise.* .. confval:: eventAssociation.region.rect Type: *string* Region by geographic coordinates. Format: \"South, East, North, West\" .. confval:: eventAssociation.region.minDepth Type: *double* Unit: *km* Minimum depth. .. confval:: eventAssociation.region.maxDepth Type: *double* Unit: *km* Maximum depth. .. note:: **eventAssociation.delayFilter.\*** *The delayFilter group configures an Origin filter to activate the delay feature for* *this Origin. If more than one filter is given they are combined with AND.* .. confval:: eventAssociation.delayFilter.agencyID Type: *string* The agencyID of the Origin to be delayed. .. confval:: eventAssociation.delayFilter.author Type: *string* The author of the Origin to be delayed. .. confval:: eventAssociation.delayFilter.evaluationMode Type: *string* The evaluation mode of the Origin to be delayed. Can be either \"manual\" or \"automatic\". .. _scevent/RegionCheck: RegionCheck extension --------------------- evrc plugin for scevent .. note:: **rc.\*** *Test if events lie within or outside geographic regions defined* *by polygons.* *Events within a region are flagged as positive, outside as negative.* *The event type is set accordingly. Add the* *plugin "evrc" to the plugins parameter in the* *order of priority to make this feature available. Read the* *documentation of the RegionCheck for more details.* .. confval:: rc.setEventType Default: ``true`` Type: *boolean* Allow setting the event type. The type of events which have manual origins will not be changed unless configured explicitely by \"overwriteManual\". .. confval:: rc.overwriteEventType Default: ``true`` Type: *boolean* Allow overwriting existing event types. Disabling does not allow accounting for changes in source region. .. confval:: rc.overwriteManual Default: ``false`` Type: *boolean* Allow setting the event type if the mode of the preferred origin is manual or if the event type was set manually. .. confval:: rc.regions Default: ``!reject`` Type: *list:string* The list of closed polygon names defining regions for flagging event as positive or negative. A polygon name defines a positive region but names with prefix \! \(exclamation mark\) define negative regions. Evaluation is done in the order of the polygons. The last matching criteria applies and the event type is set accordingly. Default: If events are not positive or are negative regions the event type is set to \"outside of network interest\". Default: \"\!reject\", use \"accecpt\" to overwrite the default. Examples: Events are flagged positive within the polygon \"germany\": germany All events are flagged positive but events within the polygon \"quarries\" are negative: accept,\!quarries Events within the polygon \"germany\" are flagged positive but all other events and events within the polygon \"quarries\" are negaitve: germany,\!quarries All events are flagged positive but events within the polygon \"germany\" are negative and all events within the polygon \"saxony\" are positive: accept,\!germany,saxony .. confval:: rc.readEventTypeFromBNA Default: ``false`` Type: *boolean* Consider the event type, minDepth and maxDepth values from the polygons defined by GeoJSON or BNA files. Read the documentation of the RegionCheck plugin for the details. When eventType is defined in the polygons, the value supersedes values of 'eventTypePositive' and 'eventTypeNegative'. If not set, 'eventTypePositive' and 'eventTypeNegative' are considered. .. confval:: rc.eventTypePositive Type: *string* New type of an event which is flagged positive. Ignored if 'readEventTypeFromBNA' is active and the polygons define eventType. Empty: Do not set type. .. confval:: rc.eventTypeNegative Default: ``"outside of network interest"`` Type: *string* New type of an event which is flagged negative. Ignored if 'readEventTypeFromBNA' is active and the polygons define eventType. Empty means default: \"outside of network interest\" Command-Line Options ==================== .. program:: scevent Generic ------- .. option:: -h, --help Show help message. .. option:: -V, --version Show version information. .. option:: --config-file arg Use alternative configuration file. When this option is used the loading of all stages is disabled. Only the given configuration file is parsed and used. To use another name for the configuration create a symbolic link of the application or copy it. Example: scautopick \-> scautopick2. .. option:: --plugins arg Load given plugins. .. option:: -D, --daemon Run as daemon. This means the application will fork itself and doesn't need to be started with \&. .. option:: --auto-shutdown arg Enable\/disable self\-shutdown because a master module shutdown. This only works when messaging is enabled and the master module sends a shutdown message \(enabled with \-\-start\-stop\-msg for the master module\). .. option:: --shutdown-master-module arg Set the name of the master\-module used for auto\-shutdown. This is the application name of the module actually started. If symlinks are used, then it is the name of the symlinked application. .. option:: --shutdown-master-username arg Set the name of the master\-username of the messaging used for auto\-shutdown. If \"shutdown\-master\-module\" is given as well, this parameter is ignored. .. option:: -x, --expiry time Time span in hours after which objects expire. .. option:: -O, --origin-id publicID OriginID to be associated. When given no messages are sent. Only the status of the association is written to stdout. Verbosity --------- .. option:: --verbosity arg Verbosity level [0..4]. 0:quiet, 1:error, 2:warning, 3:info, 4:debug. .. option:: -v, --v Increase verbosity level \(may be repeated, eg. \-vv\). .. option:: -q, --quiet Quiet mode: no logging output. .. option:: --component arg Limit the logging to a certain component. This option can be given more than once. .. option:: -s, --syslog Use syslog logging backend. The output usually goes to \/var\/lib\/messages. .. option:: -l, --lockfile arg Path to lock file. .. option:: --console arg Send log output to stdout. .. option:: --debug Execute in debug mode. Equivalent to \-\-verbosity\=4 \-\-console\=1 . .. option:: --log-file arg Use alternative log file. Messaging --------- .. option:: -u, --user arg Overrides configuration parameter :confval:`connection.username`. .. option:: -H, --host arg Overrides configuration parameter :confval:`connection.server`. .. option:: -t, --timeout arg Overrides configuration parameter :confval:`connection.timeout`. .. option:: -g, --primary-group arg Overrides configuration parameter :confval:`connection.primaryGroup`. .. option:: -S, --subscribe-group arg A group to subscribe to. This option can be given more than once. .. option:: --start-stop-msg arg Set sending of a start and a stop message. Database -------- .. option:: --db-driver-list List all supported database drivers. .. option:: -d, --database arg The database connection string, format: service:\/\/user:pwd\@host\/database. \"service\" is the name of the database driver which can be queried with \"\-\-db\-driver\-list\". .. option:: --config-module arg The config module to use. .. option:: --inventory-db arg Load the inventory from the given database or file, format: [service:\/\/]location . .. option:: --db-disable Do not use the database at all