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 (https://www.fdsn.org/webservices/).

copyright:The ObsPy Development Team (devs@obspy.org)
license:GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)

Basic Usage

The first step is always to initialize a client object.

>>> from obspy.clients.fdsn import Client
>>> client = Client("IRIS")

A client object can be initialized either with the base URL of any FDSN web service or with a shortcut name which will be mapped to a FDSN URL. All the example make use of the FDSN web service at IRIS. For a list of other available web service providers, see the __init__() method. The currently available providers are:

>>> from obspy.clients.fdsn.header import URL_MAPPINGS
>>> for key in sorted(URL_MAPPINGS.keys()):
...     print("{0:<7} {1}".format(key,  URL_MAPPINGS[key]))
BGR     http://eida.bgr.de
EMSC    http://www.seismicportal.eu
ETH     http://eida.ethz.ch
GEONET  http://service.geonet.org.nz
GFZ     http://geofon.gfz-potsdam.de
INGV    http://webservices.rm.ingv.it
IPGP    http://eida.ipgp.fr
IRIS    http://service.iris.edu
ISC     http://isc-mirror.iris.washington.edu
KOERI   http://eida.koeri.boun.edu.tr
LMU     http://erde.geophysik.uni-muenchen.de
NCEDC   http://service.ncedc.org
NIEP    http://eida-sc3.infp.ro
NOA     http://eida.gein.noa.gr
ODC     http://www.orfeus-eu.org
ORFEUS  http://www.orfeus-eu.org
RESIF   http://ws.resif.fr
SCEDC   http://service.scedc.caltech.edu
USGS    http://earthquake.usgs.gov
USP     http://sismo.iag.usp.br
  1. get_waveforms(): The following example illustrates how to request and plot 60 minutes of the "LHZ" channel of station Albuquerque, New Mexico ("ANMO") of the Global Seismograph Network ("IU") for an seismic event around 2010-02-27 06:45 (UTC). Results are returned as a Stream object. See the get_waveforms_bulk() method for information on how to send multiple requests simultaneously to avoid unnecessary network overhead.

    >>> from obspy import UTCDateTime
    >>> t = UTCDateTime("2010-02-27T06:45:00.000")
    >>> st = client.get_waveforms("IU", "ANMO", "00", "LHZ", t, t + 60 * 60)
    >>> st.plot()  
    

    (Source code, png, hires.png)

    ../_images/obspy-clients-fdsn-1.png
  2. get_events(): Retrieves event data from the server. Results are returned as a Catalog object.

    >>> starttime = UTCDateTime("2002-01-01")
    >>> endtime = UTCDateTime("2002-01-02")
    >>> cat = client.get_events(starttime=starttime, endtime=endtime,
    ...                         minmagnitude=6, catalog="ISC")
    >>> print(cat)  
    2 Event(s) in Catalog:
    2002-01-01T11:29:22.720000Z |  +6.282, +125.749 | 6.3 MW
    2002-01-01T07:28:57.480000Z | +36.991,  +72.336 | 6.3 Mb
    >>> cat.plot()  
    

    (Source code, png, hires.png)

    ../_images/obspy-clients-fdsn-2.png
  3. get_stations(): Retrieves station data from the server. Results are returned as an Inventory object.

    >>> inventory = client.get_stations(network="IU", station="A*",
    ...                                 starttime=starttime,
    ...                                 endtime=endtime)
    >>> print(inventory)  
    Inventory created at ...
        Created by: IRIS WEB SERVICE: fdsnws-station | version: ...
                    ...
        Sending institution: IRIS-DMC (IRIS-DMC)
        Contains:
                Networks (1):
                        IU
                Stations (3):
                        IU.ADK (Adak, Aleutian Islands, Alaska)
                        IU.AFI (Afiamalu, Samoa)
                        IU.ANMO (Albuquerque, New Mexico, USA)
                Channels (0):
    >>> inventory.plot()  
    

    (Source code, png, hires.png)

    ../_images/obspy-clients-fdsn-3.png

Please see the documentation for each method for further information and examples.

Classes & Functions

client.Client FDSN Web service request client.

Modules

client FDSN Web service client for ObsPy.
mass_downloader Mass Downloader for FDSN Compliant Web Services
mass_downloader.domain Domain definitions for the download helpers.
mass_downloader.mass_downloader.MassDownloader Class facilitating data acquisition across all FDSN web service
mass_downloader.restrictions Non-geographical restrictions and constraints for the mass downloader.
mass_downloader.download_helpers Helpers for the mass downloader.