Skip to content

INGV/qml2nllphs

Repository files navigation

TeamDigitale-publiccode TeamDigitale-reuse

License GitHub issues

Docker build Docker Image Size (latest semver) Docker Pulls

qml2nllphs Version CircleCI | GitHub

The qml2nllphs.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 NonLinLoc standard phase input file.

The following line is taken from the example output:

#Station_name Instrument Component P_phase_onset Phase_descriptor First_motion Date Hour_minute Seconds Err_type Err Err_mag Coda_duration Amplitude Period
MTRZ IV HNZ ? Sn ? 20210211 0619 41.3500 QUAL 4 -1.00E+00 -1.00E+00 -1.00E+00

Note:

  • In the present version no information on Coda_duration Amplitude Period is included in the output.
  • the Err_type is "QUAL" so the Err_mag is expressed as discrete Hypoinverse-like weight
  • One reading one line
  • To include network information we used Instrument field as "network" record and "Component" field for Instrument+Component, that is fully compatible with NLL

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: qml2nllphs.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)

Quickstart

Docker image

To obtain qml2nllphs docker image, you have two options:

1) Get built image from DockerHub (preferred)

Get the last built image from DockerHub repository:

$ docker pull ingv/qml2nllphs

2) Build by yourself

First, clone the git repository

$ git clone https://github.com/INGV/qml2nllphs.git
$ cd qml2nllphs
$ docker build --tag ingv/qml2nllphs .

in case of errors, try:

$ docker build --no-cache --pull --tag ingv/qml2nllphs .

Run docker

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/qml2nllphs

example:

$ docker run --rm --user $(id -u):$(id -g) -v $(pwd)/example:/opt/input ingv/qml2nllphs --qmlin /opt/input/quakeml.xml

Docker CLI

To override the ENTRYPOINT directive and enter into the Docker container, run:

$ docker run --rm -it --user $(id -u):$(id -g) --entrypoint=bash qml2nllphs

Update Docker image from DockerHub

Get last Docker image from DockerHub repository:

$ docker pull ingv/qml2nllphs

Example

2021-qml2nllphs

Contribute

Thanks to your contributions!

Here is a list of users who already contributed to this repository:

Author

(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