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.

  • 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 {‘little’, ‘big’}, optional) If omitted or None, automatic byte-order checking is done, starting with native order. If byteorder is specified and incorrect, a 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.