Browse Source

docs upd

qmlexport
miili 4 years ago
committed by Sebastian Heimann
parent
commit
34a7b01f70
  1. 2
      .gitignore
  2. 4
      doc/source/apps/cake/index.rst
  3. 4
      doc/source/apps/colosseo/index.rst
  4. 4
      doc/source/apps/fomosto/index.rst
  5. 4
      doc/source/apps/jackseis/index.rst
  6. 4
      doc/source/apps/snuffler/index.rst
  7. 2
      doc/source/conf.py
  8. 1
      doc/source/library/examples/index.rst
  9. 58
      doc/source/library/examples/obspy_compat.rst
  10. 2
      doc/source/library/reference/gui.rst
  11. 9
      doc/source/library/reference/obspy_compat.rst
  12. 6
      examples/obspy_compat_snuffle.py
  13. 4
      src/obspy_compat/base.py

2
.gitignore

@ -37,3 +37,5 @@ pip-pyrocko.git/
pyrocko.git/
.vagrant/
pyrocko-test-data/
*.log

4
doc/source/apps/cake/index.rst

@ -1,5 +1,5 @@
Cake
====
Cake - *Arrival Times and Raytracing in 1D*
===========================================
Cake is a command line tool contained in Pyrocko, which can solve some
classical seismic ray theory problems for 1D layered earth models (layer cake

4
doc/source/apps/colosseo/index.rst

@ -1,5 +1,5 @@
Colosseo
========
Colosseo - *Earthquake Scenario Generator*
==========================================
.. highlight:: sh

4
doc/source/apps/fomosto/index.rst

@ -1,5 +1,5 @@
Fomosto
=======
Fomosto - *The Green's Function Database*
=========================================
Fomosto is a command line tool contained in the Pyrocko package to manage
pre-calculated Green's function stores.

4
doc/source/apps/jackseis/index.rst

@ -1,5 +1,5 @@
Jackseis
========
Jackseis - *Manipulate Seismic Waveform Archives*
=================================================
.. highlight:: sh

4
doc/source/apps/snuffler/index.rst

@ -1,5 +1,5 @@
Snuffler
========
Snuffler - *Seismogram Browser and Workbench*
=============================================
Snuffler is a seismogram browser and workbench.

2
doc/source/conf.py

@ -41,7 +41,7 @@ intersphinx_mapping = {'numpy': ('https://docs.scipy.org/doc/numpy/',
None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/',
None),
'matplotlib': ('http://matplotlib.org/',
'matplotlib': ('https://matplotlib.org/',
None),
'python': ('https://docs.python.org/3.5',
None),

1
doc/source/library/examples/index.rst

@ -21,6 +21,7 @@ Annotated scripts and real-world use cases using Pyrocko.
trace_handling
dataset_management
obspy_compat
gnss_data
fdsn_download
catalog_search

58
doc/source/library/examples/obspy_compat.rst

@ -0,0 +1,58 @@
ObsPy Compatibility
===================
Pyrocko is compatible with `ObsPy <https://obspy.org>`_'s data model. The compatibility package :mod:`pyrocko.obspy_compat` can be activated easily to install additional methods on Pyrocko and ObsPy objects. This enables easy conversion between waveform data as well as station and event information between the two projects.
.. code-block:: python
import obspy
from pyrocko import obspy_compat
obspy_compat.plant()
Using the Snuffler on ``obspy.Trace``
-------------------------------------
This is how you use :meth:`~pyrocko.trace.Trace.snuffle` on an :class:`obspy.Trace <obspy.core.trace.Trace>`.
.. literalinclude :: /../../examples/obspy_compat_snuffle.py
:language: python
Download :download:`obspy_compat_snuffle.py </../../examples/obspy_compat_snuffle.py>`
List of installed methods
-------------------------
When :func:`pyrocko.obspy_compat.plant` is executed several new methods are attached to Pyrocko and ObsPy classes.
+--------------------------------------+---------------------------------+
| class | methods |
+======================================+=================================+
| :py:class:`obspy.Trace` | :py:func:`to_pyrocko_trace` |
| +---------------------------------+
| | :py:func:`snuffle` |
| +---------------------------------+
| | :py:func:`fiddle` |
+--------------------------------------+---------------------------------+
| :py:class:`obspy.Stream` | :py:func:`to_pyrocko_traces` |
| +---------------------------------+
| | :py:func:`snuffle` |
| +---------------------------------+
| | :py:func:`fiddle` |
+--------------------------------------+---------------------------------+
| :py:class:`obspy.Catalog` | :py:func:`to_pyrocko_events` |
+--------------------------------------+---------------------------------+
| :py:class:`obspy.Inventory` | :py:func:`to_pyrocko_stations` |
+--------------------------------------+---------------------------------+
Methods added to Pyrocko classes are:
+--------------------------------------+---------------------------------+
| class | methods |
+======================================+=================================+
| :py:class:`pyrocko.trace.Trace` | :py:func:`to_obspy_trace` |
+--------------------------------------+---------------------------------+
| :py:class:`pyrocko.pile.Pile` | :py:func:`to_obspy_traces` |
+--------------------------------------+---------------------------------+

2
doc/source/library/reference/gui.rst

@ -7,4 +7,4 @@ The ``gui`` subpackage
gui/pile_viewer
gui/snuffling
gui/marker
gui/gui_util
gui/util

9
doc/source/library/reference/obspy_compat.rst

@ -1,6 +1,15 @@
``obspy_compat``
================
With :func:`pyrocko.obspy_compat.plant` several new methods are attached to Pyrocko and ObsPy classes.
.. code-block:: python
import obspy
from pyrocko import obspy_compat
obspy_compat.plant()
.. automodule:: pyrocko.obspy_compat.base
:members:

6
examples/obspy_compat_snuffle.py

@ -5,7 +5,11 @@ from pyrocko import obspy_compat
obspy_compat.plant()
get_example_data('test.mseed')
get_example_data('responses.xml')
# Read in MiniSEED data through ObsPy
inv = obspy.read_inventory('responses.xml')
stream = obspy.read('test.mseed')
stream.snuffle()
# Start the Snuffler
stream.snuffle(inventory=inv)

4
src/obspy_compat/base.py

@ -189,7 +189,7 @@ def snuffle(stream_or_trace, inventory=None, catalog=None, **kwargs):
object
:param catalog:
:py:class:`obspy.Catalog <obspy.core.event.Catalog>` object
:param **kwargs:
:param kwargs:
extra arguments passed to :meth:`pyrocko.trace.Trace.snuffle`.
:returns:
@ -257,7 +257,7 @@ def fiddle(stream_or_trace, inventory=None, catalog=None, **kwargs):
object
:param catalog:
:py:class:`obspy.Catalog <obspy.core.event.Catalog>` object
:param **kwargs:
:param kwargs:
extra arguments passed to :meth:`pyrocko.trace.Trace.snuffle`.
:returns: :py:class:`obspy.Stream <obspy.core.stream.Stream>` object with

Loading…
Cancel
Save