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 define array items using `from_file` #48

Open ehsteve opened 1 year ago

ehsteve commented 1 year ago

I would suggest the following convention

name, bit_length, data_type
ARRAY, 8, uint(16)

So uint(shape). This matches the programmatic way to define it and does not add too much complexity to the csv file.

PacketArray(name='SENSOR_GRID', data_type='uint', bit_length=16,
            array_shape=(32, 32), array_order='C')
ddasilva commented 1 year ago

This sounds like a very elegant solution. For expanding fields, can be fieldname(expand) or fieldname(*).

I plan on adding a capability to have an array shape be defined by a preceding field in the packet. this allows multiple variable length fields in the same packet. I was told a few instruments being developed at LASP do this with their packets. in this spec, that could be written out as fieldname(otherfield). if we do that maybe we should change fieldname(expand) and array_shape=“expand” to just fieldname(*) and array_shape=“*” so no one thinks there is a field called expand.

We should really put together a page on the site which describes this csv format, too

ddasilva commented 1 year ago

Leaving this open after #49 finished to implement fieldname(*)