segpy.revisions module

SEG Y Revision numbers

From the specification:

SEG Y Format Revision Number. This is a 16-bit unsigned value with a Q- point between the first and second bytes. Thus for SEG Y Revision 1.0, as defined in this document, this will be recorded as 0100 in base 16.
class segpy.revisions.SegYRevision

Bases: enum.IntEnum

An enumeration.

REVISION_0 = 0
REVISION_1 = 256
exception segpy.revisions.SegYRevisionError

Bases: Exception

segpy.revisions.canonicalize_revision(revision)

Canonicalize a SEG Y revision.

Various SEG Y revisions are seen in the wild; this function canonicalizes the supplies revision to either SegYRevision.REVISION_0 or SegYRevision.REVISION_1.

Parameters:revision – Any object representing a SEG Y revision.
Returns:An integer revision - either SegYRevision.REVISION_0 or SegYRevision.REVISION_1.
Raises:SegYRevisionError - If the revision is not known.
segpy.revisions.integer_to_decimal_revision(revision)

Convert a SEG Y revision integer into decimal form.

Parameters:revision – An canonical revision integer e.g. as produced by a call to canonicalize_revision().
Returns:A decimal real number.