mirror of
https://github.com/wassname/segpy.git
synced 2026-06-27 18:25:38 +08:00
Corrects the official values for SEGY_REVISION_0 and SEGY_REVISION_1 constants. Tidies up the version canonicalization code.
This commit is contained in:
+16
-8
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user