API Overview

ObsPy’s functionality is provided through the following packages.

General Packages

This section lists the core package that ties everything together as well as other general packages and packages that don’t fit it any of the other categories.

obspy.core

obspy.core - Core classes of ObsPy

obspy.geodetics

obspy.geodetics - Various geodetic utilities for ObsPy

obspy.imaging

obspy.imaging - Plotting routines for ObsPy This module provides routines for plotting and displaying often used in seismology. It can currently plot waveform data, generate spectrograms and draw beachballs. The module obspy.imaging depends on the plotting module matplotlib.

obspy.realtime

obspy.realtime - Real time support for ObsPy

obspy.signal

obspy.signal - Signal processing routines for ObsPy Capabilities include filtering, triggering, rotation, instrument correction and coordinate transformations.

obspy.taup

obspy.taup - Ray theoretical travel times and paths

Scripts

All command-line scripts shipping with ObsPy.

obspy.scripts.flinnengdahl

Get the Flinn-Engdahl region name from longitude and latitude.

obspy.scripts.runtests

A command-line program that runs all ObsPy tests.

obspy.scripts.reftekrescue

Restore REFTEK data from raw binary data dumps.

obspy.scripts.print

Print stream information for waveform data in local files.

obspy.scripts.sds_html_report

Build a quality control HTML page.

obspy.imaging.scripts.scan

Scan a directory to determine the data availability.

obspy.imaging.scripts.plot

Simple script to plot waveforms in one or more files.

obspy.imaging.scripts.mopad

MoPaD command line utility.

obspy.io.mseed.scripts.recordanalyzer

A command-line tool to analyze Mini-SEED records.

obspy.io.xseed.scripts.dataless2xseed

A command-line program that converts Dataless SEED into XML-SEED files.

obspy.io.xseed.scripts.xseed2dataless

A command-line program that converts XML-SEED into Dataless SEED files.

obspy.io.xseed.scripts.dataless2resp

A command-line program that converts Dataless SEED into RESP files.

Database or Web Service Access Clients

All ObsPy clients enabling remote and local access to data.

obspy.clients.earthworm

obspy.clients.earthworm - Earthworm Wave Server client for ObsPy.

obspy.clients.fdsn

obspy.clients.fdsn - FDSN web service client for ObsPy The obspy.clients.fdsn package contains a client to access web servers that implement the FDSN web service definitions.

obspy.clients.filesystem

obspy.clients.filesystem - Local filesystem (SDS or TSINDEX) client for ObsPy This package provides read support for some local directory structures.

obspy.clients.iris

obspy.clients.iris - EarthScope (former IRIS) web service client for ObsPy The obspy.clients.iris package contains a client for the DMC Web services provided by EarthScope (former IRIS) (https://service.iris.edu/irisws/).

obspy.clients.neic

obspy.clients.neic - CWB query module for ObsPy The obspy.clients.neic package contains a client for the NEIC CWB Query server. A public server is at 137.227.224.97 (cwbpub.cr.usgs.gov) on port 2061.

obspy.clients.nrl

obspy.clients.nrl - Nominal Response Library client for ObsPy

obspy.clients.seedlink

obspy.clients.seedlink - SeedLink client for ObsPy

obspy.clients.syngine

obspy.clients.syngine - EarthScope/IRIS Syngine client for ObsPy

Waveform Import/Export Plug-ins

Warning

In most cases these modules do not need to be called directly. They register via the central ObsPy read() function - call this instead.

Usage Example:

import obspy
# Format will be detected automatically.
st = obspy.read("/path/to/file")
# Many formats can also be written out - just use the module name.
st.write("/path/to/outfile", format="mseed")

obspy.io.ah

obspy.io.ah - AH (Ad Hoc) read support for ObsPy This module provides read support for the AH (Ad Hoc) waveform format introduced by the Lamont-Doherty Geological Observatory.

obspy.io.alsep

obspy.io.alsep - Apollo seismic data support for ObsPy

obspy.io.ascii

obspy.io.ascii - SLIST and TSPAIR support for ObsPy

obspy.io.css

obspy.io.css - CSS read support for ObsPy This module provides read support for CSS waveform data.

obspy.io.cybershake

obspy.io.cybershake - CyberShake read support for ObsPy This module provides read support for the CyberShake waveform data format.

obspy.io.dmx

obspy.io.dmc - INGV DMX file format reader for ObsPy

obspy.io.gcf

obspy.io.gcf - Guralp Compressed Format, GCF, read and write support for ObsPy This module provides read and write support for GCF waveform data and header info acording to GCF Reference SWA-RFC-GCFR Issue F, December 2021

obspy.io.gse2

obspy.io.gse2 - GSE2/GSE1 and GSE2 bulletin support for ObsPy This module provides read and write support for GSE2 CM6 compressed as well as GSE1 CM6/INT waveform data and header info. Most methods are based on the C library GSE_UTI of Stefan Stange, which is interfaced via Python ctypes.

obspy.io.kinemetrics

obspy.io.kinemetrics - Evt format support for ObsPy

obspy.io.mseed

obspy.io.mseed - MiniSEED read and write support for ObsPy This module provides read and write support for the MiniSEED (and the data part of full SEED) waveform data format and some other convenient methods to handle MiniSEED files. It utilizes libmseed, a C library by Chad Trabant.

obspy.io.nied.knet

obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy Reading of the K-NET and KiK-net ASCII format as defined on http://www.kyoshin.bosai.go.jp.

obspy.io.pdas

obspy.io.pdas - PDAS file read support for ObsPy

obspy.io.reftek

obspy.io.reftek - REFTEK130 read support for ObsPy

obspy.io.rg16

obspy.io.rg16 - Receiver Gather v1.6 read support for ObsPy

obspy.io.sac

obspy.io.sac - SAC read and write support for ObsPy This module provides read and write support for ASCII and binary SAC-files as defined by EarthScope (https://ds.iris.edu/files/sac-manual/).

obspy.io.seisan

obspy.io.seisan - SEISAN read support for ObsPy

obspy.io.seg2

obspy.io.seg2 - SEG-2 read support for ObsPy

obspy.io.segy

obspy.io.segy - SEG Y and SU read and write support for ObsPy

obspy.io.sh

obspy.io.sh - Q and ASC read and write, EVT read support (Seismic Handler)

obspy.io.wav

obspy.io.wav - WAV (audio) read and write support for ObsPy

obspy.io.win

obspy.io.win - WIN read support for ObsPy This module provides read support for WIN waveform data. This format is written by different dataloggers, including Hakusan LS-7000XT Datamark dataloggers. There are two subformats, A0 and A1. To our knowledge, A0 is the only one supported with the current code. A0 conforms to the data format of the WIN system developed by Earthquake Research Institute (ERI), the University of Tokyo.

obspy.io.y

obspy.io.y - Nanometrics Y file read support for ObsPy

Event Data Import/Export Plug-ins

Warning

In most cases these modules do not need to be called directly. They register via the central ObsPy read_events() function - call this instead.

Usage Example:

import obspy
# Format will be detected automatically.
cat = obspy.read_events("/path/to/file")
# Many formats can also be written out - just use the module name.
cat.write("/path/to/outfile", format="quakeml")

obspy.io.cmtsolution

obspy.io.cmtsolution - CMTSOLUTION file format support for ObsPy

obspy.io.cnv

obspy.io.cnv - CNV file format support for ObsPy

obspy.io.csv

obspy.io.csv - CSV, CSZ and EVENTTXT read/write support for earthquake catalogs

obspy.io.focmec

obspy.io.focmec - FOCMEC file format support for ObsPy

obspy.io.gse2

obspy.io.gse2 - GSE2/GSE1 and GSE2 bulletin support for ObsPy This module provides read and write support for GSE2 CM6 compressed as well as GSE1 CM6/INT waveform data and header info. Most methods are based on the C library GSE_UTI of Stefan Stange, which is interfaced via Python ctypes.

obspy.io.hypodd

obspy.io.hypodd - HypoDD read support for ObsPy

obspy.io.iaspei

obspy.io.iaspei - Read support for IASPEI formats

obspy.io.json

obspy.io.json - JSON write support for ObsPy

obspy.io.kml

obspy.io.kml - Keyhole Markup Language (KML) write support for ObsPy This module provides write support for the Keyhole Markup Language (KML) format.

obspy.io.ndk

obspy.io.ndk - NDK file support for ObsPy

obspy.io.nied.fnetmt

obspy.io.nied.fnet - F-net moment tensor file read support for ObsPy F-net moment tensor file format support for ObsPy.

obspy.io.nied.knet

obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy Reading of the K-NET and KiK-net ASCII format as defined on http://www.kyoshin.bosai.go.jp.

obspy.io.nlloc

obspy.io.nlloc - NonLinLoc file format support for ObsPy

obspy.io.nordic

obspy.io.nordic - Nordic file format support for ObsPy

obspy.io.pde

obspy.io.pde - NEIC PDE Bulletin read support for ObsPy

obspy.io.quakeml

obspy.io.quakeml - QuakeML read and write support for ObsPy

obspy.io.scardec

obspy.io.scardec - SCARDEC file format support for ObsPy

obspy.io.seiscomp

obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy :2: (WARNING/2) Title underline too short. obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy ========================================================================

obspy.io.shapefile

obspy.io.shapefile - ESRI shapefile write support for ObsPy This module provides write support for the ESRI shapefile format.

obspy.io.zmap

obspy.io.zmap - ZMAP read and write support for ObsPy

Inventory Data Import/Export Plug-ins

Warning

In most cases these modules do not need to be called directly. They register via the central ObsPy read_inventory() function - call this instead.

Usage Example:

import obspy
# Format will be detected automatically.
inv = obspy.read_inventory("/path/to/file")
# Many formats can also be written out - just use the module name.
inv.write("/path/to/outfile", format="stationxml")

obspy.io.css

obspy.io.css - CSS read support for ObsPy This module provides read support for CSS waveform data.

obspy.io.kml

obspy.io.kml - Keyhole Markup Language (KML) write support for ObsPy This module provides write support for the Keyhole Markup Language (KML) format.

obspy.io.sac.sacpz

obspy.io.sac.sacpz - SACPZ write support for ObsPy

obspy.io.seiscomp

obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy :2: (WARNING/2) Title underline too short. obspy.io.seiscomp - SeisComP XML inventory and event file support for ObsPy ========================================================================

obspy.io.shapefile

obspy.io.shapefile - ESRI shapefile write support for ObsPy This module provides write support for the ESRI shapefile format.

obspy.io.stationtxt

obspy.io.stationtxt - FDSNWS station text file read and write support for ObsPy

obspy.io.stationxml

obspy.io.stationxml - StationXML read and write support for ObsPy

obspy.io.xseed

obspy.io.xseed - (X)SEED and RESP support for ObsPy XML-SEED was introduced by Tsuboi, Tromp and Komatitsch (2004), it is a XML representation of Dataless SEED. This module contains converters from Dataless SEED to XML-SEED and vice versa as well as a converter from Dataless SEED to RESP files. The xseed module is tested against the complete ORFEUS Dataless SEED archive, the EarthScope/IRIS (US) Dataless SEED archive and against ArcLink response requests.