15 f = h5py.File(infilename)
16 dset = f[list(f.keys())[0]]
18 vals = np.zeros(np.shape(dset), dtype=
'float32')
19 for i
in range(np.size(dset, 0)):
20 vals[i, :] = np.asarray(dset[i], dtype=
'float32')
21 vals = list(np.reshape(vals, (vals.size)))
23 with open(outfilename,
'wb')
as outfile:
24 outfile.write(struct.pack(
'f' * len(vals), *vals))