obspy.iris.client.Client

class Client(base_url=u'http://service.iris.edu/irisws', user=u'', password=u'', timeout=20, debug=False, user_agent=u'ObsPy 0.10.1 (Linux-2.6.32-042stab092.3-i686-with-Ubuntu-12.04-precise, Python 2.7.3)', major_versions={})[source]

Bases: future.types.newobject.newobject

IRIS Web service request client.

Parameters:
  • base_url (str, optional) Base URL of the IRIS Web service (default is 'http://service.iris.edu/irisws').
  • 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)'.
  • major_versions (dict) Allows to specify custom major version numbers for individual services (e.g. major_versions={‘evalresp’: 2, ‘sacpz’: 3}), otherwise the latest version at time of implementation will be used.

Example

>>> from obspy.iris import Client
>>> client = Client()
>>> result = client.distaz(stalat=1.1, stalon=1.2, evtlat=3.2,
...                        evtlon=1.4)
>>> print(result['distance'])
2.09554
>>> print(result['backazimuth'])
5.46946
>>> print(result['azimuth'])
185.47692

Attributes

__dict__
__doc__ unicode(string [, encoding[, errors]]) -> object
__module__ str(object) -> string
__weakref__ list of weak references to the object (if defined)

Public Methods

availability SHUT DOWN ON SERVER SIDE!
bulkdataselect SHUT DOWN ON SERVER SIDE!
dataselect SHUT DOWN ON SERVER SIDE!
distaz Low-level interface for distaz Web service of IRIS
evalresp Low-level interface for evalresp Web service of IRIS
event SHUT DOWN ON SERVER SIDE!
flinnengdahl Low-level interface for flinnengdahl Web service of IRIS
getEvents SHUT DOWN ON SERVER SIDE!
getWaveform SHUT DOWN ON SERVER SIDE!
next
resp Low-level interface for resp Web service of IRIS
sacpz Low-level interface for sacpz Web service of IRIS
saveResponse SHUT DOWN ON SERVER SIDE!
saveWaveform SHUT DOWN ON SERVER SIDE!
station SHUT DOWN ON SERVER SIDE!
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 directly returns it.

Special Methods

__init__ Initializes the IRIS Web service client.
__long__
__native__ Hook for the future.utils.native() function
__nonzero__
__unicode__