obspy.iris.client.Client.station

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

Low-level interface for station Web service of IRIS (http://www.iris.edu/ws/station/) - release 1.3.6 (2012-04-30).

This method provides access to station metadata in the IRIS DMC database. The results are returned in XML format using the StationXML schema (http://www.data.scec.org/xml/station/). Users can query for station metadata by network, station, channel, location, time and other search criteria and request results at multiple levels (station, channel, response, etc.).

Parameters:
  • network (str) Network code, e.g. 'IU'.
  • station (str) Station code, e.g. 'ANMO', wildcards allowed.
  • location (str, optional) Location code, e.g. '00', wildcards allowed. Defaults to '*'.
  • channel (str, optional) Channel code, e.g. 'BHZ', wildcards allowed. Defaults to '*'.

Geographic constraints - bounding rectangle

The following four parameters work together to specify a boundary rectangle. All four parameters are optional, but they may not be mixed with the parameters used for searching within a defined radius.

Parameters:
  • minlat (float, optional) Specify the southern boundary. The minimum latitude must be between -90 and 90 degrees inclusive (and less than or equal to maxlat). If not specified, then this value defaults to -90.
  • maxlat (float, optional) Specify the northern boundary. The maximum latitude must be between -90 and 90 degrees inclusive and greater than or equal to minlat. If not specified, then this value defaults to 90.
  • minlon (float, optional) Specify the western boundary. The minimum longitude must be between -180 and 180 degrees inclusive. If not specified, then this value defaults to -180. If minlon > maxlon, then the boundary will cross the -180/180 meridian
  • maxlon (float, optional) Specify the eastern boundary. The minimum longitude must be between -180 and 180 degrees inclusive. If not specified, then this value defaults to +180. If maxlon < minlon, then the boundary will cross the -180/180 meridian

Geographic constraints - bounding radius

The following four parameters work together to specify a circular bounding area. lat, lon, and maxradius are all required, and must be used together. minradius is optional, and defaults to 0. These parameters are incompatible with the boundary-box parameters described above.

Parameters:
  • lat (float, optional) Specify the central latitude point, in degrees. This value must be between -90 and 90 degrees. This MUST be used in conjunction with the lon and maxradius parameters.
  • lon (float, optional) Specify the central longitude point, in degrees. This MUST be used in conjunction with the lat and maxradius parameters.
  • maxradius (float, optional) Specify the maximum radius, in degrees. Only earthquakes within maxradius degrees of the lat/lon point will be retrieved. This MUST be used in conjunction with the lat and lon parameters.
  • minradius (float, optional) This optional parameter allows for the exclusion of events that are closer than minradius degrees from the specified lat/lon point. This MUST be used in conjunction with the lat, lon, and maxradius parameters and is subject to the same restrictions. If this parameter isn’t specified, then it defaults to 0.0 degrees.

Temporal constraints

The following parameters impose various time constrants on the query.

Parameters:
  • starttime (UTCDateTime, optional) Limit results to the stations that were operational on or after this time.
  • endtime (UTCDateTime, optional) Limit results to the stations that were operational on or before this time.
  • startbefore (UTCDateTime, optional) Limit results to the stations starting before this time.
  • startafter (UTCDateTime, optional) Limit results to the stations starting after this time.
  • endbefore (UTCDateTime, optional) Limit results to the stations ending before this time.
  • endafter (UTCDateTime, optional) Limit results to the stations ending after this time.

Miscelleneous options

Parameters:
  • updatedafter (UTCDateTime, optional) Only show stations that were updated after a specific time.
  • level ('net', 'sta', 'chan', or 'resp', optional) Specify whether to include channel/response metadata or not. Defaults to 'sta'.
  • filename (str, optional) Name of a output file. If this parameter is given nothing will be returned. Default is None.
Return type:

str or None

Returns:

StationXML file as string if no filename is given.

Example

>>> from obspy.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> t1 = UTCDateTime("2006-03-01")
>>> t2 = UTCDateTime("2006-09-01")
>>> station_xml = client.station(network="IU", station="ANMO",
...                              location="00", channel="BHZ",
...                              starttime=t1, endtime=t2, level="net")
>>> print(station_xml) 
<?xml version="1.0" encoding="ISO-8859-1"?>

<StaMessage ...>
 ...
 <Network net_code="IU">
  <StartDate>1988-01-01T00:00:00</StartDate>
  <EndDate>2500-12-12T23:59:59</EndDate>
  <Description>Global Seismograph Network ...</Description>
  <TotalNumberStations>91</TotalNumberStations>
  <SelectedNumberStations>0</SelectedNumberStations>
 </Network>
</StaMessage>

This Page