obspy.core.trace.Trace.write

Trace.write(filename, format=None, **kwargs)[source]

Save current trace into a file.

Parameters
  • filename (str) – The name of the file to write.

  • format (str, optional) – The format of the file to write. See obspy.core.stream.Stream.write() method for possible formats. If format is set to None it will be deduced from file extension, whenever possible.

  • kwargs – Additional keyword arguments passed to the underlying waveform writer method.

Example

>>> tr = Trace()
>>> tr.write("out.mseed", format="MSEED")  

The format argument can be omitted, and the file format will be deduced from file extension, whenever possible.

>>> tr.write("out.mseed")