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
In some cases (when xtc is created with DESMOND) the timestep saved in xtc file is incorrect. It can be easier to set up the correct timestep for the loaded trajectory.
This feature is available for DCD writer and reader, and at least for the reader it should be straightforward to implement. I can work on it next week.
Describe the solution you'd like
Implement the support of timestep setting for XTC writer and reader.
Describe alternatives you've considered
My current workaround is to load xtc, then write dcd with the desired timestep and then read it back.
Additional context
The text was updated successfully, but these errors were encountered:
Create a PR and then we can see what this would look like.
XTC and TRR files do not store the dt but include each individual time (and we just calculate dt from the first two frames) so I am not sure that the same approach as for DCD will work.
Original dt 100.00000762939453
Original times [0.0, 100.00000762939453, 200.00001525878906, 300.0, 400.0000305175781, 500.0000305175781, 600.0, 700.0000610351562, 800.0000610351562, 900.0000610351562]
Now we are adding the transformation
defset_time(dt):
"""Set time to frame * dt"""defwrapped(ts):
ts.dt=dtts.time=ts.frame*dtreturntsreturnwrappedu.trajectory.add_transformations(set_time(33.33))
print("New dt", u.trajectory.dt)
print("New times", [ts.timefortsinu.trajectory])
and we get
New dt 33.33
New times [0.0, 33.33, 66.66, 99.99, 133.32, 166.64999999999998, 199.98, 233.31, 266.64, 299.96999999999997]
(You can then analyze the trajectory or write it out to another XTC but with correct time stamps.)
Is your feature request related to a problem?
In some cases (when xtc is created with DESMOND) the timestep saved in xtc file is incorrect. It can be easier to set up the correct timestep for the loaded trajectory.
This feature is available for DCD writer and reader, and at least for the reader it should be straightforward to implement. I can work on it next week.
Describe the solution you'd like
Implement the support of timestep setting for XTC writer and reader.
Describe alternatives you've considered
My current workaround is to load xtc, then write dcd with the desired timestep and then read it back.
Additional context
The text was updated successfully, but these errors were encountered: