GithubHelp home page GithubHelp logo

ingv / qml2nllphs Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 0.0 123 KB

QuakeML to NonLinLoc PHS

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 3.31% Shell 2.34% Python 94.35%
ingv docker science earthquakes earthquake-data

qml2nllphs's Introduction

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

qml2nllphs's People

Contributors

actarus2971 avatar vlauciani avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qml2nllphs's Issues

argument must be a string or a number, not 'NoneType'

@actarus2971 provando a convertire il file in allegato, si riceve:

$ docker run . . .
configparser loaded
Traceback (most recent call last):
  File "/opt/qml2nllphs.py", line 443, in <module>
    print(qml2location(OT,ola,ola_u,olo,olo_u,ode,ode_u,qual,pref_mag,region))
  File "/opt/qml2nllphs.py", line 307, in qml2location
    mindist=float(q['minimum_distance'])*100.0
TypeError: float() argument must be a string or a number, not 'NoneType'

Immagino che il problema sia il QuakeML che e' di una 200...

20180110-025133__18013811__INGV-EVENT.qml.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.