I am quite new to programming with Python and data analysis.
Let me introduce my problem: I have a binary file .bin which contains some data about telemetry from a satellite, and I need to extract just some of this data. In order to know what data I need to extract I have a .csv file which tells me the Hexa Adress, the bytes and the data type in which it is contained (At least this is what I have understand so far).
I have managed to just open the data and load it, but I don't even know what do I need to do, first to decode this binary data and then to extract the one I have.
import struct
path = 'C:/Users/Jose Herrera/Downloads/telemetry.bin'
file = open(path, 'rb')
data = file.read()
file.close()
So, I am trying to get this data from struct.unpack('III', data[124:136])
, but I am not sure if this is correct as I get (1354956800, 0, 0)
as result. I think this should be floating point, but I don't know how to unpack or decode these values.
question from:
https://stackoverflow.com/questions/65831431/reading-data-form-binary-bin-file-in-python-how-can-i-decode-floating-point-va 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…