I'm reading a complex binary file, where there is a fixed array of values, could anyone 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!