This is an intro to some basic tasks in seismology, performed in the python package obspy. Obspy has extensive documentation, tutorials and even a sandbox to play in, but if you are completely new to obspy, you may find the following useful.
Installations
I am going to assume you only have python on your computer, but if you have obspy and jupyter running, you can skip this section.
To get the necessary packages, I strongly encourage the use of the conda package manager. To install conda, go here.
After that, getting different python packages is a breeze. To get 2D plotting tools from matplotlib, type on the command line:
conda install matplotlib
cartopy can be used to plot maps (there are others, such as basemap):
conda install cartopy
To get obspy, follow these simple instructions.
The following tutorials will be run in jupyter:
conda install jupyter
After this, you can run a jupyter notebook, by typing on the command line:
jupyter notebook nameofyournotebook.ipynb
These notebooks are meant to illustrate the use of obspy, in this case, but you can export the results of a jupyter notebook to html, or pdf, and even to a .py file, as a “clean” python programme.
Workflow
Let’s break down a basic seismology workflow into the tasks below. Each is a hyperlink to a notebook.
- Building a catalogue of Earthquakes first notebook, run “jupyter notebook create_catalogue.ipynb”,
- Creating an inventory of stations — with their instrument response — that recorded these events,
- Retrieving seismic data from the stations in the inventory from the events in the catalogue, and performing an instrument response correction.
Comments are closed.