obspy.io.gse2.libgse2

Lowlevel module internally used for handling GSE2 files.

Python wrappers for gse_functions - The GSE2 library of Stefan Stange. Currently CM6 compressed GSE2 files are supported, this should be sufficient for most cases. Gse_functions is written in C and interfaced via python-ctypes.

See: http://www.orfeus-eu.org/software/seismo_softwarelibrary.html#gse

copyright:The ObsPy Development Team (devs@obspy.org)
license:GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)

Public Functions

compile_sta2 Returns a STA2 line as a string (including newline at end) from a
compress_cm6 CM6 compress data
is_gse2 Checks whether a file is GSE2 or not. Returns True or False.
parse_sta2 Parses a string with a GSE2 STA2 header line.
read Read GSE2 file and return header and data.
read_header Reads GSE2 header from file pointer and returns it as dictionary.
read_integer_data Reads npts points of uncompressed integers from given file handler.
uncompress_cm6 Uncompress n_samps of CM6 compressed data from file pointer fp.
verify_checksum Calculate checksum from data, as in gse_driver.c line 60
write Write GSE2 file, given the header and data.
write_header Rewriting the write_header Function of gse_functions.c

Private Functions

Warning

Private functions are mainly for internal/developer use and their API might change without notice.

_str

Exceptions

ChksumError Exception type for mismatching checksums
GSEUtiError Exception type for other errors in GSE_UTI