obspy.iris.client.Client.saveWaveform

Client.saveWaveform(filename, network, station, location, channel, starttime, endtime, quality='B')[source]

Writes a retrieved waveform directly into a file.

This method ensures the storage of the unmodified waveform data delivered by the IRIS server, e.g. preserving the record based quality flags of Mini-SEED files which would be neglected reading it with obspy.mseed.

Parameters:
  • filename (str) Name of the output file.
  • network (str) Network code, e.g. 'IU' or 'I*'. Network code may contain wild cards.
  • station (str) Station code, e.g. 'ANMO' or 'A*'. Station code may contain wild cards.
  • location (str) Location code, e.g. '00' or '*'. Location code may contain wild cards.
  • channel (str) Channel code, e.g. 'BHZ' or 'B*'. Channel code may contain wild cards.
  • 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 'M' or 'B' are selected, the output data records will be stamped with a 'M'.
Returns:

ObsPy Stream object.

Example

>>> from obspy.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> t1 = UTCDateTime('2010-02-27T06:30:00.000')
>>> t2 = UTCDateTime('2010-02-27T10:30:00.000')
>>> client.saveWaveform('IU.ANMO.00.BHZ.mseed', 'IU', 'ANMO',
...                     '00', 'BHZ', t1, t2) 

This Page