Example #1
0
.. _GEOFON:
        http://geofon.gfz-potsdam.de
.. _BGR:
        http://www.bgr.de
.. _IRIS:
        http://www.iris.edu
.. _NERIES:
        http://www.neries-eu.org
.. _INGV:
        http://www.ingv.it
.. _ORFEUS:
        http://www.orfeus-eu.org
.. _GFZ:
        http://www.gfz-potsdam.de
.. _IPGP:
        http://www.ipgp.fr
.. _`GNU Lesser General Public License, Version 3`:
        http://www.gnu.org/copyleft/lesser.html
"""

from obspy.core.util import _getVersionString
from client import Client


__version__ = _getVersionString("obspy.arclink")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #2
0
`SEED` files as well as its derived format `XML-SEED` will be
parsed in a :class:`~obspy.xseed.parser.Parser` structure.

`SEED` volumes have four different volume types:

* Volume Index Control Headers
* Abbreviation Dictionary Control Headers
* Station Control Headers
* Time Span Control Headers (currently not supported by ObsPy. Some dummy
  headers will be written in case they are needed by SEED/XSEED conventions.)

After parsing a `SEED` or `XML-SEED` file the Blockette objects for each
volume will be stored in the attributes``Parser.volume``,
``Parser.abbreviations`` and ``Parser.stations``. Each item is a list of all
related Blockettes and ``Parser.stations`` is a list of stations which contains
all related Blockettes.
"""

# needs to stay above import statements
DEFAULT_XSEED_VERSION = '1.1'

from obspy.core.util import _getVersionString
from obspy.xseed.parser import Parser

__version__ = _getVersionString("obspy.xseed")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #3
0
            npts: 2599
           calib: 1.0
         _format: WAV

The data is stored in the data attribute.

>>> st[0].data
array([ 64,  78,  99, ..., 106, 103, 102], dtype=uint8)

Writing
-------
is also straight forward.

>>> st.write('myfile.wave', format='WAV', framerate=7000) #doctest: +SKIP

The framerate specifies the framerate to which the seismogram should be
squeezed. Using the original sampling_rate results in an WAV file with
frequencies which cannot be heard by a human, therefore it makes sense to
set the framerate to a high value.
"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.wav")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #4
0
# -*- coding: utf-8 -*-
"""
SeisHub - Archiving, processing and simulation of multi-component data in 
seismology using Web Services

U{http://www.seishub.org/}

@author: Robert Barsch <*****@*****.**>
@author: Paul Käufl <*****@*****.**>
"""
import os
from obspy.core.util import _getVersionString

path = os.path.dirname(__file__)

__docformat__ = 'epytext en'
__version__ = _getVersionString("seishub.core")
__url__ = 'http://www.seishub.org/'
__copyright__ = '(C) 2007-2011 Robert Barsch & Paul Käufl'
__license__ = 'GNU Lesser General Public License, Version 3'
__license_long__ = open(os.path.join(path, "LICENSE.txt")).read()
Example #5
0
# -*- coding: utf-8 -*-
"""
obspy.taup - Travel time calculation tool
=========================================
The obspy.taup package contains Python wrappers for iaspei-tau - a travel time
library by Arthur Snoke (http://www.iris.edu/pub/programs/iaspei-tau/).
The library iaspei-tau is written in Fortran and interfaced via Python ctypes.

.. seealso:: [Snoke2009]_

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    Unknown
"""

from obspy.core.util import _getVersionString

__version__ = _getVersionString("obspy.taup")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #6
0
The file format will be determined automatically. Each trace (multiple channels
are mapped to multiple traces) will have a stats attribute containing the usual
information.

>>> print(st[0].stats)  # doctest: +NORMALIZE_WHITESPACE
             network:
             station: KONO
            location: 0
             channel: B0Z
           starttime: 2001-01-13T17:45:01.999000Z
             endtime: 2001-01-13T17:50:01.949000Z
       sampling_rate: 20.0
               delta: 0.05
                npts: 6000
               calib: 1.0
             _format: SEISAN

The actual data is stored as numpy.ndarray in the data attribute of each trace.

>>> print(st[0].data)
[  492   519   542 ..., -6960 -6858 24000]
"""

from obspy.core.util import _getVersionString

__version__ = _getVersionString("obspy.seisan")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #7
0
    >>> print response  # doctest: #SKIP
    [('UW',
      'TUCA',
      '--',
      'BHZ',
      UTCDateTime(2011, 11, 27, 0, 0, 0, 525000),
      UTCDateTime(2011, 12, 29, 20, 50, 31, 525000))]
    >>> t = response[0][4]
    >>> st = client.getWaveform('UW', 'TUCA', '', 'BH*', t + 100, t + 130)
    >>> st.plot()  # doctest: +SKIP

    .. plot::

        from obspy.earthworm import Client
        from obspy.core import UTCDateTime
        client = Client("pele.ess.washington.edu", 16017)
        response = client.availability("UW", "TUCA", channel="BHZ")
        t = response[0][4]
        st = client.getWaveform('UW', 'TUCA', '', 'BH*', t + 100, t + 130)
        st.plot()
"""

from obspy.core.util import _getVersionString
from client import Client

__version__ = _getVersionString("obspy.earthworm")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #8
0
# -*- coding: utf-8 -*-

"""
SeisHub - Archiving, processing and simulation of multi-component data in 
seismology using Web Services

U{http://www.seishub.org/}

@author: Robert Barsch <*****@*****.**>
@author: Paul Käufl <*****@*****.**>
"""
import os
from obspy.core.util import _getVersionString


path = os.path.dirname(__file__)


__docformat__ = "epytext en"
__version__ = _getVersionString("seishub.core")
__url__ = "http://www.seishub.org/"
__copyright__ = "(C) 2007-2011 Robert Barsch & Paul Käufl"
__license__ = "GNU Lesser General Public License, Version 3"
__license_long__ = open(os.path.join(path, "LICENSE.txt")).read()
Example #9
0
.. _`triggering page`: http://docs.obspy.org/tutorial/trigger_tutorial.html
.. _`Tutorial`: http://tutorial.obspy.org
.. _`svn repository`: http://www.obspy.org/browser/branches/sandbox/stalta
"""

from obspy.core.util import _getVersionString
from filter import bandpass, bandstop, lowpass, highpass, remezFIR, lowpassFIR
from filter import envelope, integerDecimation, polarizationFilter
from rotate import rotate_NE_RT, rotate_ZNE_LQT, rotate_LQT_ZNE
from trigger import recSTALTA, recSTALTAPy, carlSTATrig, classicSTALTA, \
    delayedSTALTA, zDetect, triggerOnset, pkBaer, arPick, coincidenceTrigger
from invsim import cosTaper, cornFreq2Paz
from invsim import pazToFreqResp, seisSim, specInv, estimateMagnitude
from cpxtrace import normEnvelope, centroid, instFreq, instBwith
from util import utlGeoKm, utlLonLat
from cross_correlation import xcorr, xcorr_3C, xcorrPickCorrection
from freqattributes import cfrequency, bwith, domperiod, logcep
from hoctavbands import sonogram
from polarization import eigval
from psd import psd, PPSD
from konnoohmachismoothing import konnoOhmachiSmoothing


__version__ = _getVersionString("obspy.signal")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #10
0
* :meth:`~obspy.iris.client.Client.timeseries()` - fetches segments of seismic
  data and returns data formatted in either MiniSEED, ASCII or SAC. It can
  optionally filter the data.

**Calculation Tools**

* :meth:`~obspy.iris.client.Client.traveltime()` - calculates travel-times for
  seismic phases using a 1-D spherical earth model.
* :meth:`~obspy.iris.client.Client.distaz()` - calculate the distance and
  azimuth between two points on a sphere.
* :meth:`~obspy.iris.client.Client.flinnengdahl()` - converts a latitude,
  longitude pair into either a Flinn-Engdahl seismic region code or region
  name.


Please see the documentation for each method for further information and
examples to retrieve various data from the IRIS DMC.
"""

from obspy.core.util import _getVersionString
from client import Client


__version__ = _getVersionString("obspy.iris")


if __name__ == "__main__":
    import doctest

    doctest.testmod(exclude_empty=True)
Example #11
0
       'min_latitude': "latMin", 'max_latitude': "latMax",
       'min_longitude': "lonMin", 'max_longitude': "lonMax",
       'min_depth': "depthMin", 'max_depth': "depthMax",
       'min_magnitude': "magMin", 'max_magnitude': "magMax",
       'magnitude_type': "magType", 'author': "auth",
       'max_results': "limit", 'sort_by': "sort", 'sort_direction': "dir",
       'format': "format", 'datetime': "datetime", 'depth': "depth",
       'flynn_region': "flynn_region", 'latitude': "lat",
       'longitude': "lon", 'magnitude': "mag", 'origin_id': "orid",
       'event_id': "unid"}

MAP_INVERSE = dict([(value, key) for key, value in MAP.iteritems()])
# in results the "magType" key is all lowercase, so add it to..
MAP_INVERSE['magtype'] = "magnitude_type"

VERSION = _getVersionString("obspy.neries")
DEFAULT_USER_AGENT = "ObsPy %s (%s, Python %s)" % (VERSION,
                                                   platform.platform(),
                                                   platform.python_version())
MAX_REQUESTS = 50


# monkey patching SUDS
# ses also https://fedorahosted.org/suds/ticket/292


def _namespace(self, prefix=None):
    if self.ref is not None:
        return ('', self.ref[1])
    ns = self.schema.tns
    if ns[0] is None:
Example #12
0
# -*- coding: utf-8 -*-
"""
obspy.taup - Travel time calculation tool
=========================================
The obspy.taup package contains Python wrappers for iaspei-tau - a travel time
library by Arthur Snoke (http://www.iris.edu/pub/programs/iaspei-tau/).
The library iaspei-tau is written in Fortran and interfaced via Python ctypes.

.. seealso:: [Snoke2009]_

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    Unknown
"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.taup")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #13
0
# -*- coding: utf-8 -*-
"""
obspy.db - A seismic waveform indexer and database for ObsPy
============================================================
The obspy.db package contains a waveform indexer collecting metadata from a
file based waveform archive and storing in into a standard SQL database.
Supported waveform formats depend on installed ObsPy packages.

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.db")
Example #14
0
      'TUCA',
      '--',
      'BHZ',
      UTCDateTime(2011, 11, 27, 0, 0, 0, 525000),
      UTCDateTime(2011, 12, 29, 20, 50, 31, 525000))]
    >>> t = response[0][4]
    >>> st = client.getWaveform('UW', 'TUCA', '', 'BH*', t + 100, t + 130)
    >>> st.plot()  # doctest: +SKIP

    .. plot::

        from obspy.earthworm import Client
        from obspy.core import UTCDateTime
        client = Client("pele.ess.washington.edu", 16017)
        response = client.availability("UW", "TUCA", channel="BHZ")
        t = response[0][4]
        st = client.getWaveform('UW', 'TUCA', '', 'BH*', t + 100, t + 130)
        st.plot()
"""

from obspy.core.util import _getVersionString
from client import Client


__version__ = _getVersionString("obspy.earthworm")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #15
0
               delta: 0.05
                npts: 801
               calib: 1.5
             _format: SH_ASC
                  sh: AttribDict({'COMMENT': 'TEST TRACE IN QFILE #1'})

The actual data is stored as numpy.ndarray in the data attribute of each trace.

>>> st[0].data #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
array([ 0.00000000e+00,   0.00000000e+00,   0.00000000e+00, ...
       -4.03387604e+01,  -3.99515305e+01,  -3.95423012e+01], dtype=float32)

Writing
-------
Writing is also done in the usual way:

>>> st.write('file.q', format = 'Q') #doctest: +SKIP

or

>>> st.write('file.asc', format = 'SH_ASC') #doctest: +SKIP
"""

from obspy.core.util import _getVersionString

__version__ = _getVersionString("obspy.sh")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #16
0
        dt = UTCDateTime("2009-08-20 04:03:12")
        st = client.getWaveform("BW", "RJOB", "", "EH*", dt - 3, dt + 15)
        st.plot()

(5) :meth:`~obspy.neries.client.Client.getTravelTimes()`: Wraps a Taup Web
    service, an utility to compute arrival times using a few default velocity
    models such as ``'iasp91'``, ``'ak135'`` or ``'qdt'``.

    >>> from obspy.neries import Client
    >>> client = Client(user='******')
    >>> locations = [(48.0, 12.0), (48.1, 12.0)]
    >>> result = client.getTravelTimes(latitude=20.0, longitude=20.0,
    ...                                depth=10.0, locations=locations,
    ...                                model='iasp91')
    >>> len(result)
    2
    >>> result[0] # doctest: +SKIP
    {'P': 356981.13561726053, 'S': 646841.5619481194}
"""

from obspy.core.util import _getVersionString
from client import Client


__version__ = _getVersionString("obspy.neries")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #17
0
and the same page in the `Tutorial`_. For automated use there are some example
scripts in the `svn repository`_.

.. _`triggering page`: http://docs.obspy.org/tutorial/trigger_tutorial.html
.. _`Tutorial`: http://tutorial.obspy.org
.. _`svn repository`: http://www.obspy.org/browser/branches/sandbox/stalta
"""

from obspy.core.util import _getVersionString
from filter import bandpass, bandstop, lowpass, highpass, remezFIR, lowpassFIR
from filter import envelope, integerDecimation
from rotate import rotate_NE_RT, rotate_ZNE_LQT, rotate_LQT_ZNE
from trigger import recSTALTA, recSTALTAPy, carlSTATrig, classicSTALTA, \
    delayedSTALTA, zDetect, triggerOnset, pkBaer, arPick, coincidenceTrigger
from invsim import cosTaper, cornFreq2Paz
from invsim import pazToFreqResp, seisSim, specInv, estimateMagnitude
from cpxtrace import normEnvelope, centroid, instFreq, instBwith
from util import utlGeoKm, utlLonLat
from cross_correlation import xcorr, xcorr_3C, xcorrPickCorrection
from freqattributes import cfrequency, bwith, domperiod, logcep
from hoctavbands import sonogram
from polarization import eigval
from psd import psd, PPSD
from konnoohmachismoothing import konnoOhmachiSmoothing

__version__ = _getVersionString("obspy.signal")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #18
0
           calib: 0.0948999971151
         _format: GSE2
            gse2: AttribDict({'instype': '      ', 'datatype': 'CM6',
                              'hang': -1.0, 'auxid': 'RJOB', 'vang': -1.0,
                              'calper': 1.0})

The actual data is stored as :class:`~numpy.ndarray` in the ``data`` attribute
of each trace.

>>> print(st[0].data)
[ 12 -10  16 ...,   8   0 -40]

Writing
-------
You may export the data to the file system using the
:meth:`~obspy.core.stream.Stream.write` method of an existing
:class:`~obspy.core.stream.Stream` object :

>>> st.write('GSE2-filename.gse', format='GSE2') #doctest: +SKIP
"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.gse2")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #19
0
  Web service on top of the ArcLink network

.. _GEOFON:
        http://geofon.gfz-potsdam.de
.. _BGR:
        http://www.bgr.de
.. _IRIS:
        http://www.iris.edu
.. _NERIES:
        http://www.neries-eu.org
.. _INGV:
        http://www.ingv.it
.. _ORFEUS:
        http://www.orfeus-eu.org
.. _GFZ:
        http://www.gfz-potsdam.de
.. _IPGP:
        http://www.ipgp.fr
.. _`GNU Lesser General Public License, Version 3`:
        http://www.gnu.org/copyleft/lesser.html
"""

from obspy.core.util import _getVersionString
from client import Client

__version__ = _getVersionString("obspy.arclink")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #20
0
    <text text="+49.986198"/>
  </item>
  <item title="Longitude (°)">
    <text text="+12.108300"/>
  </item>
  <item title="Elevation (m)">
    <text text="+635.0"/>
  </item>
</metadata>

>>> paz = client.station.getPAZ('BW.MANZ..EHZ', UTCDateTime('20090808'))
>>> paz = paz.items()
>>> sorted(paz)  # doctest: +SKIP
[('gain', 60077000.0),
 ('poles', [(-0.037004+0.037016j), (-0.037004-0.037016j), (-251.33+0j),
            (-131.04-467.29j), (-131.04+467.29j)]),
 ('sensitivity', 2516800000.0),
 ('zeros', [0j, 0j])]
"""

from obspy.core.util import _getVersionString
from obspy.seishub.client import Client


__version__ = _getVersionString("obspy.seishub")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #21
0
parsed in a :class:`~obspy.xseed.parser.Parser` structure.

`SEED` volumes have four different volume types:

* Volume Index Control Headers
* Abbreviation Dictionary Control Headers
* Station Control Headers
* Time Span Control Headers (currently not supported by ObsPy. Some dummy
  headers will be written in case they are needed by SEED/XSEED conventions.)

After parsing a `SEED` or `XML-SEED` file the Blockette objects for each
volume will be stored in the attributes``Parser.volume``,
``Parser.abbreviations`` and ``Parser.stations``. Each item is a list of all
related Blockettes and ``Parser.stations`` is a list of stations which contains
all related Blockettes.
"""

# needs to stay above import statements
DEFAULT_XSEED_VERSION = '1.1'

from obspy.core.util import _getVersionString
from obspy.xseed.parser import Parser


__version__ = _getVersionString("obspy.xseed")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #22
0
:copyright:
    The ObsPy Development Team ([email protected])
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from future.builtins import *  # NOQA
from future.utils import native_str

# don't change order
from obspy.core.utcdatetime import UTCDateTime  # NOQA
from obspy.core.util import _getVersionString
__version__ = _getVersionString(abbrev=10)
from obspy.core.trace import Trace  # NOQA
from obspy.core.stream import Stream, read
from obspy.core.event import readEvents, Catalog
from obspy.station import read_inventory  # NOQA

# insert supported read/write format plugin lists dynamically in docstrings
from obspy.core.util.base import make_format_plugin_table
read.__doc__ = \
    read.__doc__ % make_format_plugin_table("waveform", "read", numspaces=4)
readEvents.__doc__ = \
    readEvents.__doc__ % make_format_plugin_table("event", "read", numspaces=4)

from future.utils import PY2
if PY2:
    Stream.write.im_func.func_doc = \
Example #23
0
   sampling_rate: 1.0
           delta: 1.0
            npts: 100
           calib: 1.0
         _format: SAC
             sac: AttribDict({'dist': -12345.0, 'isynth': -12345, ...'})

The data is stored in the data attribut.

>>> st[0].data #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
array([ -8.74227766e-08,  -3.09016973e-01,..., 3.09007347e-01], dtype=float32)

Writing
-------
Writing is also straight forward. All changes on the data as well as in
stats and stats['sac'] are written with the following command to a file:

>>> st.write('tmp.sac', format='SAC') #doctest: +SKIP
"""

from obspy.core.util import _getVersionString
from sacio import SacIO, SacError, SacIOError, attach_paz, attach_resp

__version__ = _getVersionString("obspy.sac")


if __name__ == "__main__":
    import doctest

    doctest.testmod(exclude_empty=True)
Example #24
0
  used by SAC and other programs
* :meth:`~obspy.iris.client.Client.station()` - provides access to station
  metadata in the IRIS DMC database
* :meth:`~obspy.iris.client.Client.timeseries()` - fetches segments of seismic
  data and returns data formatted in either MiniSEED, ASCII or SAC. It can
  optionally filter the data.

**Calculation Tools**

* :meth:`~obspy.iris.client.Client.traveltime()` - calculates travel-times for
  seismic phases using a 1-D spherical earth model.
* :meth:`~obspy.iris.client.Client.distaz()` - calculate the distance and
  azimuth between two points on a sphere.
* :meth:`~obspy.iris.client.Client.flinnengdahl()` - converts a latitude,
  longitude pair into either a Flinn-Engdahl seismic region code or region
  name.


Please see the documentation for each method for further information and
examples to retrieve various data from the IRIS DMC.
"""

from obspy.core.util import _getVersionString
from client import Client

__version__ = _getVersionString("obspy.iris")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #25
0
information.

>>> print(st[0].stats)  # doctest: +NORMALIZE_WHITESPACE
             network:
             station: KONO
            location: 0
             channel: B0Z
           starttime: 2001-01-13T17:45:01.999000Z
             endtime: 2001-01-13T17:50:01.949000Z
       sampling_rate: 20.0
               delta: 0.05
                npts: 6000
               calib: 1.0
             _format: SEISAN

The actual data is stored as numpy.ndarray in the data attribute of each trace.

>>> print(st[0].data)
[  492   519   542 ..., -6960 -6858 24000]
"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.seisan")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #26
0
        ax.set_aspect("equal")
        ax.set_xlim((-120, 120))
        ax.set_ylim((-20, 120))

    For more info see :func:`obspy.imaging.beachball.Beach` and
    :func:`obspy.imaging.mopad_wrapper.Beach`.


Saving plots into files
-----------------------
All plotting routines offer an ``outfile`` argument to save the result into a
file.

The ``outfile`` parameter is also used to automatically determine the file
format. Available output formats mainly depend on your matplotlib settings.
Common formats are png, svg, pdf or ps.

>>> from obspy.core import read
>>> st = read()
>>> st.plot(outfile='graph.png') #doctest: +SKIP
"""

# Please do not import any modules using matplotlib - otherwise it will disturb
# the test suite (running without X11 or any other display)
# see tests/__init__.py for details

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.imaging")
Example #27
0
        ax.add_collection(beach2)
        ax.set_aspect("equal")
        ax.set_xlim((-120, 120))
        ax.set_ylim((-20, 120))

    For more info see :func:`obspy.imaging.beachball.Beach` and
    :func:`obspy.imaging.mopad_wrapper.Beach`.


Saving plots into files
-----------------------
All plotting routines offer an ``outfile`` argument to save the result into a
file.

The ``outfile`` parameter is also used to automatically determine the file
format. Available output formats mainly depend on your matplotlib settings.
Common formats are png, svg, pdf or ps.

>>> from obspy.core import read
>>> st = read()
>>> st.plot(outfile='graph.png') #doctest: +SKIP
"""

# Please do not import any modules using matplotlib - otherwise it will disturb
# the test suite (running without X11 or any other display)
# see tests/__init__.py for details

from obspy.core.util import _getVersionString

__version__ = _getVersionString("obspy.imaging")
Example #28
0
    'format': "format",
    'datetime': "datetime",
    'depth': "depth",
    'flynn_region': "flynn_region",
    'latitude': "lat",
    'longitude': "lon",
    'magnitude': "mag",
    'origin_id': "orid",
    'event_id': "unid"
}

MAP_INVERSE = dict([(value, key) for key, value in MAP.iteritems()])
# in results the "magType" key is all lowercase, so add it to..
MAP_INVERSE['magtype'] = "magnitude_type"

VERSION = _getVersionString("obspy.neries")
DEFAULT_USER_AGENT = "ObsPy %s (%s, Python %s)" % (
    VERSION, platform.platform(), platform.python_version())
MAX_REQUESTS = 50

# monkey patching SUDS
# ses also https://fedorahosted.org/suds/ticket/292


def _namespace(self, prefix=None):
    if self.ref is not None:
        return ('', self.ref[1])
    ns = self.schema.tns
    if ns[0] is None:
        ns = (prefix, ns[1])
    return ns
Example #29
0
ObsPy is an open-source project dedicated to provide a Python framework for
processing seismological data. It provides parsers for common file formats
and seismological signal processing routines which allow the manipulation of
seismological time series.

The goal of the ObsPy project is to facilitate rapid application development
for seismology.

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""

# don't change order
from obspy.core.utcdatetime import UTCDateTime
from obspy.core.util import _getVersionString
from obspy.core.trace import Trace
from obspy.core.stream import Stream, read
from obspy.core.event import readEvents


__version__ = _getVersionString()


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #30
0
   sampling_rate: 7000.0
           delta: 0.000142857142857
            npts: 2599
           calib: 1.0
         _format: WAV

The data is stored in the data attribute.

>>> st[0].data
array([ 64,  78,  99, ..., 106, 103, 102], dtype=uint8)

Writing
-------
is also straight forward.

>>> st.write('myfile.wave', format='WAV', framerate=7000) #doctest: +SKIP

The framerate specifies the framerate to which the seismogram should be
squeezed. Using the original sampling_rate results in an WAV file with
frequencies which cannot be heard by a human, therefore it makes sense to
set the framerate to a high value.
"""

from obspy.core.util import _getVersionString

__version__ = _getVersionString("obspy.wav")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #31
0
# -*- coding: utf-8 -*-
"""
obspy.seg2 - SEG-2 read support for ObsPy
=========================================

The obspy.seg2 package contains methods in order to read files in the SEG-2
format.

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)

"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.seg2")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #32
0
# -*- coding: utf-8 -*-
"""
obspy.datamark - DataMark read support for ObsPy
================================================
This module provides read support for DataMark waveform data.

:copyright:
    The ObsPy Development Team ([email protected]), Thomas Lecocq, Adolfo Inza &
    Philippe Lesage
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)

"""

from obspy.core.util import _getVersionString


__version__ = _getVersionString("obspy.datamark")


if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #33
0
ObsPy: A Python Toolbox for seismology/seismological observatories
==================================================================

ObsPy is an open-source project dedicated to provide a Python framework for
processing seismological data. It provides parsers for common file formats
and seismological signal processing routines which allow the manipulation of
seismological time series.

The goal of the ObsPy project is to facilitate rapid application development
for seismology.

:copyright:
    The ObsPy Development Team ([email protected])
:license:
    GNU Lesser General Public License, Version 3
    (http://www.gnu.org/copyleft/lesser.html)
"""

# don't change order
from obspy.core.utcdatetime import UTCDateTime
from obspy.core.util import _getVersionString
from obspy.core.trace import Trace
from obspy.core.stream import Stream, read
from obspy.core.event import readEvents

__version__ = _getVersionString()

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)
Example #34
0
        from obspy.core import UTCDateTime
        client = Client(user='******')
        dt = UTCDateTime("2009-08-20 04:03:12")
        st = client.getWaveform("BW", "RJOB", "", "EH*", dt - 3, dt + 15)
        st.plot()

(5) :meth:`~obspy.neries.client.Client.getTravelTimes()`: Wraps a Taup Web
    service, an utility to compute arrival times using a few default velocity
    models such as ``'iasp91'``, ``'ak135'`` or ``'qdt'``.

    >>> from obspy.neries import Client
    >>> client = Client(user='******')
    >>> locations = [(48.0, 12.0), (48.1, 12.0)]
    >>> result = client.getTravelTimes(latitude=20.0, longitude=20.0,
    ...                                depth=10.0, locations=locations,
    ...                                model='iasp91')
    >>> len(result)
    2
    >>> result[0] # doctest: +SKIP
    {'P': 356981.13561726053, 'S': 646841.5619481194}
"""

from obspy.core.util import _getVersionString
from client import Client

__version__ = _getVersionString("obspy.neries")

if __name__ == '__main__':
    import doctest
    doctest.testmod(exclude_empty=True)