The qml2extendedtext.py code is included into the present docker.
The docker is used to parse a full QuakeML (xml) file or QuakeML webservice response containing information on hypocenter and related arrival times picks, and write the following information about the hypocenter on one single line:
Note: the "hypocenter magnitude" is the magnitude directly associated to the specific hypocenter; it is calculated consequently to the hypocenter, it is tipically an ML and it might be not selected as the "preferred" if a hierarchically more reliable one is present (eg: Mw)
Anyway, only for information completeness here it is:
usage: qml2extendedtext.py [-h] [--qmlin QMLIN] [--qmldir QMLDIR] [--eventid EVENTID] [--version VERSION] [--conf CONF] [--nophases] [--noamps] [--nofocals] [--agency AGENCY]
optional arguments:
-h, --help show this help message and exit
--qmlin QMLIN Full path to a single qml event file
--qmldir QMLDIR Full path to the directory containing more qml event files
--eventid EVENTID INGV event id
--version VERSION Agency coding origin version type (**default**: preferred) preferred,all, or an integer for known version numbers
--conf CONF needed with --eventid agency webservices routes list type (**default**: ./ws_agency_route.conf)
--nophases If on, no phase extraction and count is done
--noamps If on, no amp extraction and count is done
--nofocals If on, no focal mechanism extraction and count is done
--agency AGENCY needed with --eventid agency to query for (see routes list in .conf file) type (default: ingv)
Note: this script can be used either to parse QuakeML file(s) (--qmlin and --qmldir are alternative choices) or to get info from a webservice for a single event based on its unique identifier by the agency (--eventid)
An header,starting with a "#" is given in output in all cases at line one of the screen output. In the case of --qmldir this is a the top of a list of hypocenters.
To obtain qml2extendedtext docker image, you have two options:
Get the last built image from DockerHub repository:
docker pull ingv/qml2extendedtext
First, clone the git repository
git clone https://github.com/INGV/qml2extendedtext.git
cd qml2extendedtext
docker build --tag ingv/qml2extendedtext .
in case of errors, try:
docker build --no-cache --pull --tag ingv/qml2extendedtext .
To run the container, use the command below; the -v option is used to "mount" working directory into container:
docker run --rm --user $(id -u):$(id -g) -v $(pwd)/example:/opt/input ingv/qml2extendedtext
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/opt/input ingv/qml2extendedtext --eventid 25883521 --agency ingv --conf /opt/input/ws_agency_route.conf --version preferred
output:
#event_id|event_type|origin_id|version|ot|lon|lat|depth|err_ot|err_lon|err_lat|err_depth|err_h|err_z|nph_tot|nph_tot_used|nph_p_used|nph_s_used|magnitud_id|magnitude_type|magnitude_value|magnitude_err|magnitude_nsta_used|pref_magnitud_id|pref_magnitude_type|pref_magnitude_value|pref_magnitude_err|pref_magnitude_nsta_used|rms|gap|source
25883521|earthquake|85930721|100|2021-01-01T01:09:10.220000Z|13.1877|42.8343|8.4|0.26|0.7991095982233789|0.8006034718408229|1.5|0.93|1.5|10|10|6|4|91710461|ML|1.3|0.2|4|91710461|ML|1.3|0.2|4|0.17|212.0|http://webservices.ingv.it/fdsnws/event/1/query?eventid=25883521&includeallmagnitudes=true&includeallorigins=true&includeallstationsmagnitudes=true&includearrivals=true
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/opt/input ingv/qml2extendedtext --qmlin /opt/input/example/20210101-010910__25883521__INGV-EVENT.qml --version preferred
output:
#event_id|event_type|origin_id|version|ot|lon|lat|depth|err_ot|err_lon|err_lat|err_depth|err_h|err_z|nph_tot|nph_tot_used|nph_p_used|nph_s_used|magnitud_id|magnitude_type|magnitude_value|magnitude_err|magnitude_nsta_used|pref_magnitud_id|pref_magnitude_type|pref_magnitude_value|pref_magnitude_err|pref_magnitude_nsta_used|rms|gap|source
25883521|earthquake|85930721|100|2021-01-01T01:09:10.220000Z|13.1877|42.8343|8.4|0.26|0.7991095982233789|0.8006034718408229|1.5|0.93|1.5|10|10|6|4|91710461|ML|1.3|0.2|4|91710461|ML|1.3|0.2|4|0.17|212.0|20210101-010910__25883521__INGV-EVENT.qml
To override the ENTRYPOINT directive and enter into the Docker container, run:
docker run --rm -it --user $(id -u):$(id -g) --entrypoint=bash qml2extendedtext
Get last Docker image from DockerHub repository:
docker pull ingv/qml2extendedtext
Thanks to your contributions!
Here is a list of users who already contributed to this repository:
(c) 2021 Raffaele Distefano raffaele.distefano[at]ingv.it
(c) 2021 Valentino Lauciani valentino.lauciani[at]ingv.it
Istituto Nazionale di Geofisica e Vulcanologia, Italia
Content type
Image
Digest
sha256:0ca029aca…
Size
382.7 MB
Last updated
over 2 years ago
docker pull ingv/qml2extendedtext