obspy.io.sac.arrayio.validate_sac_content
- validate_sac_content(hf, hi, hs, data, *tests)[source]
Check validity of loaded SAC file content, such as header/data consistency.
- Parameters
hf (
numpy.ndarray
of floats) – SAC float header arrayhi (
numpy.ndarray
of ints) – SAC int header arrayhs (
numpy.ndarray
of str) – SAC string header arraydata (
numpy.ndarray
of float32) – SAC data arraytests (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.
- Raises
obspy.io.sac.util.SacInvalidContentError
if any of the specified tests fail.ValueError
if ‘data_hdrs’ is specified and data is None, empty array, or no tests specified.