You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following data file 'test.unv',which exported from Simcenter Test.lab 2021 in binary format, can not load with pyuff in python.
I found that this unv file is badly format.
I changed the _extract58 function in dataset_58.py file to correct load my 'test.unv' data, code changed list below:
if binary:
split_data = b''.join(block_data.splitlines(True)[13:])
if dset['byte_ordering'] == 1:
bo = '<'
else:
bo = '>'
if (dset['ord_data_type'] == 2) or (dset['ord_data_type'] == 5):
# single precision - 4 bytes
values = np.asarray(struct.unpack('%c%sf' % (bo, int(len(split_data) / 4)), split_data[:int(len(split_data) / 4)*4]), 'd')
else:
# double precision - 8 bytes
values = np.asarray(struct.unpack('%c%sd' % (bo, int(len(split_data) / 8)), split_data[:int(len(split_data) / 8)*8]), 'd')
After Changed this codes, I finally load my data.
Is that right?
dear @masonacezllk there are several datasets in the attached test.zip file. Can you please prepare a minimum working example? (single dataset, short example of data)
The following data file 'test.unv',which exported from Simcenter Test.lab 2021 in binary format, can not load with pyuff in python.
I found that this unv file is badly format.
I changed the _extract58 function in dataset_58.py file to correct load my 'test.unv' data, code changed list below:
After Changed this codes, I finally load my data.
Is that right?
test.zip
The text was updated successfully, but these errors were encountered: