I am using the format as '<h4l12fl' in struct.pack() function in python. However what I noticed that in two different computers the result is different although the python version and modules are same in both computers. (The chipset in one of them is AMD and the other is Intel). Can anyone help me what to do as the intel one is producing the right results.
The code I am using is:
with open(path + '.bts', 'wb') as fl:
# write the header
fl.write(pack(_TS_BIN_FMT,
[7, 8][periodic], # 7 is not periodic, 8 is periodic
nz,
ny,
0, # assuming 0 tower points below grid
nt,
dz,
dy,
dt,
uhub,
zhub,
z[0],
u_scl[0],
u_off[0],
u_scl[1],
u_off[1],
u_scl[2],
u_off[2],
len(desc_str)))
fl.write(desc_str.encode(encoding='UTF-8'))
# Swap the y and z indices so that fortran-order writing agrees with the file format.
# Also, we swap the order of z-axis to agree with the file format.
# Write the data so that the first index varies fastest (F order).
# The indexes vary in the following order:
# component (fastest), y-index, z-index, time (slowest).
#fl.write(np.rollaxis(out, 2, 1).tobytes(order='F'))
fl.write(out.tobytes(order='F'))