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

Buffered fields in packets #87

Closed tloubrieu-jpl closed 11 months ago

tloubrieu-jpl commented 11 months ago

We have packets with this structure:

  field_A complete data field_C
1 1 yes ertergdfg 3
2 2 no aaaaaa 4
3 4 no bbbbb 4
4 5 yes cccccc 2

The complete field tells if the data field is complete yet or not.

So if complete==no that means the data value to be considered needs to be concatenated with the next packet data field value, as long as the complete value is still no.

So in this case, the data value we want to packet 2 is aaaaaabbbbbcccccc.

It is important to get the values from multiple packets together as specified here because we want to apply a decompression algorithm on top of this value (we were thinking of the CCSDSpy converters) and the algorithm only works on the full data stream, in this example the value aaaaaabbbbbcccccc.

In our case, the values for field_A and field_C of packets 3 or 4 do not matter and can be ignored, but I don't know if this would be true in similar use cases.

Do you know how this could be implemented in CCSDSpy ? Maybe the converter could be an object instance which is persisted for the full CCSDS packet streams ? So that we can buffer the data field value until the field is complete and decompression can be applied to it ? From the documentation there https://docs.ccsdspy.org/en/latest/user-guide/converters.html is sounds to be the case.