As a first step, we have to agree on the format used to send the event information: quakeml, sc3ml, scautoloc1, scautoloc3, gse2, isf1, isf2, ...
The EMSC must give you 3 information:
- your agency name (XXX)
- an user (YYY)
- a password (ZZZ)
- and the HMB queue name dedicated to your institut (QQQ).
Although you can give the user/password to the script that send the data, we advise you to create a config file (e.g. institut.cfg) containing authentication information and to use it with that script (see use cases).
agency = XXX
user = YYY
password = ZZZ
To easy the use of HMB, we provide a python library hmb_client as a wrapper around HMB developped by GFZ. You have to clone the hmb_client repository. It uses python 3.6+ and needs the libraries requests and pymongo to be installed.
Here we describe how to send the event information via files. If we suppose that the current directory contains the hmb_client repository, the configuration file institut.cfg and the file containing the data to send MYFILE.txt. You can run:
python3 hmb_client/publish_hmb.py MYFILE.txt -t file --url http://cerf.emsc-csem.org/ExchangeEvent --cfg institut.cfg --queue QQQ
Note that some metadata are really usefull:
- if you know the eventid of the event (e.g. TOTO2023fgh), it's helpfull if you can add the argument -m eventid:TOTO2023fgh;
- if you want to delete this event, you can add -m deleted:1 (deleted:0 means no deletion);
- if you send only a moment tensor, you can add -m datatype:mt
To specify the publication of a moment tensor having a given eventid, we can run:
python3 hmb_client/publish_hmb.py MYFILE.txt -t file --url http://cerf.emsc-csem.org/ExchangeEvent --cfg institut.cfg --queue QQQ -m eventid:TOTO2023fgh -m datatype:mt
In the case you would like to send seiscomp origins to hmb, we provide the script scorigin_to_rts.sh that should be executed by the scalert seiscomp plugin.
- Create the config file (see authentication)
- Setup parameters in scorigin_to_rts.sh
- min_magnitude, min_phasecount
- queue_name (QQQ)
- path to the config file
- path of the script publish_hmb.py (see HMB setup)
- connexion to seiscomp db
- configure scalert to launch the script scorigin_to_rts.sh