obspy.io.sac.sactrace.SACTrace.write

SACTrace.write(dest, headonly=False, ascii=False, byteorder=None, flush_headers=True)[source]

Write the header and (optionally) data arrays to a SAC binary file.

Parameters
  • dest (str or file) – Full path or File-like object to SAC binary file on disk.

  • headonly (bool) – If headonly is True, only read the header arrays not the data array.

  • ascii (bool) – If True, file is a SAC ASCII/Alphanumeric file.

  • byteorder (str, optional) – If omitted or None, automatic byte-order checking is done, starting with native order. If byteorder is specified ( ‘little’ or ‘big’) and incorrect, a obspy.io.sac.util.SacIOError is raised. Only valid for binary files.

  • flush_headers (bool) – If True, update data headers like ‘depmin’ and ‘depmax’ with values from the data array.