[MMTK] how to calculate VDOS from trajectory, for a set of atoms with each having different time lengths

Nitin kumar.nitin at gmail.com
Thu Sep 18 13:43:55 UTC 2008

Dear Konrad,

I was wondering if nMoldyn can be used to calculate the VDOS from trajectory
information ( in *.nc format), where a set of atoms with *different time
lengths* for each of them can be chosen and processed simulataneously.

I know how to choose a set of atoms of one type of atom*:*

#we run it as:  pMoldyn --dos-xyz --input at_sel

from MMTK import *
title = 'Density of states (from coordinates)'
trajectory = ['abc.nc']
log_file = 'dos-xyz_abc.log'
time_info = (2000, 3500, 1)
#atoms = {'atomA': ['*'], 'atomB': ['*'], 'atomC': ['*']}
projection_vector = None
weights = 'mass'
differentiation = 'fast'
ft_window = 90
units_length = Units.nm
units_frequency = 1/Units.ps
frequency_points = 1500
output_files = {'dos': 'DOS_abc.plot'}

def atoms_code(trajectory):
     import MMTK
     selection = MMTK.Collection()
     universe = trajectory.universe
     atoms = universe.atomList()
     for atom in atoms:
       if atom.name[:5] == 'atomB':
         if n == 23 or n == 25:
     return selection

this finds VDOS of 23rd and 25th atom of type 'atomB' for time steps 2000 to
3500 for both of them.

How should i find VDOS of let say 23rd and 25th atom, where i want '*t1*'
time steps to be used for 23rd atom and '*t2*' time steps to be used for
25th atom.

Thank You.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20080918/fb49f668/attachment.htm>

More information about the mmtk mailing list