ObsPy compatibility

Pyrocko and ObsPy use different internal representations of waveforms, seismic events, and station metadata. To translate between the different representations, several converter functions are available in the compatibility module pyrocko.obspy_compat. For further convenience, it can add these converters as Python methods to the respective waveform, event, and station objects (pyrocko.obspy_compat.plant(), see for list of installed methods).

import obspy
from pyrocko import obspy_compat
obspy_compat.plant()

Using the Snuffler on obspy.Stream

This is how you use snuffle() on an obspy.Stream.

from pyrocko.example import get_example_data

import obspy
from pyrocko import obspy_compat
obspy_compat.plant()

get_example_data('test.mseed')
get_example_data('geeil.geofon.xml')

# Read in MiniSEED data through ObsPy
inv = obspy.read_inventory('geeil.geofon.xml')
stream = obspy.read('test.mseed')

# Start the Snuffler
stream.snuffle(inventory=inv)

Download obspy_compat_snuffle.py