CCSDSPy / ccsdspy

I/O interface and utilities for CCSDS binary spacecraft data in Python. Library used in flight missions at NASA, NOAA, and SWRI
https://ccsdspy.org
BSD 3-Clause "New" or "Revised" License
75 stars 18 forks source link

Add the ability to parse variable length packets #24

Closed ehsteve closed 1 year ago

ehsteve commented 1 year ago

Many ccsds packets are not fixed length. The easiest way to implement this capability would be to add a new PacketField without a length specified. If only one such PacketField is defined that way, it would be possible to parse the rest of the packet and then fill the remainder of the packet values into this variable length PacketField.

ddasilva commented 1 year ago

This has been on my radar for a while, but no one has been able to get me example data that uses variable length packets. Do you have any to share?

The way I see this fitting in is with a VariableLength class that works similar to how you mentioned. It would need a rewritten decoder, because the existing method won’t work. The new decoder, if written in python, would most likely be slower because it can’t use vectorization. But maybe it could be Cython.

ddasilva commented 1 year ago

Test data added in #34