Re: [AMBER] Using Pytraj to read and write velocity files

From: Korey M Reid <>
Date: Wed, 6 Jun 2018 04:03:40 +0000

Hello Hai,

I have produced separate coordinate and velocity netcdf trajectory files with input options ntwx=5 and ntwv=2.5. This is so I can accurately calculate the midpoint of the velocity trajectory timepoints so that they match the coordinate timepoints. I would like to perform this with pytraj. However when I attempt to load the velocity trajectory files like so:

>traj_vel = pt.load('vel.netcdf',top='top.parm7')

the velocities fail to load. When I check the trajectory:


the output reads:

pytraj.Trajectory, 0 frames:
Size: 0.000000 (GB)
<Topology: 30220 atoms, 8815 residues, 8525 mols, PBC with box type = truncoct>

and if I attempt to follow your example (thank you for this example I used it as a reference some time ago to extract the t0-dt/2 frame some time ago) running the following command in python:


there is no output, which supports the 0GB trajectory file which from my simulations should read 4GB or so. This is why I am curious if like cpptraj there is an option to read velocities as coordinates since I am having such difficulty finding a solution to my needs.

Thank you for your help!

With best,


From: Hai Nguyen <>
Sent: Saturday, June 2, 2018 3:44:59 PM
To: AMBER Mailing List
Subject: Re: [AMBER] Using Pytraj to read and write velocity files

Hi Korey,

Can you elaborate about "unsuccessful at reading in velocity netcdf files
produced from simulation"? (e.g: what's command you used?)
PS: I've posted an example a while ago and I hope that helps:


On Sat, Jun 2, 2018 at 12:08 AM, Korey M Reid <> wrote:

> Dear all,
> I have been able to extract velocity coordinates from a restart file up to
> know for calculations down the line. However, I have been unsuccessful at
> reading in velocity netcdf files produced from simulation. Is there a flag
> that I have been unable to identify such as in cpptraj's usevelascoords?
> The reason I ask is that I would like to code my analysis in python and I
> need to slice things in an unexpected way and would like to avoid rerunning
> some long simulations. As always thank you for your input and time!
> With best,
> Korey Reid
> University of Nevada, Reno
> Chemistry Dept.
> Emphasis: Energy flow, Barrier conductance accross proteins, entropy meters
> _______________________________________________
> AMBER mailing list
AMBER mailing list
AMBER mailing list
Received on Tue Jun 05 2018 - 21:30:02 PDT
Custom Search