[MMTK] Change the number of frames in normal modes visualization

Ramon Crehuet rcrehuet at gmail.com
Tue Nov 13 10:00:52 UTC 2007


Thanks,
I wanted to get more intermediate steps for a better resolution, but now I
see that I only have to generate the list 'frames' with more intermediate
elements between conf and conf+factor*mode.
Ramon


2007/11/12, Konrad Hinsen <hinsen at cnrs-orleans.fr>:
>
> On 12.11.2007, at 14:37, Ramon Crehuet wrote:
>
> > NormalModes.mode.view is a practical way of visualizing normal
> > modes. But I would like MMTK to use more frames when generating the
> > normal mode trajectory that is sent to the visualization software.
> > Is that possible in a simple way?
>
> What do you want to change exactly? Do you want to repeat the frames
> to view several periods, or add intermediate steps for better spatial
> resolution?
>
> Anyway, the solution is very similar in both cases. The view() method
> ends up calling the function Visualization.viewMode(). Changing this
> function lets you specify whatever you want. An example (untested!):
>
> import MMTK.Visualization
>
> def myViewMode(mode, factor=1., subset=None, label=None):
>      universe = mode.universe
>      if subset is None:
>          subset = universe
>      conf = universe.configuration()
>      frames = 2*[conf, conf+factor*mode, conf, conf-factor*mode]
>      MMTK.Visualization.viewSequence(subset, frames, 1, label)
>
> MMTK.Visualization.viewMode = myViewMode
>
>
> This particular patch will show two periods of the mode. It should be
> straightforward to adapt it to what you want.
>
> Konrad.
> --
> ---------------------------------------------------------------------
> Konrad Hinsen
> Centre de Biophysique Moléculaire, CNRS Orléans
> Synchrotron Soleil - Division Expériences
> Saint Aubin - BP 48
> 91192 Gif sur Yvette Cedex, France
> Tel. +33-1 69 35 97 15
> E-Mail: hinsen at cnrs-orleans.fr
> ---------------------------------------------------------------------
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://starship.python.net/pipermail/mmtk/attachments/20071113/813cdd19/attachment.htm 


More information about the mmtk mailing list