Re: how obtain .xst form .dcd file?

From: Erik Santiso (esantiso_at_mit.edu)
Date: Wed Mar 23 2011 - 17:24:16 CDT

Assuming you don't care about the origin information, you'd need to do
something like this (first trim the dcd file with catdcd):

package require pbctools
set fp [open "myfile.xst" w]
set sel [atomselect top all]
for {set i 0} {$i<250} {incr i} {
   $sel frame $i
   set vecs [lindex [pbc get -namd] 0]
   puts $fp [expr 10000*$i] nonewline
   puts $fp " " nonewline
   for {set j 0} {$j<3} {incr j} {
     set vec [lindex $vecs $j]
     for {set k 0} {$k<3} {incr k} {
       puts $fp [format "%.4f" [lindex $vec $k] ] nonewline
       puts $fp " " nonewline
     }
   }
   puts $fp "0 0 0"
}
close $fp

Erik.

On 3/23/11 1:59 PM, wood irene wrote:
> Thanks Erik,
> My .dcd has 2500000 steps and 2500 frames, and I must to obtain an .xst
> recorded every 10000 steps, that means that I must to get 250 times
> the dimensions of the simulation box. There is any alternative way two get
> the whole .xst file in only one step?
> Regards
>
> 2011/3/21 Erik Santiso<esantiso_at_mit.edu>
>
>>
>> Hi Irene,
>>
>> If there is unit cell information in the dcd file, you can get the unit
>> cell parameters with vmd. Just open the file with vmd and use molinfo get or
>> pbctools. With pbctools you'd do something like:
>>
>> package require pbctools
>> pbc get -namd
>>
>> That will give you the cell vectors. As far as I know, however, the origin
>> is not stored in the dcd file. Depending on what you want to do this may not
>> be important.
>>
>> Erik.
>>
>>
>> On 3/21/11 10:25 AM, wood irene wrote:
>>
>>> Dear all,
>>> could someone help me to get a .xst file from a .dcd file?
>>> thank in advance
>>> Irene
>>>
>>>
>
>

This archive was generated by hypermail 2.1.6 : Mon Dec 31 2012 - 23:19:59 CST