This module provides basic compatibility between ObsPy and Pyrocko.
The functions defined here can be used to translate back and forth some of the
basic objects in Pyrocko and ObsPy. It also provides shortcuts to quickly look
at ObsPy waveforms with the Pyrocko’s Snuffler
pyrocko.obspy_compat.plant() several new methods are attached to
Pyrocko and ObsPy classes.
Example, visualize ObsPy stream object with Snuffler:
import obspy from pyrocko import obspy_compat obspy_compat.plant() stream = obspy.read() # returns some example data stream.snuffle()
– With best wishes to the ObsPy Team from the Pyrocko Developers!
This is an experimental module, the interface may still be changed. Feedback and discussion welcome!
Convert ObsPy trace object to Pyrocko trace object.
Convert ObsPy stream object to list of Pyrocko trace objects.
Convert ObsPy catalog object to list of Pyrocko event objects.
Noneif catalog is
Convert ObsPy inventory to list of Pyrocko traces.
Noneif inventory is
Convert Pyrocko pile to ObsPy stream.
snuffle(stream_or_trace, inventory=None, catalog=None, **kwargs)¶
Explore ObsPy data with Snuffler.
(return_tag, markers), where
return_tagis the a string to flag how the Snuffler window has been closed and
markersis a list of
This function displays an ObsPy stream object in Snuffler. It returns to the caller once the window has been closed. The
return_tagreturned by the function can be used as a primitive way to communicate a user decision to the calling script. By default it returns the key pressed to close the window (if any), either
'x', but the value could be customized when the exit is triggered from within a Snuffling.
fiddle()for a variant of this function returning an interactively modified ObsPy stream object.
fiddle(stream_or_trace, inventory=None, catalog=None, **kwargs)¶
Manipulate ObsPy stream object interactively.
This function displays an ObsPy stream object in Snuffler like
snuffle(), but additionally adds a Snuffling panel to apply some basic ObsPy signal processing to the contained traces. The applied changes are handed back to the caller as a modified copy of the stream object.
import obspy from pyrocko import obspy_compat obspy_compat.plant() stream = obspy.read() stream_filtered = stream.fiddle() # returns once window has been # closed
Add conversion functions as methods to ObsPy and Pyrocko classes.
Methods added to ObsPy classes are:
Methods added to Pyrocko classes are: