validate_sac_content(hf, hi, hs, data, *tests)[source]

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

  • hf (numpy.ndarray of floats) SAC float header array
  • hi (numpy.ndarray of ints) SAC int header array
  • hs (numpy.ndarray of str) SAC string header array
  • data (numpy.ndarray of float32) SAC data array
  • tests (str) One or more of the following validity tests: ‘delta’ : Time step “delta” is positive. ‘logicals’ : Logical values are 0, 1, or null ‘data_hdrs’ : Length, min, mean, max of data array match header values. ‘enums’ : Check validity of enumerated values. ‘reftime’ : Reference time values in header are all set. ‘reltime’ : Relative time values in header are absolutely referenced. ‘all’ : Do all tests.

SacInvalidContentError if any of the specified tests fail. ValueError if ‘data_hdrs’ is specified and data is None, empty array, or no tests specified.