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

Provide access to data in the primary ccsds header #15

Closed ehsteve closed 1 year ago

ehsteve commented 1 year ago

The class ccsdspy.FixedLength provides load() which returns a dictionary with the data from the packet fields but does not provide any info from the primary ccsds header.

Values which would be very helpful would be

My preference would be to provide all of the cssds header values.

ddasilva commented 1 year ago

Thanks for the suggestion @ehsteve !

This makes sense, especially for debugging. Notionally. in most cases where you would know enough about the packet to define it's fields for CCSDSPy you would also know the APID of the packet. But it would make sense to have this as a backup check to ensure that stream that of supposedly all the same APID is really so.

I think this could be implemented as a keyword argument include_primary_header=True in the load() method, which if set (default to False) will include primary header fields in the return dictionary (maybe with some prefix to the keys eg Header:apid. Or maybe return two dictionaries. What do you think?

ehsteve commented 1 year ago

I like that approach!