Python code to calculate ML with different methods and attenuation functions.
3.7K
Python code, complementary to pyamp or REI, to calculate ML with different methods and attenuation functions.
First, clone the git repository
git clone https://github.com/INGV/pyml.git
cd pyml
docker build --tag ingv/pyml .
in case of errors, try:
docker build --no-cache --pull --tag ingv/pyml .
To run the container, use the command below; the -v option is used to "mount" working directory into container:
docker run --rm -v $(pwd)/examples/input:/opt/data ingv/pyml --in_file_name /opt/data/eventid_28745631.json --in_file_format json --out_format json
Station azimuths are measured from the station toward the event. A bearing of
0.0 degrees is valid and is returned as a JSON number on both horizontal
components. An azimuth or angular distance that was not calculated is returned
as JSON null. Zero latitude, longitude and elevation are valid metadata;
stations with missing coordinates or elevation are omitted from the
stationmagnitudes list.
With the Python dependencies listed in Dockerfile installed, run:
python3 -m unittest discover -s tests -v
The tests run the complete CLI in temporary directories. They cover the CPTP zero-azimuth regression reported in REI issue #684, nonzero bearings, sea-level and zero-coordinate stations, missing metadata, and unchanged magnitude results.
Thanks to your contributions!
Here is a list of users who already contributed to this repository:
(c) 2025 Raffaele Distefano raffaele.distefano[at]ingv.it
(c) 2025 Valentino Lauciani valentino.lauciani[at]ingv.it
Istituto Nazionale di Geofisica e Vulcanologia, Italia
Content type
Image
Digest
sha256:c1de55726…
Size
490.6 MB
Last updated
over 1 year ago
docker pull ingv/pyml