1
I am reading a complex binary file, where there is a fixed structure of 'array' of values, someone could help?
The structure is:
8 bytes = Long Current Time (unixtime stamp)
8 bytes = Long Current Time (unixtime stamp in MiliSeconds)
8 bytes = Long Server Time (unixtime stamp)
8 bytes = Long Ticks from windows startup
8 bytes = Long Microseconds from windows startup
X[
1 byte = UChar (sensor on/off)
8 bytes = Double (sensor converted value)
8 bytes = Long (sensor raw value)
]
X is the array with 3 values, the size of X is fixed normally 32 or 16, but inside the file is always the same size, the example I will use is 32:
dt = np.dtype([('a' ,np.datetime64),
('b' ,np.datetime64),
('c' ,np.datetime64),
('d' ,'u8'),
('e' ,'u8'),
#aqui esta o meu problema, como faço este trecho se repetir 32 vezes?
{'name': ['f', 'g', 'h'] , 'formats':['u1','f8', 'u8']}
])
print(dt,type(dt))
print(dt.fields)
print(np.fromfile("sensores.32.bin", dtype=dt))
Thank you!
Welcome to the Stackoverflow in Portuguese. As the name suggests, the official language used here is Portuguese. So, could you please translate your question? If you prefer, you can also ask the same question on Stackoverflow website in English.
– Denis Rudnei de Souza
how do I change the text I’ve already written? was the first message I posted here
– user2559936
Click on the button [Edit]
– Denis Rudnei de Souza
done, thanks @Denisrudneidesouza
– user2559936