Hi,
You can give pytraj (python interface of cpptraj) a try. Please see below
example (with ipython)
In [36]: import numpy as np
In [37]: import pytraj as pt
In [38]: traj = pt.load('data/tz2.nc', 'data/tz2.parm7', frame_indices=[0,])
# take 1st frame.
In [39]: v = np.random.rand(traj.n_frames, traj.top.n_atoms, 3) # or any 3d
array you want.
In [40]: traj.velocities = v
In [41]: traj.save('test.rst7', crdinfo={'has_velocity': True})
In [42]: !ls test.rst7.1
test.rst7.1
In [43]: traj2 = pt.load('test.rst7.1', top=traj.top)
In [44]: traj2.velocities
Out[44]:
array([[[ 0.0679721, 0.9868183, 0.0208989],
[ 0.9172472, 0.421962 , 0.1716633],
[ 0.4589834, 0.9581008, 0.6106007],
...,
[ 0.4099388, 0.7560913, 0.4540014],
[ 0.8590423, 0.0519312, 0.96421 ],
[ 0.5929765, 0.5500232, 0.5587808]]])
Let us know if that's what you want.
I hope you can find (richful) information here:
http://amber-md.github.io/pytraj/latest/index.html
Hai
On Fri, May 4, 2018 at 8:42 AM, <diego.soler.uam.es> wrote:
>
> Hi,
>
> I want to perform a free simulation in which the initial velocities of
> a certain atoms are particular vectors to be specified by me. Is there
> any simple way to achieve this?
>
> More specifically, I want to manually set the initial values of the
> projections over certain directions of the velocites of my atoms of
> interest.
>
> The Amber rsmd files are awful to deal with, and I'm guessing there
> should a simpler way to do this sort of things?
>
> Thanks,
> Diego SP
>
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue May 08 2018 - 20:30:03 PDT