The qml2hypo71phs.py code is included into the present docker.
The docker is used to parse a full QuakeML (xml) file containing information on hypocenter and related arrival times picks, and convert all to hypo71 phase input file.
Beyond column 78 (^) of the output file, additional information are included on each phase line about station, network and event.
The following line is taken from the example output:
VOBA P 0Z210203152652.99 55.00 S 1 40.85 HNZIV-- EVID:26031941,ORID:86811231,V:100
^
channel: 79-81
network: 82-83
location: 84-85
eventid,originid,originversion: 90-> free format comma separated list. These information allow to interact back with the QuakeML file.
Columns from 1 to 78 are described in the standard Hypo71 which manual in PDF is here [https://escweb.wr.usgs.gov/content/software/HYPOINVERSE/doc/hyp1.40.pdf]
The specific Fortran Format (taken from the above linked manual) is the following:
#Start Fortran
#Col. Len. Format Data
#1 4 A4 4-letter station site code. Also see col 78.
#5 2 A2 P remark such as "IP". If blank, any P time is ignored.
#7 1 A1 P first motion such as U, D, +, -, C, D.
#8 1 I1 Assigned P weight code.
#9 1 A1 Optional 1-letter station component.
#10 10 5I2 Year, month, day, hour and minute.
#20 5 F5.2 Second of P arrival.
#25 1 1X Presently unused.
#26 6 6X Reserved remark field. This field is not copied to output files.
#32 5 F5.2 Second of S arrival. The S time will be used if this field is nonblank.
#37 2 A2, 1X S remark such as "ES".
#40 1 I1 Assigned weight code for S.
#41 1 A1, 3X Data source code. This is copied to the archive output.
#45 3 F3.0 Peak-to-peak amplitude in mm on Develocorder viewer screen or paper record.
#48 3 F3.2 Optional period in seconds of amplitude read on the seismogram. If blank, use the standard period from station file.
#51 1 I1 Amplitude magnitude weight code. Same codes as P & S.
#52 3 3X Amplitude magnitude remark (presently unused).
#55 4 I4 Optional event sequence or ID number. This number may bereplaced by an ID number on the terminator line.
#59 4 F4.1 Optional calibration factor to use for amplitude magnitudes. If blank, the standard cal factor from the station file is used.
#63 3 A3 Optional event remark. Certain event remarks are translated into 1-letter codes to save in output.
#66 5 F5.2 Clock correction to be added to both P and S times.
#71 1 A1 Station seismogram remark. Unused except as a label on output.
#72 4 F4.0 Coda duration in seconds.
#76 1 I1 Duration magnitude weight code. Same codes as P & S.
#77 1 1X Reserved.
#78 1 A1 Optional 5th letter of station site code.
#79 3 A3 Station component code.
#82 2 A2 Station network code.
#84-85 2 A2 2-letter station location code (component extension)
The source code has a specific usage to which the docker has its simplified interface, so the user does not need to know it.
Anyway, only for information completeness here it is:
usage: qml2hypo71phs.py [-h] [--qmlin QMLIN] [--eventid EVENTID] [--version VERSION] [--conf CONF] [--agency AGENCY]
optional arguments:
-h, --help show this help message and exit
--qmlin QMLIN Full path to qml event file
--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)
--agency AGENCY needed with --eventid agency to query for (see routes list in .conf file) type (default: ingv)
To obtain qml2hypo71phs docker image, you have two options:
Get the last built image from DockerHub repository:
$ docker pull ingv/qml2hypo71phs
First, clone the git repository
$ git clone https://github.com/INGV/qml2hypo71phs.git
$ cd qml2hypo71phs
$ docker build --tag ingv/qml2hypo71phs .
in case of errors, try:
$ docker build --no-cache --pull --tag ingv/qml2hypo71phs .
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/qml2hypo71phs
example:
$ docker run --rm --user $(id -u):$(id -g) -v $(pwd)/example:/opt/input ingv/qml2hypo71phs --qmlin /opt/input/quakeml.xml
To override the ENTRYPOINT
directive and enter into the Docker container, run:
$ docker run --rm -it --user $(id -u):$(id -g) --entrypoint=bash qml2hypo71phs
Get last Docker image from DockerHub repository:
$ docker pull ingv/qml2hypo71phs
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