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.
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.
After that, getting different python packages is a breeze. To get 2D plotting tools from matplotlib, type on the command line:
conda install matplotlib
Python’s answers to GIS or Generic Mapping Tool (GMT) is cartopy (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.
Let’s break down a basic seismology workflow into the tasks below. Each is a hyperlink to a notebook. To run the first notebook, for example, download it, and run “jupyter notebook create_catalogue.ipynb”
- Reading and writing a catalogue of events
- 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
- Annotating these data with taup-predicted arrival times, based on station and event location and origin time.