obspy.iris.client.Client.dataselect

Client.dataselect(network, station, location, channel, starttime, endtime, quality='B', filename=None, **kwargs)[source]

Low-level interface for dataselect Web service of IRIS (http://www.iris.edu/ws/dataselect/)- release 1.8.1 (2012-05-03).

This method returns a single channel of time series data (no wildcards are allowed). With this service you specify network, station, location, channel and a time range and the service returns either as an ObsPy Stream object or saves the data directly as Mini-SEED file.

Parameters:
  • network (str) Network code, e.g. 'IU'.
  • station (str) Station code, e.g. 'ANMO'.
  • location (str) Location code, e.g. '00'
  • channel (str) Channel code, e.g. 'BHZ'.
  • starttime (UTCDateTime) Start date and time.
  • endtime (UTCDateTime) End date and time.
  • quality ('D', 'R', 'Q', 'M' or 'B', optional) Mini-SEED data quality indicator. 'M' and 'B' (default) are treated the same and indicate best available. If 'B' is selected, the output data records will be stamped with a M.
  • filename (str, optional) Name of a output file. If this parameter is given nothing will be returned. Default is None.
Return type:

Stream or None

Returns:

ObsPy Stream object if no filename is given.

Example

>>> from obspy.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> t1 = UTCDateTime("2010-02-27T06:30:00.000")
>>> t2 = UTCDateTime("2010-02-27T07:00:00.000")
>>> st = client.dataselect("IU", "ANMO", "00", "BHZ", t1, t2)
>>> print(st)  
1 Trace(s) in Stream:
IU.ANMO.00.BHZ | 2010-02-27T06:30:00... | 20.0 Hz, 36000 samples

This Page