obspy.clients.earthworm.client.Client.save_waveforms

Client.save_waveforms(filename, network, station, location, channel, starttime, endtime, format='MSEED', cleanup=True)[source]

Writes a retrieved waveform directly into a file.

Parameters:
  • filename (str) Name of the output file.
  • network (str) Network code, e.g. 'UW'.
  • station (str) Station code, e.g. 'TUCA'.
  • location (str) Location code, e.g. ''.
  • channel (str) Channel code, e.g. 'BHZ'. Last character (i.e. component) can be a wildcard (‘?’ or ‘*’) to fetch Z, N and E component.
  • starttime (UTCDateTime) Start date and time.
  • endtime (UTCDateTime) End date and time.
  • format (str, optional) Output format. One of "MSEED", "GSE2", "SAC", "SACXY", "Q", "SH_ASC", "SEGY", "SU", "WAV". See the Supported Formats section in method write() for a full list of supported formats. Defaults to 'MSEED'.
  • cleanup (bool) Specifies whether perfectly aligned traces should be merged or not. See merge(), method -1 or _cleanup().
Returns:

None

Example

>>> from obspy.clients.earthworm import Client
>>> client = Client("pubavo1.wr.usgs.gov", 16022)
>>> t = UTCDateTime() - 2000  # now - 2000 seconds
>>> client.save_waveforms('AV.ACH.--.EHE.mseed',
...                       'AV', 'ACH', '', 'EHE',
...                       t, t + 10, format='MSEED')