0% found this document useful (0 votes)
123 views51 pages

Obspy Overview

This document provides an overview of ObsPy, an open-source Python toolbox for seismology. ObsPy facilitates working with seismological data formats and processing workflows. It provides file input/output support for common seismic data formats and clients to access data from seismic networks. ObsPy's core classes allow uniform handling of waveform, station metadata, and event catalog data. It also includes capabilities for basic signal processing, array analysis, cross correlations, and plotting of seismic data. ObsPy lowers barriers to seismological programming by providing a unified interface and leveraging capabilities of the wider scientific Python ecosystem.

Uploaded by

Ann Yaab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views51 pages

Obspy Overview

This document provides an overview of ObsPy, an open-source Python toolbox for seismology. ObsPy facilitates working with seismological data formats and processing workflows. It provides file input/output support for common seismic data formats and clients to access data from seismic networks. ObsPy's core classes allow uniform handling of waveform, station metadata, and event catalog data. It also includes capabilities for basic signal processing, array analysis, cross correlations, and plotting of seismic data. ObsPy lowers barriers to seismological programming by providing a unified interface and leveraging capabilities of the wider scientific Python ecosystem.

Uploaded by

Ann Yaab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

ObsPy: A Python Toolbox for Seismology

Current State, Applications, and Ecosystem


Around it

Lion Krischer

July 1st 2015


Contributors. Probably incomplete!

Adolfo Inza
Alberto Michelini

Alessia Maggi
Andreas Köhler

Anthony Lomax
Arthur Snoke

Bernhard Morgenstern
Benjamin Sullivan

Charles J. Ammon
Chad Trabant

Christian Sippl
Chris Scheingraber

Conny Hammer
Claudio Satriano

Elliott Sales de Andrade David Ketchum

Emanuel Antunes
Emiliano Russo

Fabian Engels
Felix Bernauer

Gaute Hope
Heiner Igel

Joachim Saul
Henri Martin

John Leeman
Joachim Wassermann

Lars Krieger
Laura Ermert

Lion Krischer Leonardo Uieda

Marcus Walther
Lukas Heiniger

Marc Grunberg
Marius Isken

Martin van Driel


Mark Williams

Nathaniel C. Miller
Moritz Beyreuther
Nicolas Rothenhäusler
Paul Käufl

Peter Danecek
Philippe Lesage

Robert Barsch Sebastian Heimann

Seyed Kasra Hosseini Zad


Simon Kremers

Stefan Stange
Sven Egdorf

Sébastien Bonaimé
Thomas Lecocq

Tobias Megies Tom Richter

Tommaso Fabbri
Victor Kress

Yannik Behr
Ólafur St. Arnarsson
Schedule

Now: Talk

Afternoon: Practical
Schedule

Now: Talk

Motivation and Python in Science

ObsPy

Applications

Community

Afternoon: Practical
Why Does This Matter?

Science requires Tools!

Important in Seismology

vb
Eases Your Life!
vb
Why Python?

• Widely used in all areas, picking up lots of momentum in


many sciences
• Backed by a number of leading technology companies
• Simple, concise, and easy-to-read syntax
• Free and Open Source, large scientific community
➭ potentially high impact / user base
• General purpose programming language
• Cross-platform: from RaspberryPi to large supercomputers
Why Python?

• No need to compile; interactive shell available

• Easy to interact with existing C and Fortran code

• Huge web development ecosystem

• Large “big data” community using Python

• Vast scientific ecosystem; taking advantage of


developments in other sciences
Alternatives
Scientific Python

NumPy SciPy matplotlib


Scientific Python

NumPy SciPy matplotlib


ObsPy
What is ObsPy?

• Python library to work with seismological data


• Waveform data

• Station metadata

• Event metadata

• Facilitates development
• from short code snippets

• to complex processing workflows

• Develop once, use everywhere

A bridge for seismologists into the scientific Python ecosystem


Seismological Processing

What I need is..

• I/O of local data

• fetch data/metadata from data centers

• convenient handling of the parsed data/metadata

• basic signal processing / data analysis / math

• visualization capabilities
Functionality
File Formats & I/O
File Formats & I/O

Situation without ObsPy


File Formats & I/O

Situation with ObsPy

>>> import obspy


>>> st = obspy.read("/path/to/file")

• Automatic File Format Detection


• Always ends up the same object
• Works with zipped files, URLs, …
File Formats & I/O

read/write support for lots of formats:

• waveforms (MiniSEED, GSE2, SAC, …)

• many different ways to store binary/encoded timeseries

• station metadata ((X)SEED, StationXML, RESP)

• complex, esp. instrument response

• event metadata (QuakeML, NDK, PDE)

• complex associations, owed to how data is assembled in


realtime systems
File Formats in ObsPy
Data Acquisition
Data Center Clients

• FDSN web service client


• IRIS, Orfeus, USGS, RESIF, NCEDC, INGV, ...
• ArcLink client
• SeedLink
• Earthworm
•…

different types of servers, but usage of clients very similar


ObsPy’s Core Classes
Stream/Trace for Waveforms

>>> import obspy


>>> st = obspy.read("/path/to/file")

>>> st.plot()
Stream/Trace for Waveforms
Inventory for Station Metainformation

>>> import obspy


>>> inv = obspy.read_inventory(“/path/to/file")

>>> inv.plot()
Inventory for Station Metainformation
Catalog for Events

>>> import obspy


>>> cat = obspy.readEvents(“/path/to/file")

>>> cat.plot()
Catalog for Events
Signal Processing and Plotting
Signal Processing and Plotting

Basic signal processing:


• trim, merge, rotate, ...

• filter, resample, instrument correction

• array analysis, cross correlations

• different types of triggers

• probabilistic power spectral densities

• …

Basic plotting:
• waveform preview plots

• stations/events location plots

• channel instrument response plots (bode plots)


Showcase
Wrap C and Fortran codes
Wrap C and Fortran codes

3rd party code:


• don’t reinvent the wheel

• reuse well established and maintained code

we use:
• NumPy: fast array operations (BLAS and Lapack)
• SciPy: signal processing routines (UMFPACK, …)

• libmseed: MiniSEED I/O (IRIS)


• evalresp: instrument correction (ISTI/IRIS)
• GSE_UTI: GSE2 I/O (Stange et al.)
ObsPy Stack

NumPy SciPy matplotlib


ObsPy Stack

MSNoise
Mission Statement

“The goal of the ObsPy project is to facilitate rapid


application development for seismology.”
MSNoise

• A Python Package for Monitoring


Seismic Velocity Changes using
Ambient Seismic Noise
MSNoise
• Runs continuously on a couple sides
world-wide

blob/master/doc/.static/
ROBelgium/MSNoise/
interferogram.png?

https://github.com/
raw=true
www.msnoise.org

Lecocq, T., Caudron, C., & Brenguier, F. (2014).


MSNoise, a Python Package for Monitoring Seismic Velocity
Changes Using Ambient Seismic Noise.
Seismological Research Letters, 85(3), 715–726.
Instaseis

• Rapid generation of high-frequency


seismograms in a 1D background
model

www.instaseis.net

van Driel, M., Krischer, L., Stähler, S. C., Hosseini, K., and
Nissen-Meyer, T. (2015). Instaseis: instant global seismograms
based on a broadband waveform database.
Solid Earth. 6, 701-717
Scisola

• Software for automatic moment


tensor calculation of events which
are provided in real time by
SeisComP3

http://students.ceid.upatras.gr/
~triantafyl/scisola/
LASIF

• Framework to deal with data


handling, organization, and
provenance in the context of iterative
inversions

• Enhances reproducibility

• Enables collaboration

• Aims to significantly reduce the time


to research

www.lasif.net

Lion Krischer, Andreas Fichtner, Saule Zukauskaite, and Heiner


Igel (2015), Large‐Scale Seismic Inversion Framework,
Seismological Research Letters, doi:10.1785/0220140248.

Lots of other stuff
Final Words

Usage and Community


Development

• Around 45 people contributed code

• ~ 8000 commits

• ~ 1200 tests

• Tested multiple times per day on


around 15 different platforms

• > 1000 GitHub Issues


Documentation

docs.obspy.org
Installation

$ conda install -c obspy obspy

Installers/Packages for many platforms as well


Do People Use It?

Each point represents one city where at least one


person used ObsPy to download data from IRIS.

Mailing List GitHub

Python Package Index Conda Installations


Publications using ObsPy

• Currently ~ 125

• Many don’t cite us :-(

• Applications include event (re)locations, ambient seismic noise


analysis, seismic tomography, rotational seismology studies,
time-dependent seismology, big data processing, attenuation MacCarthy, J. K., &
Rowe, C. a. (2014).

kernels, … Pisces: A Practical


Seismological Database
Library in Python.
Seismological Research
Letters, 85(4), 905–911.

Richter, T., Sens-Schönfelder,


Hadziioannou, C., Gaebler, P., Fichtner, A., & van Driel, M. C., Kind, R., & Asch, G.
Grigoli, F., Cesca, S., Amoroso, O.,
Schreiber, U., Wassermann, J., & (2014). Models and Frechet (2014). Journal of
Emolo, A., Zollo, A., & Dahm, T.
Igel, H. (2012). Examining kernels for frequency- Geophysical Research : Solid
(2013). Automated seismic event
ambient noise using colocated (in)dependent Q. Geophysical Earth Comprehensive
location by waveform coherence
measurements of rotational and Journal International, 198(3), observation and modeling of
analysis. Geophysical Journal
translational motion. Journal of 1878–1889. earthquake and temperature-
International, 196(3), 1742–1753.
Seismology, 16(4), 787–796. related seismic velocity
changes in northern Chile
with passive image
interferometry, 4747–4765.
Timeline

70
number of contributors (cumulative)
number of scientific citations (cumulative)
60 current number of mailing list subscriptions (divided by 5)
current percentage of non-core-developer commits

50

40

30

20

10

0
0 9 1 0 1 1 1 2 1 3 1 4
20 20 20 20 20 20
Who Pays?

No formal funding ever!


Get Involved!

There is always stuff to do.

We need new people to sustain this.

True community project!


[obspy-users] mailing list: [email protected]

file://localhost/Users/lion/Library/
Containers/
http://www.obspy.org

com.shinyplasticbag.DragonDrop/
Thank you

Data/Library/Caches/
com.shinyplasticbag.DragonDrop/ @obspy
obspy
454672417638.tiff file://localhost/
Users/lion/Library/Containers/
com.shinyplasticbag.DragonDrop/
Data/Library/Caches/
com.shinyplasticbag.DragonDrop/
45467242674 https://assets-
cdn.github.com/images/modules/
logos_page/GitHub-Mark.png 1.tiff

You might also like