obspy.neic.client.Client

class Client(host='137.227.224.97', port=2061, timeout=30, debug=False)[source]

Bases: object

NEIC CWB QueryServer request client for waveform data

Parameters:
  • host (str, optional) The IP address or DNS name of the server (default is “137.227.224.97” for cwbpub.cr.usgs.gov)
  • port (int, optional) The port of the QueryServer (default is 2061)
  • timeout (int, optional) Wait this much time before timeout is raised (python > 2.6, default is 30)
  • debug (bool, optional) if True, print debug information (default is False)

Example

>>> from obspy.neic import Client
>>> client = Client()
>>> t = UTCDateTime() - 5 * 3600  # 5 hours before now
>>> st = client.getWaveform("IU", "ANMO", "00", "BH?", t, t + 10)
>>> print st  
3 Trace(s) in Stream:
IU.ANMO.00.BH... | 20.0 Hz, 201 samples
IU.ANMO.00.BH... | 20.0 Hz, 201 samples
IU.ANMO.00.BH... | 20.0 Hz, 201 samples
>>> st = client.getWaveformNSCL("IUANMO BH.00", t, 10)
>>> print st  
3 Trace(s) in Stream:
IU.ANMO.00.BH... | 20.0 Hz, 201 samples
IU.ANMO.00.BH... | 20.0 Hz, 201 samples
IU.ANMO.00.BH... | 20.0 Hz, 201 samples

Attributes

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

Public Methods

getWaveform Gets a waveform for a specified net, station, location and channel from starttime to endtime.
getWaveformNSCL Gets a regular expression of channels from a start time for a duration in seconds.

Special Methods

__init__ Initializes access to a CWB QueryServer

This Page