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
74 stars 18 forks source link

Allow optional secondary header fields based on secondary header flag #65

Open ddasilva opened 1 year ago

ddasilva commented 1 year ago

This tends to not happen very often in practice, but it's part of the spec and we should support it. PacketField's should have a keyword argument secondary_header=True (defaults False). When this keyword argument is true, they are only included parsed into the packet body when the secondary header flag is 1.

The array in the return dictionary should be made a MaskedArray in this case. It only makes sense to do this for VariableLength, because the FixedLength decoder relies on fixed spacing between the packets.

ddasilva commented 1 year ago

This is solved by the more general solution proposed in #72