Amber-MD / pytraj

Python interface of cpptraj
https://amber-md.github.io/pytraj
170 stars 38 forks source link

writing trajectoreis deletes time information #1515

Closed pindakaas42 closed 4 years ago

pindakaas42 commented 4 years ago

Using the save method of the Trajectory object as a .nc file sets all time information in eacht frame to zero. (also happens with TrajectoryIterator) Version: pytraj-2.0.5-py2.7-linux-x86_64.egg

hainm commented 4 years ago

hi @pindakaas42, can you please try pytraj.write_traj with time=True?

https://github.com/Amber-MD/pytraj/pull/1456

pindakaas42 commented 4 years ago

okay that works, thanks.

pindakaas42 commented 4 years ago

my only question would be why you would want to write zeros instead of the actual time? This should save neither computation time in any relevant way nor disk space, as the file is filled with zeros.

hainm commented 4 years ago

@pindakaas42 good question. When I introduced the time=False option, I thought that time won't be written to the output file. Let me doublecheck and turn it on as default if what you said is true. thanks.

hainm commented 4 years ago

my only question would be why you would want to write zeros instead of the actual time?

... when there is no actual time, e.g: writing a bunch of pdb files to .nc format.