CCSDSPy

CI Status https://img.shields.io/pypi/pyversions/ccsdspy.svg Code Coverage Zenodo DOI

CCSDSPy provides an IO Interface for reading CCSDS data in Python. The CCSDS format is used for many NASA and ESA missions for low-level telemetry, and often contains tightly packed bits to reduce downlink requirements. The library is developed with requirements sourced from the community and extensive automated testing.

Used By

_images/goes-r.png _images/hermes.png _images/punch.png _images/mms.jpg _images/spherex.png _images/elfin.jpg

Do you know of other missions that use CCSDSPy? Let us know through a github issue!

Install ccsdspy

To install ccsdspy from source, you can use

pip install ccsdspy

Brief Tour

Fixed length packets are one type of packet defined in the CCSDS packet standard. This kind of packet has packets that does not change in length. When provided with a description of the layout of the packet data (not including the primary CCSDS header), ccsdspy.FixedLength will decode the fields automatically using highly efficient vectorized shifting and masking.

The result is a dictionary, containing ccsdspy.PacketField names as keys. The dictionary values are arrays containing the parsed packet data. A simple example is shown below.

import ccsdspy
from ccsdspy import PacketField, PacketArray

pkt = ccsdspy.FixedLength([
     PacketField(name='SHCOARSE', data_type='uint', bit_length=32),
     PacketField(name='SHFINE',   data_type='uint', bit_length=20),
     PacketField(name='OPMODE',   data_type='uint', bit_length=3),
     PacketField(name='SPACER',   data_type='fill', bit_length=1),
     PacketField(name='VOLTAGE',  data_type='int',  bit_length=8),
     PacketArray(
         name='SENSOR_GRID',
         data_type='uint',
         bit_length=16,
         array_shape=(32, 32),
         array_order='C'
     ),
])

result = pkt.load('MyCCSDS.tlm')