Re: Extracting data

From: Stephan Grein (grein_at_informatik.uni-frankfurt.de)
Date: Wed Feb 04 2015 - 05:56:47 CST

Sorry,

it's not lindex in lines 3-4 but llength of course.

Best,
Stephan
Am 04/02/15 12:55, schrieb Stephan Grein:
> Dear NAMD users,
>
> i want to extract information from my DCD file as follows:
>
> set from {1 10 20 30}
> set to {40 50 60 70}
> set from_len [lindex $from]
> set to_len [lindex $to]
> set steps_start 101
>
> for {set i $steps_start} {$i < $num_steps} {incr i} {
> for {set j 0} {$j < $from_len} {incr j} {
> for {set k 0} {$k < $from_len} {incr k} {
> set mysel1 [atomselect top "index [lindex $from $j]"]
> set mysel2 [atomselect top "index [lindex $to $k]"]
> # do something with the selection, then delete it
> $mysel1 delete
> $mysel2 delete
> }
> }
> animate goto $i
> }
>
> But for me, this is horribly slow.
> Is there any obvious failure in my snippet?
>
> Would be glad, if someone could point it out.
>
> Best regards,
> Stephan
>

This archive was generated by hypermail 2.1.6 : Thu Dec 31 2015 - 23:21:37 CST