VasiliBaranov/packing-generation

read the output file

sajadmhmzd opened this issue · 1 comments

Hi, how can i read the output file (.xyzd file)? it seem in binary format and i dont know how read it as a x y z coordinate.

Hi,

It depends on the language you are most comfortable with.

Please see this discussion: #16

One option from this link is:

hexdump -v -e '4 "%f "' -e '"\n"' < packing.xyzd > centers_in_ascii.txt

Someone posted a python code here: #30

Just reading the file as it is in python is:

import numpy as np
packing = np.fromfile('packing.xyzd').reshape(-1, 4)

Hope this helps!

Best Regards,
Vasili