VMD-L Mailing List
From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Wed May 21 2008 - 22:58:01 CDT
- Next message: INPE (Ingrid Viveka Pettersson): "Crystal water"
- Previous message: Peter Jones: "scale trajectory coords"
- In reply to: Peter Jones: "scale trajectory coords"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
On Thu, 22 May 2008, Peter Jones wrote:
PJ> Hi all,
PJ>
peter,
you are almost there.
PJ> I'm trying to write a small tcl script that will change all the coordinates
PJ> in a simulation trajectory to nanometers (ie scale by 0.1).
PJ> I have tried-
PJ>
PJ>
PJ> set all [atomselect top "all"]
PJ> set num_steps [molinfo top get numframes]
PJ>
PJ> for {set frame 0} {$frame < $num_steps} {incr frame} {
$all frame $frame
set newcoords {}
PJ> foreach coord [$all get {x y z}] {
PJ> set new [vecscale 0.1 $coord]
PJ> lappend newcoords $new
PJ> }
PJ>
PJ> $all set {x y z} $newcoords }
PJ>
PJ>
PJ>
PJ> but I get an error about mismatched data sets, there seems to be twice the
PJ> number of coordinates.
because you are not clearing the list.
cheers,
axel.
PJ>
PJ>
PJ> Any help would be greatly appreciated,
PJ>
PJ> thanks,
PJ>
PJ>
PJ> Peter Jones
PJ>
-- ======================================================================= Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu Center for Molecular Modeling -- University of Pennsylvania Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323 tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425 ======================================================================= If you make something idiot-proof, the universe creates a better idiot.
- Next message: INPE (Ingrid Viveka Pettersson): "Crystal water"
- Previous message: Peter Jones: "scale trajectory coords"
- In reply to: Peter Jones: "scale trajectory coords"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]