obspy.clients.syngine.client.Client

class Client(base_url='http://service.iris.edu/irisws/syngine/1', user_agent='ObsPy/1.4.0.post0+332.ga357b34364.obspy.master (Linux-6.2.0-1019-azure-x86_64-with-glibc2.35, Python 3.9.18)', debug=False, timeout=20)[source]

Bases: WaveformClient, HTTPClient

Client for the IRIS Syngine service.

Public Methods

get_available_models

Get information about all available velocity models.

get_model_info

Get some information about a particular model.

get_service_version

Get the service version of the remote Syngine server.

get_waveforms

Request waveforms using the Syngine service.

get_waveforms_bulk

Request waveforms for multiple receivers simultaneously.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

Client._convert_parameters(model, **kwargs)[source]
Client._download(url, params=None, filename=None, data=None, content_type=None)

Download the URL with GET or POST and the chosen parameters.

Will call the _handle_requests_http_error() method if the response comes back with an HTTP code other than 200. Returns the response object if successful and filename is not given - if given it will save the response to the specified file and return None.

By default it will send a GET request - if data is given it will send a POST request.

Parameters:
  • url (str) – The URL to download from.

  • params (dict) – Additional URL parameters.

  • filename (str or file-like object) – String or file like object. Will download directly to the file. If specified, this function will return nothing.

  • data (dict, bytes, or file-like object) – If specified, a POST request will be sent with the data in the body of the request.

  • content_type (str) – Should only be relevant when data is specified and thus issuing a POST request. Can be used to set the Content-Type HTTP header to let the server know what type the body is, e.g. "text/plain".

Returns:

The response object assuming filename is None.

Return type:

requests.Response

Client._get_url(path)[source]
Client._handle_requests_http_error(r)[source]

Special Methods

Client.__read_to_stream(r)
Client.__delattr__(name, /)

Implement delattr(self, name).

Client.__dir__()

Default dir() implementation.

Client.__eq__(value, /)

Return self==value.

Client.__format__(format_spec, /)

Default object formatter.

Client.__ge__(value, /)

Return self>=value.

Client.__getattribute__(name, /)

Return getattr(self, name).

Client.__gt__(value, /)

Return self>value.

Client.__hash__()

Return hash(self).

Client.__init__(base_url='http://service.iris.edu/irisws/syngine/1', user_agent='ObsPy/1.4.0.post0+332.ga357b34364.obspy.master (Linux-6.2.0-1019-azure-x86_64-with-glibc2.35, Python 3.9.18)', debug=False, timeout=20)[source]

Initializes a Syngine Client.

Parameters:
  • base_url (str) – The base URL of the service.

  • user_agent (str) – The user agent sent along the HTTP request.

  • debug (bool) – Debug on/off.

  • timeout (float) – The socket timeout.

Client.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

Client.__le__(value, /)

Return self<=value.

Client.__lt__(value, /)

Return self<value.

Client.__ne__(value, /)

Return self!=value.

Client.__new__(**kwargs)
Client.__reduce__()

Helper for pickle.

Client.__reduce_ex__(protocol, /)

Helper for pickle.

Client.__repr__()

Return repr(self).

Client.__setattr__(name, value, /)

Implement setattr(self, name, value).

Client.__sizeof__()

Size of object in memory, in bytes.

Client.__str__()

Return str(self).

Client.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).