VMD-L Mailing List
From: Michael Kreim (mkreim_at_keychem.de)
Date: Thu Jan 15 2009 - 03:30:55 CST
- Next message: Javier Goicochea: "Understanding topology files?"
- Previous message: Schreiner Eduard: "Re: loosing color when rendering molecular surface in VMD"
- In reply to: Axel Kohlmeyer: "Re: updating DCD frames in python"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
Axel Kohlmeyer wrote:
> [...]
> MK> atoms.frame(fi)
>
> have a look at the documentation again:
>
> frame is a data object and not a method,
> so to move to another frame, you have to do.
>
> atoms.frame=fi
> [...]
thanks a lot for your help but unfortunately this leads to another error.
My code looks now like this:
from molecule import *
from atomsel import *
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(mid, 'dcd', 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()
# ...
But this leads to the error message:
Traceback (most recent call last):
File "VMD", line 75, in ?
TypeError: 'atomsel.atomsel' object has only read-only attributes
(assign to .frame)
Maybe I misunderstand the whole atomsel class. Is there some example
code anywhere on the net? I only found some examples to the old AtomSel
class in the documentation and the hind to run help(atomsel) to get the
documentation for the new class (which contains no examples).
If got another question. You wrote:
> one more remark:
> whether you need to run the update() method
> depends on the selection text. if it is not
> using any "area" operator (e.g. 'within')
> then the update can be avoided and this can
> speed up the analysis significantly.
I understand that I do not need the update() call for constant
selection, but I am not sure if selections like "z>10" are constant.
Can you please help me to make thinks more clear?
Thanks a lot.
With best regards,
Michael
- Next message: Javier Goicochea: "Understanding topology files?"
- Previous message: Schreiner Eduard: "Re: loosing color when rendering molecular surface in VMD"
- In reply to: Axel Kohlmeyer: "Re: updating DCD frames in python"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]