Thank you for the help! I appreciate the time. That example nailed what I am trying to do perfectly.
The format of the actual input file consists of a mix of u8, u4, f8, and f4 variables in multi-frame image data with image header data then image data for each frame. There's about 250 header variables in total before each frame of image data. Some header data are single values and some are vectors, and they are stored in different sub-levels of header information.
The struct.unpack() looks like a good alternative to what I've been trying - variable.append(np.fromfile()) - which had some limitations for setting up arrays of different dimensionality.
The only issue I see is that some variables may need to be indexed as vectors later on - I just need to figure out converting the resulting dictionaries to vectors for this approach as needed - like converting
filedata[file][shift][:], or
filedata[:][numshifts]
to vectors. I'm not sure about the easiest way to retrieve those two examples of vectors.
The format of the actual input file consists of a mix of u8, u4, f8, and f4 variables in multi-frame image data with image header data then image data for each frame. There's about 250 header variables in total before each frame of image data. Some header data are single values and some are vectors, and they are stored in different sub-levels of header information.
The struct.unpack() looks like a good alternative to what I've been trying - variable.append(np.fromfile()) - which had some limitations for setting up arrays of different dimensionality.
The only issue I see is that some variables may need to be indexed as vectors later on - I just need to figure out converting the resulting dictionaries to vectors for this approach as needed - like converting
filedata[file][shift][:], or
filedata[:][numshifts]
to vectors. I'm not sure about the easiest way to retrieve those two examples of vectors.