-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
I have a buffer of data from an ADC, which i am trying to access as an ndarray
The 1024 byte buffer is organised in 'frames' of 8 bytes, the bytes of interest in each frame being 1 through 6, being three pairs of 16 bit samples.
If I ignore the last byte of the buffer, I can get the buffer as an ndarray uising
buffer = b'\x40\x00\xda\xff\xd6\xc1\x2e\x0d\x40\x00\xde\xff\xca\xc1\x3c\x0d\x40\x00\xe6\xff\xc4\xc1\x40\x0d\x40\x00\xe0\xff\xb8\xc1\x32'
a = np.frombuffer(buffer, dtype=np.uint16, offset=1)
but the result is byteswapped values e.g
a: array([55808, 55039, 11969, ..., 57344, 47359, 12993], dtype=uint16)
dtype = np.>uint16 causes a reboot, any ideas how this can be achieved?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested