- Stream.write(filename, format=None, **kwargs)
Save stream into a file.
filename (str) – The name of the file to write.
format (str, optional) – The file format to use (e.g.
"MSEED"). See the Supported Formats section below for a list of supported formats. If format is set to
Noneit will be deduced from file extension, whenever possible.
kwargs – Additional keyword arguments passed to the underlying waveform writer method.
>>> from obspy import read >>> st = read() >>> st.write("example.mseed", format="MSEED")
formatargument can be omitted, and the file format will be deduced from file extension, whenever possible.
Writing single traces into files with meaningful filenames can be done e.g. using trace.id
>>> for tr in st: ... tr.write(tr.id + ".MSEED", format="MSEED")
Additional ObsPy modules extend the parameters of the
write()method. The following table summarizes all known formats currently available for ObsPy.
Please refer to the Linked Function Call of each module for any extra options available.