From: Michael Kreim (mkreim_at_keychem.de)
Date: Wed Jan 14 2009 - 09:55:06 CST

Hello,

I have a NAMD trajectory split up in several dcd files named md.1.dcd,
md.2.dcd, ...., md.35.dcd. Each file contains several frames.
For analysing this data I started a small python script that loops
trough all frames (see below).

My problem is, that I don't understand how I can update the frame of an
atomselection.
I tried
atoms.frame(fi)
but this results in the error message:
Traceback (most recent call last):
  File "VMD", line 73, in ?
TypeError: 'int' object is not callable

Do I have misunderstood the syntax or is my concept wrong? Maybe I have
to create a new atomselection in each step of the second loop?

Thanks for your help.

With best regards,

Michael Kreim

My python script (using VMD 1.8.6 on linux with python 2.2.3):

from molecule import *
from atomsel import *
import sys

psffile = 'md.psf'
dcds = 'md.'
asel = 'water and name OH2 and z>15'
firstdcd = 1
lastdcd = 35

for dcdi in range(firstdcd,lastdcd+1):

    mid=load('psf',psffile)
    dcdfile=dcds+str(dcdi)+'.dcd'
    read(molid=mid, type='dcd', filename=dcdfile, beg=0, end=-1, skip=1,
waitfor=-1)

    N=numframes(mid)

    atoms=atomsel(asel,molid=mid)

    for fi in range(0,N):

        atoms.frame(fi)
        atoms.update()

        # start the analysis

    delete(mid)

sys.exit()