[MMTK] Importing electrostatic potential to MMTK
Konrad Hinsen
hinsen at cnrs-orleans.fr
Fri Oct 5 17:00:15 UTC 2007
On Oct 5, 2007, at 17:33, Pentti Frondelius wrote:
> functional theory calculation done with an another package. However, I
> only found the example script showing, how fit can be done to
> elecrostatic
> potential of point charges, a potential generated with MMTK. So,
> what is
> the exact form of an object to which I can fit the point charges.
> How can
> I make the right kind of object from my 3D-potential array?
You launch the fit using a line like
fit = ChargeFit(system, points)
The argument "points" must be a list of (r, p) tuples, where r is a
Vector object specifying the coordinates of the point (in nm) and p
is the associated electrostatic energy.
You can generate such a list easily from your data using a few lines
of Python code. The details obviously depend on the format of your
file. Assuming that you have one point per line using four numbers
[x, y, z, p], the following code would read it and construct a
suitable list:
from Scientific.Geometry import Vector
points = ""
for line in file("my_data.txt"):
x, y, z, p = [float(x) for x in line.split()]
points.add((Vector(x, y, z), p))
You might have to add unit conversions, depending on your data.
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
---------------------------------------------------------------------
More information about the mmtk
mailing list