diff --git a/segpy/revisions.py b/segpy/revisions.py index c6fee03..c06fc36 100644 --- a/segpy/revisions.py +++ b/segpy/revisions.py @@ -1,12 +1,20 @@ -SEGY_REVISION_0 = 0 -SEGY_REVISION_1 = 1 +"""SEG Y Revision numbers -VARIANTS = {SEGY_REVISION_0: SEGY_REVISION_0, - SEGY_REVISION_1: SEGY_REVISION_1, - 0: SEGY_REVISION_0, - 1: SEGY_REVISION_1, - 100: SEGY_REVISION_1, - 256: SEGY_REVISION_1} +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. +""" + + +SEGY_REVISION_0 = 0x0000 +SEGY_REVISION_1 = 0x0100 + +VARIANTS = { + SEGY_REVISION_0: SEGY_REVISION_0, # Ensure that SEGY_REVISION_0 maps to itself + SEGY_REVISION_1: SEGY_REVISION_1, # Ensure that SEGY_REVISION_1 maps to itself + 1: SEGY_REVISION_1, # Common, but erroneous, decimal one + 100: SEGY_REVISION_1} # Common, but erroneous, decimal one-hundred class SegYRevisionError(Exception):