obspy.iris.client.Client

class Client(base_url='http://www.iris.edu/ws', user='', password='', timeout=20, debug=False, user_agent='ObsPy 0.8.4 (Linux-2.6.32-5-amd64-x86_64-with-debian-6.0.7, Python 2.7.3)')[source]

Bases: object

IRIS Web service request client.

Parameters:
  • base_url (str, optional) Base URL of the IRIS Web service (default is 'http://www.iris.edu/ws').
  • user (str, optional) The user name used for authentication with the Web service (default an empty string).
  • password (str, optional) A password used for authentication with the Web service (default is an empty string).
  • timeout (int, optional) Seconds before a connection timeout is raised (default is 10 seconds). This works only for Python >= 2.6.x.
  • debug (bool, optional) Enables verbose output (default is False).
  • user_agent (str, optional) Sets an client identification string which may be used on server side for statistical analysis (default contains the current module version and basic information about the used operation system, e.g. 'ObsPy 0.4.7.dev-r2432 (Windows-7-6.1.7601-SP1, Python 2.7.1)'.

Example

>>> from obspy.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> t = UTCDateTime("2010-02-27T06:30:00.000")
>>> st = client.getWaveform("IU", "ANMO", "00", "BHZ", t, t + 20)
>>> print(st)  
1 Trace(s) in Stream:
IU.ANMO.00.BHZ | 2010-02-27T06:30:00.019538Z - ... | 20.0 Hz, 401 samples

Attributes

__dict__
__doc__ str(object) -> string
__module__ str(object) -> string
__weakref__ list of weak references to the object (if defined)

Public Methods

availability Low-level interface for availability Web service of IRIS
bulkdataselect Low-level interface for bulkdataselect Web service of IRIS
dataselect Low-level interface for dataselect Web service of IRIS
distaz Low-level interface for distaz Web service of IRIS
evalresp Low-level interface for evalresp Web service of IRIS
event Low-level interface for event Web service of IRIS
flinnengdahl Low-level interface for flinnengdahl Web service of IRIS
getEvents Retrieves event data from IRIS.
getWaveform Retrieves waveform data from IRIS and returns an ObsPy Stream object.
resp Low-level interface for resp Web service of IRIS
sacpz Low-level interface for sacpz Web service of IRIS
saveResponse Writes response information into a file.
saveWaveform Writes a retrieved waveform directly into a file.
station Low-level interface for station Web service of IRIS
timeseries Low-level interface for timeseries Web service of IRIS
traveltime Low-level interface for traveltime Web service of IRIS

Private Methods

_fetch Send a HTTP request via urllib2.
_toFileOrData Either writes data into a file if filename is given or returns it.

Special Methods

__init__ Initializes the IRIS Web service client.

This Page