segpy.encoding module

Support for the text encodings used in SEG Y.

SEG Y data can contain textual data encoded in either ASCII or EBCDIC format. This module contains tools for detecting those encodings.

exception segpy.encoding.UnsupportedEncodingError(text, encoding)

Bases: Exception

encoding
segpy.encoding.guess_encoding(bs, threshold=0.5)

Try to determine whether the encoding of byte stream b is an ASCII string or an EBCDIC string.

Parameters:bs – A byte string (Python 2 - str; Python 3 - bytes)
Returns:A string which can be used with the Python encoding functions: ‘cp037’ for EBCDIC, ‘ascii’ for ASCII or None if neither.
segpy.encoding.is_supported_encoding(encoding)