Support reading xyz format for dataset?
hi,
writing .xyz format is ok in pytraj but getting error for reading.
In [12]: traj = pt.load('../tz2.crd', '../tz2.parm7')
In [13]: traj.save("test.xyz")
In [14]: pt._verbose()
In [15]: pt.load("test.xyz", traj.top)
Reading '/Users/haichit/pytraj_github/pytraj/cpptraj/test/Test_XYZformat/test.xyz' as XYZ
Single title detected.
Error: Cannot use trajectories with unknown # of frames as data set.
Can cpptraj support reading xyz format to DataSet_Coords_TRJ since pytraj uses it under the hood? thanks.
Hmm...I'll have to think about the best way to do this. Since the XYZ format is not well-defined, the only way to reliably detect the number of frames in an XYZ trajectory is to read through the actual trajectory. We could probably estimate the number of frames semi-reliably assuming the number of atoms/title sizes/etc do not change throughout the trajectory. Also, it's likely that XYZ format trajectories are not that long, so doing a blank read through to determine the number of frames might not be that costly.
Also, it's likely that XYZ format trajectories are not that long, so doing a blank read through to determine the number of frames might not be that costly.
yeah, agree.