Package schrodinger :: Package trajectory :: Module analysis :: Class Grid3D
[hide private]
[frames] | no frames]

Class Grid3D

object --+
         |
        Grid3D

A class for representing a function of 3D Cartesian coordinates discretize onto a grid. Numpy arrays are used extensively, and are returned by most methods.

Instance Methods [hide private]
 
__init__(self, origin=[0.0, 0.0, 0.0], spacing=[1.0, 1.0, 1.0], length=[1.0, 1.0, 1.0], default_radius=1.5)
arguments: origin => a list containing the Cartesian coordinates of the grid's origin in the lab frame spacing => a list (a,b,c) containing the spacing between grid points length => a list (l,m,n) containing the absolute lengths of the grid in each direction
 
setOrigin(self, origin)
Reposition the origin of the grid in the lab frame
 
normalize(self)
Normalize the grid values
 
pointIsOutOfBounds(self, point)
Returns True if the point (x,y,z) is outside the space represented by the grid.
 
pointForIndex(self, index)
Given grid index (a,b,c), return the corresponding point in 3D space
 
nearestIndexToPoint(self, point)
Returns the grid indices (a,b,c) that are closest to the point (x,y,z).
 
writeCNS(self, filename=None, norm=True)
 
mapAtomToGrid(self, atom, scale_radius=1.0)
Assigns atom density to the grid based on the atom's position.
 
mapPointToGrid(self, point)
Maps a single point to the grid, assuming a default radius
 
mapAtomListToGrid(self, st, atom_list=[], scale_radii=1.0)
Given a Structure object and a list of atom indices, map atoms in the list to the grid.
 
_evaluateGaussian(self, center, point, coeff, prefactor=1.0)
Returns the value of a Gaussian evaulated at a particular point.
 
mapPointsToGrid(self, points)
maps a numpy array of points (shape n,3) to the grid.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  origin
  spacing
  length
  grid_size

Inherited from object: __class__

Method Details [hide private]

__init__(self, origin=[0.0, 0.0, 0.0], spacing=[1.0, 1.0, 1.0], length=[1.0, 1.0, 1.0], default_radius=1.5)
(Constructor)

 

arguments:
  origin => a list containing the Cartesian coordinates of the grid's
            origin in the lab frame
  spacing => a list (a,b,c) containing the spacing between grid points
  length => a list (l,m,n) containing the absolute lengths of the grid
            in each direction

Notes: The initializer will adjust the lengths of the grid to make
them integer multiples of their respective spacings.  Hence, the
final lenghts may be slightly larger than requested.

The initializer will adjust the origin, to ensure it's an integer
number of spacings away from the absolute origin (i.e. lab frame
origin).

Overrides: object.__init__

mapAtomToGrid(self, atom, scale_radius=1.0)

 

Assigns atom density to the grid based on the atom's position.
In oder to discretize the atom's position, it is treated as a
normalized Gaussian, which is evaluated at N grid points closest
to the atom's position.

args:
    atom => A _StructureAtom object
    scale_radii => scale the atom vdw radius by this amount:
                   default = 1.0

mapAtomListToGrid(self, st, atom_list=[], scale_radii=1.0)

 

Given a Structure object and a list of atom indices, map atoms in
the list to the grid.

args:
    st => Structure object
    atom_list => list of atom indices
    scale_radii => scale atom vdw radii by this amount: default = 1.0

_evaluateGaussian(self, center, point, coeff, prefactor=1.0)

 

Returns the value of a Gaussian evaulated at a particular point.

args:
    center => Gaussian center, numpy array
    point  => point at which to evaluate, numpy array
    coeff  => coefficient in the exponent, float
    prefactor   => normalization coffecient, float

mapPointsToGrid(self, points)

 

maps a numpy array of points (shape n,3) to the grid.

Parameters:
  • points (numpy array of shape n,3) - the points to map to the grid

Property Details [hide private]

origin

Get Method:
unreachable.origin(self)

spacing

Get Method:
unreachable.spacing(self)

length

Get Method:
unreachable.length(self)

grid_size

Get Method:
unreachable.grid_size(self)