Skip to content

Commit

Permalink
Merge 8d6b763 into d39b89c
Browse files Browse the repository at this point in the history
  • Loading branch information
adclose committed May 13, 2019
2 parents d39b89c + 8d6b763 commit 0201fce
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions segpy/trace_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class DataUse(IntEnum):
"""Data use:
1 = Production,
2 = Test"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
PRODUCTION = 1
TEST = 2

Expand All @@ -26,6 +30,9 @@ class ScalarFactor(IntEnum):
Scalar = 1, +10, +100, +1000, or +10,000. If positive, scalar is used as a
multiplier; if negative, scalar is used as a divisor.
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
POS_1 = 1
POS_10 = 10
Expand All @@ -51,6 +58,9 @@ class CoordinateUnits(IntEnum):
to 1; To encode ±DDDMMSS.ss this value equals ±DDD*106 + MM*104 + SS*102
with xy_scalar set to -100.
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
LENGTH = 1
SECONDS_OF_ARC = 2
Expand All @@ -64,7 +74,11 @@ class CoordinateUnitsField(metaclass=IntEnumFieldMeta,


class Correlated(IntEnum):
"Correlated: 1 = no, 2 = yes."
"""Correlated: 0 = unknown, 1 = no, 2 = yes"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
NO = 1
YES = 2

Expand All @@ -81,6 +95,9 @@ class SweepType(IntEnum):
3 = exponential
4 = other.
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
LINEAR = 1
PARABOLIC = 2
Expand All @@ -99,6 +116,9 @@ class TaperType(IntEnum):
2 = cos2,
3 = other
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
LINEAR = 1
COS_SQUARED = 2
Expand Down Expand Up @@ -147,6 +167,9 @@ class TimeBasisCode(IntEnum):
be explained in a user defined stanza in the Extended Textual File Header,
4 = UTC (Coordinated Universal Time).
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
LOCAL = 1
GMT = 2
Expand All @@ -164,6 +187,9 @@ class OverTravel(IntEnum):
1 = down (or behind)
2 = up (or ahead)
"""
def _missing_(cls, name):
return cls.UNKNOWN

UNKNOWN = 0
DOWN = 1
UP = 2
Expand All @@ -187,6 +213,11 @@ class SampleUnit(IntEnum):
8 = Newton (N),
9 = Watt (W)
"""

@classmethod
def _missing_(cls, name):
return cls.UNKNOWN

OTHER = -1
UNKNOWN = 0
PASCAL = 1
Expand All @@ -199,7 +230,6 @@ class SampleUnit(IntEnum):
NEWTON = 8
WATT = 9


class SampleUnitField(metaclass=IntEnumFieldMeta,
enum=SampleUnit):
pass
Expand Down Expand Up @@ -238,6 +268,9 @@ class SourceMeasurementUnit(IntEnum):
5 = Newton (N),
6 = Kilograms (kg)
"""
def _missing_(cls, name):
return cls.UNKNOWN

OTHER = -1
UNKNOWN = 0
JOULE = 1
Expand Down

0 comments on commit 0201fce

Please sign in to comment.