Corrects the official values for SEGY_REVISION_0 and SEGY_REVISION_1 constants. Tidies up the version canonicalization code.

This commit is contained in:
Robert Smallshire
2015-05-07 14:04:48 +02:00
parent fa5371349d
commit b4e98a562f
+16 -8
View File
@@ -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):