_write_slist(stream, filename, custom_fmt=None, **kwargs)[source]

Writes a ASCII SLIST file.


This function should NOT be called directly, it registers via the the write() method of an ObsPy Stream object, call this instead.

  • stream (Stream) The ObsPy Stream object to write.
  • filename (str) Name of file to write.
  • custom_fmt (str) formatter for writing sample values. Defaults to None. Using this parameter will set TYPE value in header to CUSTOM and ObsPy will raise an exception while trying to read that file.


>>> from obspy import read
>>> st = read()
>>> st.write("slist.ascii", format="SLIST")  

SLIST Format Description

SLIST is a simple ASCII time series format. Each contiguous time series segment (no gaps or overlaps) is represented with a header line followed by a sample lists. There are no restrictions on how the segments are organized into files, a file might contain a single segment or many, concatenated segments either for the same channel or many different channels.

Header lines have the general form:

TIMESERIES SourceName, # samples, # sps, Time, Format, Type, Units


“Net_Sta_Loc_Chan_Qual”, no spaces, quality code optional
# samples
Number of samples following header
# sps
Sampling rate in samples per second
Time of first sample in ISO YYYY-MM-DDTHH:MM:SS.FFFFFF format
‘TSPAIR’ (fixed)
Sample type ‘INTEGER’, ‘FLOAT’ or ‘ASCII’
Units of time-series, e.g. Counts, M/S, etc., may not contain spaces

Samples are listed in 6 columns with the time-series incrementing from left to right and wrapping to the next line. The time of the first sample is the time listed in the header.

Example SLIST file:

TIMESERIES NL_HGN_00_BHZ_R, 12 samples, 40 sps, 2003-05-29T02:13:22.043400, SLIST, INTEGER, Counts
2787        2776        2774        2780        2783        2782
2776        2766        2759        2760        2765        2767