scdispatch

Reads objects (event, origin, etc) from a QuakeML file and sends the objects to the messaging system.

Command line options

-i, --input <string>
QuakeML file to dispatch to messaging.
[-O, --operation ([add]|update|remove)]
Not required, defaults to add. Notifier operation: add, update or remove objects.
[--routingtable arg]
Specify routing table as list of object:group pairs.
[--print-objects]
Print names of routable objects

Examples

Send all objects from a QuakeML file. The default behavior is to add:

scdispatch -i test.xml

Send an update:

scdispatch -i test.xml -O update

Remove the objects:

scdispatch -i test.xml -O remove
Subsets of QuakeML Objects

It can be useful to import a subset of QuakeML objects e.g., Origins from other agencies, and then allow scevent to associate them to existing events (and possibly prefer them based on the rules in scevent) or create new Events for the Origins. If the Event objects from a QuakeML file are not required to be sent to the messaging then either they should be removed (e.g., using an XSLT) and all the remaining objects in the file added:

scdispatch -i test.xml

or the Event objects can be left out of the routing table e.g.,

scdispatch -i test.xml \ 
--routingtable Pick:PICK,Arrival:ARRIVAL,Amplitude:AMPLITUDE, \
Origin:LOCATION,StationMagnitude:MAGNITUDE,StationMagnitudeContribution:MAGNITUDE,Magnitude:MAGNITUDE

Note the routing table approach is slower, scdispatch still has to try to send to the invalid group for each object. It seems that is should be possible to route to Event:NULL or some other non used group but this seems to always result in another Event (the one in the source QuakeML) being sent and loaded. Is this a bug?

Testing

For testing it is useful to watch the results of dispatch with scolv or scxmldump. It is also useful to clean the database and logs to remove objects from persistent storage to allow repeated reloading of a file.

Note: the following will clear all events from the database and any other other object persistence. Modify the mysql command to suit your db setup.

seiscomp stop
rm -rf .seiscomp3/log

mysql -u root --password='my$q1' -e "DROP DATABASE IF EXISTS seiscomp3; \
 CREATE DATABASE seiscomp3 CHARACTER SET utf8 COLLATE utf8_bin; \
 GRANT ALL ON seiscomp3.* TO 'sysop'@'localhost' IDENTIFIED BY 'sysop'; \
 USE seiscomp3;source seiscomp3/trunk/share/db/mysql.sql;"

seiscomp start