ait.core.ccsds module

Consultative Committee for Space Data Systems (CCSDS)

The ait.core.ccsds module provides CCSDS header definitions and datatypes.

class ait.core.ccsds.CcsdsDefinition(*args, **kwargs)

Bases: ait.core.json.SlotSerializer, object

A CcsdsDefinition is analogous to a PacketDefinition, except it defines the expected values in a CCSDS header.

CcsdsDefinition`s are most often specified in a ``ccsds:` block within a YAML !Command or !Packet definition.

__init__(*args, **kwargs)

x.__init__(…) initializes x; see help(type(x)) for signature

apid
length
secondary
seqflags
shflag

Indicates whether a CCSDS Secondary Header is present.

type
version
class ait.core.ccsds.CcsdsHeader(data=None)

Bases: ait.core.tlm.Packet

A CcsdsHeader is just like any other Packet, except that the CCSDS (primary) header FieldDefinition`s are already defined.  That is, there is no need to pass in a :class`PacketDefinition at initialization, only the underlying packet data to decode as a CCSDS header.

__init__(data=None)

Creates a new Packet based on the given Packet Definition and binary (raw) packet data.

Definition = PacketDefinition(ccsds=None, constants=None, desc=None, fields=[FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=224, name='version', shift=5, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=16, name='type', shift=4, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=8, name='shflag', shift=3, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=[0, 1], desc=None, dntoeu=None, enum=None, expr=None, mask=2047, name='apid', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=2, desc=None, dntoeu=None, enum={0: 'Continuation Segment', 1: 'First Segment', 2: 'Last Segment', 3: 'Unsegmented'}, expr=None, mask=192, name='seqflags', shift=6, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=[2, 3], desc=None, dntoeu=None, enum=None, expr=None, mask=16383, name='seqcount', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None), FieldDefinition(_bytes=[4, 5], desc=None, dntoeu=None, enum=None, expr=None, mask=None, name='length', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None)], fieldmap={'shflag': FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=8, name='shflag', shift=3, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), 'seqcount': FieldDefinition(_bytes=[2, 3], desc=None, dntoeu=None, enum=None, expr=None, mask=16383, name='seqcount', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None), 'apid': FieldDefinition(_bytes=[0, 1], desc=None, dntoeu=None, enum=None, expr=None, mask=2047, name='apid', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None), 'length': FieldDefinition(_bytes=[4, 5], desc=None, dntoeu=None, enum=None, expr=None, mask=None, name='length', shift=0, _type=PrimitiveType('MSB_U16'), units=None, when=None, _title=None, aliases=None), 'version': FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=224, name='version', shift=5, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), 'seqflags': FieldDefinition(_bytes=2, desc=None, dntoeu=None, enum={0: 'Continuation Segment', 1: 'First Segment', 2: 'Last Segment', 3: 'Unsegmented'}, expr=None, mask=192, name='seqflags', shift=6, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None), 'type': FieldDefinition(_bytes=0, desc=None, dntoeu=None, enum=None, expr=None, mask=16, name='type', shift=4, _type=PrimitiveType('U8'), units=None, when=None, _title=None, aliases=None)}, functions=None, globals={'pow': <built-in function pow>, 'fsum': <built-in function fsum>, 'cosh': <built-in function cosh>, 'ldexp': <built-in function ldexp>, 'hypot': <built-in function hypot>, 'acosh': <built-in function acosh>, 'tan': <built-in function tan>, 'asin': <built-in function asin>, 'isnan': <built-in function isnan>, 'log': <built-in function log>, 'fabs': <built-in function fabs>, 'floor': <built-in function floor>, 'atanh': <built-in function atanh>, 'sqrt': <built-in function sqrt>, 'frexp': <built-in function frexp>, 'factorial': <built-in function factorial>, 'degrees': <built-in function degrees>, 'pi': 3.141592653589793, 'log10': <built-in function log10>, 'sin': <built-in function sin>, 'asinh': <built-in function asinh>, 'modf': <built-in function modf>, 'atan': <built-in function atan>, '__builtins__': {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'memoryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright (c) 2001-2019 Python Software Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All Rights Reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'NameError': <type 'exceptions.NameError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'dict': <type 'dict'>, 'input': <built-in function input>, 'oct': <built-in function oct>, 'bin': <built-in function bin>, 'SystemExit': <type 'exceptions.SystemExit'>, 'StandardError': <type 'exceptions.StandardError'>, 'format': <built-in function format>, 'repr': <built-in function repr>, 'sorted': <built-in function sorted>, 'False': False, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'list': <type 'list'>, 'iter': <built-in function iter>, 'reload': <built-in function reload>, 'Warning': <type 'exceptions.Warning'>, '__package__': None, 'round': <built-in function round>, 'dir': <built-in function dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 'bytes': <type 'str'>, 'reduce': <built-in function reduce>, 'intern': <built-in function intern>, 'issubclass': <built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError': <type 'exceptions.EOFError'>, 'locals': <built-in function locals>, 'BufferError': <type 'exceptions.BufferError'>, 'slice': <type 'slice'>, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'getattr': <built-in function getattr>, 'abs': <built-in function abs>, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'print': <built-in function print>, 'True': True, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'None': None, 'hash': <built-in function hash>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'len': <built-in function len>, 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information., 'frozenset': <type 'frozenset'>, '__name__': '__builtin__', 'ord': <built-in function ord>, 'super': <type 'super'>, 'TypeError': <type 'exceptions.TypeError'>, 'license': Type license() to see the full license text, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'filter': <built-in function filter>, 'range': <built-in function range>, 'staticmethod': <type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>, 'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in function pow>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'float': <type 'float'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'globals': <built-in function globals>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 'LookupError': <type 'exceptions.LookupError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'basestring': <type 'basestring'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'zip': <built-in function zip>, 'hex': <built-in function hex>, 'long': <type 'long'>, 'next': <built-in function next>, 'ImportError': <type 'exceptions.ImportError'>, 'chr': <built-in function chr>, 'xrange': <type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", 'Exception': <type 'exceptions.Exception'>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'IOError': <type 'exceptions.IOError'>, 'hasattr': <built-in function hasattr>, 'delattr': <built-in function delattr>, 'setattr': <built-in function setattr>, 'raw_input': <built-in function raw_input>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'compile': <built-in function compile>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'str': <type 'str'>, 'property': <type 'property'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'int': <type 'int'>, '__import__': <function __import__>, 'KeyError': <type 'exceptions.KeyError'>, 'coerce': <built-in function coerce>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'file': <type 'file'>, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr': <built-in function unichr>, 'id': <built-in function id>, 'OSError': <type 'exceptions.OSError'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'min': <built-in function min>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'execfile': <built-in function execfile>, 'any': <built-in function any>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 'ValueError': <type 'exceptions.ValueError'>, 'NotImplemented': NotImplemented, 'map': <built-in function map>, 'buffer': <type 'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>, 'TabError': <type 'exceptions.TabError'>, 'callable': <built-in function callable>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, 'eval': <built-in function eval>, '__debug__': True, 'IndentationError': <type 'exceptions.IndentationError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'classmethod': <type 'classmethod'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'OverflowError': <type 'exceptions.OverflowError'>}, 'copysign': <built-in function copysign>, 'cos': <built-in function cos>, 'ceil': <built-in function ceil>, 'atan2': <built-in function atan2>, 'isinf': <built-in function isinf>, 'sinh': <built-in function sinh>, 'trunc': <built-in function trunc>, 'expm1': <built-in function expm1>, 'e': 2.718281828459045, 'tanh': <built-in function tanh>, 'radians': <built-in function radians>, 'lgamma': <built-in function lgamma>, 'erf': <built-in function erf>, 'erfc': <built-in function erfc>, 'fmod': <built-in function fmod>, 'exp': <built-in function exp>, 'acos': <built-in function acos>, 'log1p': <built-in function log1p>, 'gamma': <built-in function gamma>}, history=None, name='CCSDS_Header', uid=1)