obspy.io.sac.core._internal_read_sac

_internal_read_sac(buf, headonly=False, debug_headers=False, fsize=True, byteorder=None, **kwargs)[source]

Reads an SAC file and returns an ObsPy Stream object.

Warning

This function should NOT be called directly, it registers via the ObsPy read() function, call this instead.

Parameters:
  • buf (file or file-like object) – SAC file to be read.

  • headonly (bool) – If set to True, read only the head. This is most useful for scanning available data in huge (temporary) data sets.

  • debug_headers (bool) – Extracts also the SAC headers 'nzyear', 'nzjday', 'nzhour', 'nzmin', 'nzsec', 'nzmsec', 'delta', 'scale', 'npts', 'knetwk', 'kstnm', 'kcmpnm' which are usually directly mapped to the Stream object if set to True. Those values are not synchronized with the Stream object itself and won’t be used during writing of a SAC file! Defaults to False.

  • fsize (bool) – Check if file size is consistent with theoretical size from header. Defaults to True.

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

Return type:

Stream

Returns:

A ObsPy Stream object.