Chapter 2 Prerequisites

This tutorial describes how to use Pyrocko Python based toolbox applications, such as Fomosto, Squirrel, and Grond, to compute the focal mechanisms for earthquakes. It also covers aspects such as waveform checking with ObsPy and Snuffler, focal mechanisms, beach ball plots, and creating maps with moment tensor solutions using PyGMT. Before starting, one needs to set up the system correctly; you have to install several software packages. It should be noted that the computations of the focal mechanisms were performed at the TU Delft Geoscience & Engineering server computer, which uses the RHEL system (Red Hat Enterprise Linux), waveform quality control, folders reorganisation for the Grond project, creation of the event files, and focal mechanisms plots were performed on macOS Sonoma (Mac M1 ARM). Therefore, two virtual environments created using conda are required for this tutorial.

2.1 Server machine environment

Follow these steps to install Fomosto, Pyrocko and required supplementary Python Packages:

  1. Install conda

    Before starting the waveform download, you need to setup up conda package and environment manager and the required dependencies. Let’s start with the Conda installation on your computer. You can download Conda from the official Anaconda website.

  2. Create the conda environment

    To create a virtual conda environment, use obsrocko.yml and the following command in your terminal:

    conda env create -f obsrocko.yml

  3. Activate the environment using

    conda activate obsrocko

Alternatively, the packages can be installed separately.

  1. Install conda:

    Before starting the waveform download, you need to setup up Conda and dependencies. Let’s start with the Conda installation on your computer. You can download Conda from the official Anaconda website.

  2. Install Pyrocko:

    conda install -c pyrocko pyrocko

More instructions on Pyrocko installation can be found on the Pyrocko installation manual webpage.

  1. Install Fomosto-Qseis:

    1. Clone GitHub repository:
    git clone https://git.pyrocko.org/pyrocko/fomosto-qseis.git
    1. Compile and install a package:
    autoreconf -i   # only if 'configure' script is missing
    ./configure
    make
    sudo make install

In addition, depending on the server machine, additional packages might be required for the successful installation. Therefore, to reproduce the environment correctly for Green’s Function computation using Fomosto Qseis and Grond for Moment tensor computations, we strongly recommend using obsrocko.yml.

2.2 Personal computer environment

To recreate an environment used for supplementary tasks, such as folders structure reorganisation for Grond’s project, quality control of the waveforms, creation of event files and plot the results of moment tensor inversion use the file gmtobsrocko.yml.

Follow these steps in order:

  1. Install conda

    Before starting the waveform download, you need to setup up conda and dependencies. Let’s start with the Conda installation on your computer. You can download Conda from the official Anaconda website. In case if you already successfully created obsrocko environment from Subchapter 2.1 you can skip this step.

  2. Create the conda environment

    To create a virtual conda environment, use environment.yml and the following command in your terminal:

    conda env create -f gmtobsrocko.yml

  3. Activate the environment using

    conda activate gmtobsrocko

Alternatively, all the packages can be installed separately:

  1. To Install obspy run one of the following commands:

    conda install conda-forge::obspy
    conda install conda-forge/label/broken::obspy
    conda install conda-forge/label/cf201901::obspy
    conda install conda-forge/label/cf202003::obspy
    conda install conda-forge/label/gcc7::obspy
  2. Install pygmt:

    conda install pygmt
  3. Install Pyrocko:

    conda install -c pyrocko pyrocko

More instructions on Pyrocko installation can be found on the Pyrocko installation manual webpage.