Next: High-level Python Interface
Up: Controlling VMD from Python
Previous: trans
Contents
Index
vmdnumpy
This optional module is made available from within the toplevel VMD module
if VMD detects a Numeric Python installation in the Python search path.
When present, the following methods are provided:
- timestep(molid, frame):
Returns a single-precision Numeric array containing a direct
reference to the given set of atom coordinates. Atom coordinates
are arranged xyzxyzxyz... for each atom in the molecule. No
copy of VMD's internal coordinates is made; therefore, modifications
to this array will directly affect atom coordinates in VMD. Using the
array after the timestep has been deleted will likely cause VMD to crash.
The advantage is maximum efficiency and the ability to easily modify
atom coordinates without going through the atom selection interface.
- atomselect(molid, frame, selection):
Returns an array of int's representing flags for on/off atoms in
the given atom selection. The syntax for the selection is the same
as for the AtomSel class. An array of this form can be used in conjunction
with the Numeric take function to get selected coordinates from
a timestep. Creating the array in this way can be 50-100 times faster
than converting from an AtomSel object.
Next: High-level Python Interface
Up: Controlling VMD from Python
Previous: trans
Contents
Index
vmd@ks.uiuc.edu