medley56 / space_packet_parser

A CCSDS telemetry packet decoding library based on the XTCE packet format description standard.
https://space-packet-parser.readthedocs.io
Other
19 stars 5 forks source link

Example for creating numpy arrays of data #65

Open greglucas opened 1 week ago

greglucas commented 1 week ago

The current examples describe how to get individual data items and inspect them, but I suspect most people are wanting to fill arrays or some other data structures from the data. On IMAP we have a utility function to handle creating xarray.Dataset objects for each apid. I suspect a utility function like this would be valuable to other missions as well, but I don't think we'd want to add large dependencies to the library. Maybe we could add optional dependencies hidden behind try/except ImportError blocks to support some of these utilities? Or the easiest would be to add examples of how to do this and let everyone copy/paste the examples.

Example code for creating a mapping of apid: Dataset https://github.com/IMAP-Science-Operations-Center/imap_processing/blob/373f9f382260188d94366007853b673982ba1275/imap_processing/utils.py#L298-L332

medley56 commented 1 week ago

As long as the code is compact enough (e.g. in its own module), hiding things behind import errors works for me. We can add the dependencies in an "extra" dependency set.