On 19 May 2011 13:35, Archambault Fabien
<[email protected]> wrote:
> My trial is on a water molecule (h2o.xyz):
> $ python
> >>> import Avogadro as a
> >>> mol = a.MoleculeFile.readMolecule('h2o.xyz')
> >>> for atom in mol.atoms:
> ... print atom.pos
> ...
> [ 0.00369 2.73505 2.63908]
> [-0.88715 2.29885 2.66616]
> [-0.14964 3.67132 2.43027]
> >>>
>
> Perhaps this is somewhere else?
>
> I also tried something I believed it should work but it did not move the
> atoms:
> >>> mol.center
> array([-0.34436667, 2.90174 , 2.57850333])
> >>> mol.translate(-mol.center)
> >>> mol.center
> array([ 5.55111512e-17, -1.48029737e-16, 4.44089210e-16])
> >>> for atom in mol.atoms:
> ... print atom.pos
> ...
> [ 0.34805667 -0.16669 0.06057667]
> [-0.54278333 -0.60289 0.08765667]
> [ 0.19472667 0.76958 -0.14823333]
> >>>
>
> The center seems to have moved but no atoms really moved...
Actually - it did work, if you compare the figures above. All of the
atoms were translated by -mol.center. You need to have more faith in
yourself!
- Noel
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Avogadro-Discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss