Skip to content
Snippets Groups Projects
Commit 3f6e3f87 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

Use Timecode base class

parent 8f800236
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,16 @@ class BaseStruct(c.BigEndianStructure):
return '<%s (%s)>' % (self.__class__.__name__, fields)
class AquaCucTimecode(BaseStruct):
class Timecode(BaseStruct):
def astimestamp(self):
raise NotImplementedError()
def asdatetime(self):
raise NotImplementedError()
class AquaCucTimecode(Timecode):
"""
EOS AQUA implementation of a CCSDS Unsegmented Timecode. An CUT is an
agency defined timecode which is in this case (I think) specific to Aqua.
......@@ -71,7 +80,7 @@ class AquaCucTimecode(BaseStruct):
return self.EPOCH + timedelta(seconds=seconds, microseconds=micros)
class DaySegmentedTimecode(BaseStruct):
class DaySegmentedTimecode(Timecode):
_pack_ = 1
_fields_ = [
('days', c.c_uint16),
......@@ -216,16 +225,12 @@ def jpss_header_lookup(primary_header):
grouping = primary_header.sequence_grouping
if grouping == GROUP_FIRST:
return JpssFirstSecondaryHeader
#elif grouping == GROUP_CONTINUING:
# return JpssSecondaryHeader
#elif grouping == GROUP_LAST:
# return JpssSecondaryHeader
elif grouping == GROUP_STANDALONE:
return JpssSecondaryHeader
_aqua_headers = aqua_headers()
def aqua_header_lookup(primary_header): # noqa
apid = primary_header.apid
grouping = primary_header.sequence_grouping
return _aqua_headers.get((apid, grouping))
_aqua_headers = aqua_headers()
......@@ -9,10 +9,6 @@ from edosl0util.stream import (
make_streams,
)
# date used as a flag value for comparissons
_FLAG_DATE = datetime(1900, 1, 1)
LOG = logging.getLogger(__name__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment