obspy.clients.filesystem.sds.Client

class Client(sds_root, sds_type='D', format='MSEED', fileborder_seconds=30, fileborder_samples=5000)[source]

Bases: object

Request client for SeisComP Data Structure archive on local filesystem.

For details see the __init__() method.

Attributes

FMTSTR

Public Methods

get_all_nslc

Return information on what streams are included in archive.

get_all_stations

Return information on what stations are included in archive.

get_availability_percentage

Get percentage of available data.

get_latency

Get latency for given stream, i.e. difference of current time and latest available data for stream in SDS archive.

get_waveforms

Read data from a local SeisComP Data Structure (SDS) directory tree.

get_waveforms_bulk

Reads bulk data from a local SeisComP Data Structure (SDS) directory tree.

has_data

Check if specified stream has any data.

Private Methods

Warning

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

Client._get_current_endtime(network, station, location, channel, sds_type=None, stop_time=None, check_has_no_data=True)[source]

Get time of last sample for given stream.

None is returned if no data at all is encountered when going backwards until stop_time (defaults to Jan 1st 1950).

Parameters:
  • network (str) – Network code of requested data (e.g. “IU”).

  • station (str) – Station code of requested data (e.g. “ANMO”).

  • location (str) – Location code of requested data (e.g. “”).

  • channel (str) – Channel code of requested data (e.g. “HHZ”).

  • sds_type (str) – Override SDS data type identifier that was specified during client initialization.

  • stop_time (UTCDateTime) – Time at which the search for data is stopped and None is returned. If not specified, stops at 1950-01-01T00.

  • check_has_no_data (bool) – Whether to perform a check with has_data() if any data is available at all for the given SEED ID. Turns out that this check can take a long time on slow filesystems (e.g. NFS), so it might actually make the latency check take longer than necessary, so deactivating it might be worth a try if speed issues occur.

Return type:

UTCDateTime or None

Client._get_filename(network, station, location, channel, time, sds_type=None)[source]

Get filename for certain waveform.

Parameters:
  • network (str) – Network code of requested data (e.g. “IU”).

  • station (str) – Station code of requested data (e.g. “ANMO”).

  • location (str) – Location code of requested data (e.g. “”).

  • channel (str) – Channel code of requested data (e.g. “HHZ”).

  • time (UTCDateTime) – Time of interest.

  • sds_type (str) – Override SDS data type identifier that was specified during client initialization.

Return type:

str

Client._get_filenames(network, station, location, channel, starttime, endtime, sds_type=None)[source]

Get list of filenames for certain waveform and time span.

Parameters:
  • network (str) – Network code of requested data (e.g. “IU”).

  • station (str) – Station code of requested data (e.g. “ANMO”).

  • location (str) – Location code of requested data (e.g. “”).

  • channel (str) – Channel code of requested data (e.g. “HHZ”).

  • starttime (UTCDateTime) – Start of time span.

  • endtime (UTCDateTime) – End of time span.

  • sds_type (str) – Override SDS data type identifier that was specified during client initialization.

Return type:

list[str]

Special Methods

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__(sds_root, sds_type='D', format='MSEED', fileborder_seconds=30, fileborder_samples=5000)[source]

Initialize a SDS local filesystem client.

>>> from obspy.clients.filesystem.sds import Client
>>> client = Client("/my/SDS/archive/root")  
Parameters:
  • sds_root (str) – Root directory of SDS archive.

  • sds_type (str) – SDS data type identifier, one single character. Types recommended by the SDS definition are: ‘D’ - Waveform data, ‘E’ - Detection data, ‘L’ - Log data, ‘T’ - Timing data, ‘C’ - Calibration data, ‘R’ - Response data, ‘O’ - Opaque data. Can also be wildcarded by setting to ? or *.

  • format (str) – File format the data is stored in, see read() for a list of file formats supported by ObsPy. Usually, SDS archives are stored in “MSEED” format. Can be set to None for file format autodetection (slowing down the reading).

  • fileborder_seconds (float) – Defines in which cases the client checks the previous/next daily file for the requested data (data in SDS archives usually spill over on the day break, at least for a few seconds). For example setting fileborder_seconds=30 means that for a request with starttime at 00:00:29 UTC (or an endtime at 23:59:31), the previous daily file is also checked, if it contains matching data. The maximum of both fileborder_seconds and fileborder_samples is used when determining if previous/next day should be checked for data.

  • fileborder_samples (int) – Similar to fileborder_seconds. The given number of samples is converted to seconds by mapping the band code of the requested channel to sampling frequency. The maximum of both fileborder_seconds and fileborder_samples is used when determining if previous/next day should be checked for data.

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).