obspy.io.sac.arrayio.write_sac_ascii

write_sac_ascii(dest, hf, hi, hs, data=None)[source]

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

Parameters:
  • dest (str or file) – Full path or File-like object from SAC ASCII file on disk.

  • hf (numpy.ndarray of floats) – SAC float header array.

  • hi (numpy.ndarray of ints) – SAC int header array.

  • hs (numpy.ndarray of strings) – SAC string header array.

  • data (numpy.ndarray of float32 or None) – SAC data array. If omitted or None, it is assumed that the user intends to overwrite/modify only the header arrays of an existing file. Equivalent to “writehdr”. If data is None, better make sure the header you’re writing matches any data already in the file.