PySAC

View Project Site
Posted August 1, 2015

Python interface to the Seismic Analysis Code (SAC) file format. PySAC includes both a low-level array-based interface and an intuitive higher-level object-oriented interface to SAC files. Both support conversions to and from ObsPy Traces.

Features

  1. Read and write SAC binary (little and big-endian) or ASCII evenly-sampled time-series
    • autodetect or specify expected byteorder
    • optional file size checking and/or header consistency checks
    • header-only reading and writing
    • "overwrite OK" checking ('lovrok' header)
  2. Convenient access and manipulation of relative and absolute time headers
  3. User-friendly header printing/viewing
  4. Fast access to header values from attributes
    • With type checking, null handling, and enumerated value checking
  5. Convert to/from ObsPy Traces
    • Conversion from ObsPy Trace to SAC trace retains detected previous SAC header values.
    • Conversion to ObsPy Trace retains the complete SAC header.