obspy.io.sac.arrayio

Low-level array interface to the SAC file format.

Functions in this module work directly with NumPy arrays that mirror the SAC format. The ‘primitives’ in this module are the float, int, and string header arrays, the float data array, and a header dictionary. Convenience functions are provided to convert between header arrays and more user-friendly dictionaries.

These read/write routines are very literal; there is almost no value or type checking, except for byteorder and header/data array length. File- and array- based checking routines are provided for additional checks where desired.

Public Functions

dict_to_header_arrays

Returns null hf, hi, hs arrays, optionally filled with values from a dictionary.

header_arrays_to_dict

Convert SAC header arrays to a more user-friendly dict.

init_header_arrays

Initialize arbitrary header arrays.

is_valid_byteorder

read_sac

Read a SAC binary file.

read_sac_ascii

Read a SAC ASCII/Alphanumeric file.

validate_sac_content

Check validity of loaded SAC file content, such as header/data consistency.

write_sac

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

write_sac_ascii

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