Skip to content
Nikolaos Triantafyllis edited this page Dec 22, 2021 · 22 revisions

Quick setup in terminal

# first you need to enter the source directory
cd src

# you can enable the execution flag to gisola.py (only needed once)
chmod +x ./gisola.py

# then you can run the program
./gisola.py

# otherwise you can run it (without the execution flag enabled)
python3 ./gisola.py

Usage Examples

Before running any command you need to set/calibrate the configuration file. Follow the instructions and example here.

Execute new MT computations

# Running Event-driven commands

# 1. calculate MT solution for two particular events (rest info retrieved from FDSNWS-event)
# use the event_id as the key to trigger a cerntain event
# bypass the default configuration file path (./config.yaml) and use another one
# bypass the default log file path (./log) and use another one
./gisola.py --event noa2020diego --event noa2021asfg -c config_realtime.yaml -l log_events

# 2. calculate MTs for all events found in datetime range (rest info retrieved from FDSNWS-event)
# restrictions such as magnitude threshold, regions and more are set in the default 
# configuration file (./config.yaml)
./gisola.py --datetime-range 2020-01-01T00:00:00 2021-01-01T00:00:00

# 3. calculate MT for particular event (without FDSNWS-event)
# use default configuration file (./config.yaml)
# hypocenter: datetime, magnitude, magnitude type, latitude, longitude, depth
./gisola.py --event 2021-04-25T15:13:39 3.0 ML 37.24 20.49 4.1

# 4. calculate MT for particular event (rest info retrieved from FDSNWS-event)
# bypass the default configuration file path (./config.yaml) and use another one
# override station selection and use the respective stations,
# from last station given, ignore the Z component
./gisola.py --event noa2020diego -c config_dense.yaml --station ATH KLV APE LIA..NE

# 5. calculate MT for a particular event (rest info retrieved from FDSNWS-event)
# bypass the default configuration file path (./config.yaml) and use another one
# remove respective stations and components from procedure,
# from last station given,remove only the Z component
# override crustal model and apply user-given
# override inversion frequencies
./gisola.py --event noa2020diego -c config_realtime.yaml --station KLV ATH..Z --remove
--crustal novotny.vz --frequency 0.04 0.05 0.08 0.09

# 6. calculate MT solutions for a seismic catalog described in QuakeML 
# (https://docs.obspy.org/packages/obspy.io.quakeml.html) format given in file
./gisola.py --event-xml ./catalog.xml

# 7. calculate MT solution for a seismic catalog in plain text. Each line
# of the file can have an event_id or the description as in example 3.
# Example of ./catalog file (> symbol highlights lines of file -do not add it file-):
# > noa2021diego
# > 2021-04-25T15:13:39 3.0 ML 37.24 20.49 4.1
# > # comment line
# > noa2021asfg
./gisola.py --event-file ./catalog

Execute quick MT Revisions

# Running Event-driven commands

# quick revision of an already calculated MT for a particular event (rest info retrieved from
FDSNWS-event)
# runs only inversions and results distributions (all previous steps such as data corrections, 
# Greens Functions computation and more are ignored)
# bypass the default configuration file path (./config.yaml) and use another one
# remove respective stations and components from procedure,
# from last station given, remove only the Z component
# compute inversions on specific frequencies range
./gisola.py --event noa2020diego -c config_realtime.yaml --station KLV ATH..Z --remove
--frequency 0.04 0.05 0.08 0.09 --revise

Listen for upcoming events

The below command needs to be combined with a tool such as the cron utility to matters.

# listens to an FDSNWS-event for new incoming events 
# (with the restrictions provided in the ./config.yaml)
./gisola.py --real-time

Cron Job Examples

# 1. every minute listen to an FDSNWS-event for new incoming events
# (with the restrictions provided in the ./config.yaml)
# add in crontab:
SHELL=/bin/bash
* * * * * source /home/gisola/.bash_profile; cd /home/gisola/gisola/src; python3 ./gisola.py --real-time;

# 2. every 15 sec listen to an FDSNWS-event for new incoming events
# (with the restrictions provided in the ./config.yaml)
# add in crontab:
SHELL=/bin/bash
* * * * * source /home/gisola/.bash_profile; cd /home/gisola/gisola/src; python3 ./gisola.py --real-time; sleep 15; python3 ./gisola.py --real-time; sleep 15; python3 ./gisola.py --real-time; sleep 15; python3 ./gisola.py --real-time; 

Web Suite

The web suite is re-generated to append a new/modified MT solution automatically when computation is finished. However, the user operator might consider for instance to delete an event. To do this, he has to delete the event folder (e.g. noa2020diego) and then re-generate the web suite pages manually. Then in the terminal, he has to run:

# use the year of the event
# bypass the default configuration file path (./config.yaml) and use another one
./gisola.py --home 2020 -c config_realtime.yaml

A case also where this command is needed is when the operator wants to generate a web page with the MT computations of all the years together. This command does not run automatically when a MT computation is finished because it is an expensive task. However, the operator can add it in a cron-jon to run e.g. daily or after the MT computation is finished by adding it in the user-defined script (see here).

# generate all years
# takes a significant amount of time
./gisola.py --home all

Help Menu

# view the command options
./gisola.py -h
# and retrieve the following output

  ____ _           _       
 / ___(_)___  ___ | | __ _ 
| |  _| / __|/ _ \| |/ _` |
| |_| | \__ \ (_) | | (_| |
 \____|_|___/\___/|_|\__,_|
                           
R e a l – T i m e   M o m e n t   T e n s o r   C o m p u t a t i o n

Version: 1.0
License: GPLv3
Author: Nikolaos Triantafyllis (triantafyl@noa.gr)
Credits: Nikolaos Triantafyllis (triantafyl@noa.gr), Ioannis Venetis
(venetis@unipi.gr), Ioannis Fountoulakis (ifountoul@noa.gr), Erion-
Vasilis Pikoulis (pikoulis@ceid.upatras.gr), Efthimios Sokos
(esokos@upatras.gr), Christos Evangelidis (cevan@noa.gr)
🄯 2021, Institute of Geodynamics - National Observatory of Athens

usage: Gisola [-h] [-c [FILEPATH]] [-e EVENT [EVENT ...]] [--event-file FILEPATH]
              [--event-xml FILEPATH] [-d TIME TIME] [--real-time] [--home YEAR]
              [-s STA[.NEZ] [STA[.NEZ] ...]] [--remove] [--disable-filters]
              [-cru FILEPATH [FILEPATH ...]] [-dist STRING STRING STRING STRING]
              [-tl FLOAT] [-ts INT INT INT] [-f FLOAT FLOAT FLOAT FLOAT] [-r]
              [-l [FILEPATH]] [-v]

Real-Time Moment Tensor Computation
Find more info at: https://github.com/nikosT/Gisola

optional arguments:
  -h, --help            show this help message and exit
  -c [FILEPATH], --config [FILEPATH]
                        override default configuration file (./config.yaml)
  -e EVENT [EVENT ...], --event EVENT [EVENT ...]
                        EVENT can be in any of the following formats: (i) DATETIME
                        MAGNITUDE TYPE LATITUDE LONGITUDE DEPTH e.g.:
                        /home/gisola/gisola/src/./gisola.py -e
                        2021-08-31T16:06:53.311700 3.0 ML 37.24 20.49 4.1 (ii) DATETIME
                        e.g.: /home/gisola/gisola/src/./gisola.py -e
                        2021-08-31T16:06:53.311708 (iii) EVENTID (event identifiers are
                        data center specific) e.g.: /home/gisola/gisola/src/./gisola.py
                        -e noa2020owyrp In cases (ii) and (iii) the rest of the
                        information is retrieved by the FDSNWS-event In more than one
                        results, only the first event is returned Passing milliseconds
                        is optional Passing more events is also possible using -e or
                        --event prefix for each event
  --event-file FILEPATH
                        parse and run a file with EVENT lines
  --event-xml FILEPATH  parse and run a file in QuakeML
  -d TIME TIME, --datetime-range TIME TIME
                        invoke MT computation for all events found in specific datetime
                        range (FDSN bounded)
  --real-time           invoke --datetime-range for real-time use (FDSN bounded)
  --home YEAR           Render Home page for a particular year (based on config.yaml
                        results dir)
  -s STA[.NEZ] [STA[.NEZ] ...], --station STA[.NEZ] [STA[.NEZ] ...]
                        override default stations selection. Optionally, components
                        could be also specified. It can be combined with --remove for
                        the reverse result
  --remove              it can only be used with --station. Invokes reverse result
  --disable-filters     disable all filter checks in the process
  -cru FILEPATH [FILEPATH ...], --crustal FILEPATH [FILEPATH ...]
                        override default crustal models
  -dist STRING STRING STRING STRING, --distance STRING STRING STRING STRING
                        override default distance rule
  -tl FLOAT, --time-window FLOAT
                        override default inversion time-window
  -ts INT INT INT, --time-shift INT INT INT
                        override default time search grid
  -f FLOAT FLOAT FLOAT FLOAT, --frequency FLOAT FLOAT FLOAT FLOAT
                        override default inversion frequency band
  -r, --revise          Trigger revised MT procedure. Computation assumes all available
                        input exists (e.g. Greens' Functions) and runs only the
                        inversion and plot procedures. Only --frequency, --time-shift,
                        --station (--remove), --config
  -l [FILEPATH], --log [FILEPATH]
                        override default main log file (./log)
  -v, --version         show program's version number and exit

Comments

  • Each WorkDir in configuration defines the working space where results and web suite will be delivered.
  • If new MT computation is re-run in the same working space, the latest computation will be considered.
  • Most of the commands can be triggered in long and in short mode (e.g. -e or --event).
  • Event commands (--event, --event-xml, --event-file, --datetime-range) can be combined together.
  • The Station command --station can be used multiple times and can be inverted by attaching the --remove. However, running both --station and --station --remove on the same execution is not possible.
  • You can use multiple simultaneous cron-jobs in order to run different configuration files. This could be useful if you want to run different setups based on (i) regions, (ii) quality (sparse/dense 4D MT grid search), (iii) event catalog (FDSNWS-event service)
  • If you would like to view all MT solutions even when Quality Threshold is enabled, append "?show=1" at the end of the Gisola Map URL.

PPSD tool (offline use)

  • As a side product to Gisola, PPSD tool is implemented, so that the operator can determine frequently (e.g. daily) the quality of its network and stations (based on the PPSD metric and the determined threshold).

Usage Example

  • Run application once per day and create a folder with the quality (based on PPSD) of the specific station.
cd /home/user/tools/ppsd_app; 
python3 ./ppsd_app.py -c ../../src/config.yaml
  • Folder should be updated frequently (e.g. daily) with a cron job.
@daily source /home/user/.bash_profile; 

View the real-time operation in the Institute of Geodynamics of the National Observatory of Athens (NOA), Greece

Clone this wiki locally