Package schrodinger :: Package application :: Package desmond :: Package packages :: Module analysis :: Class Pbc
[hide private]
[frames] | no frames]

Class Pbc

object --+
         |
        Pbc

Instance Methods [hide private]
 
__init__(self, box)
This implementation supports the general triclinic cell.
 
box(self)
 
inv_box(self)
numpy.ndarray
calcMinimumImage(self, ref_pos, pos)
Calculates the minimum image of a position vector pos relative to another position vector ref_pos.
numpy.ndarray
calcMinimumDiff(self, from_pos, to_pos)
Calculates the difference vector from from_pos to the minimum image of to_pos.
numpy.ndarray
wrap(self, pos)
Puts a coordinate back into the box.

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, box)
(Constructor)

 

This implementation supports the general triclinic cell.

Parameters:
  • box (numpy.ndarray) - 3x3 matrix. For a msys.System instance, you can call msys_model.cell to get this matrix. For a traj.Frame instance, you can call fr.box to get it.
Overrides: object.__init__

box(self)

 
Decorators:
  • @property

inv_box(self)

 
Decorators:
  • @property

calcMinimumImage(self, ref_pos, pos)

 

Calculates the minimum image of a position vector pos relative to another position vector ref_pos.

Parameters:
  • ref_pos (numpy.ndarray) - Reference position vector
  • pos (numpy.ndarray) - Position vector of which we will calculate the minimum image.
Returns: numpy.ndarray
The position vector of the mininum image. This function does NOT mutate any of the input vectors.

calcMinimumDiff(self, from_pos, to_pos)

 

Calculates the difference vector from from_pos to the minimum image of to_pos.

Parameters:
  • from_pos (numpy.ndarray) - Reference position vector
  • to_pos (numpy.ndarray) - Position vector of which we will calculate the minimum image.
Returns: numpy.ndarray
The difference vector. This function does NOT mutate any of the input vectors.

wrap(self, pos)

 

Puts a coordinate back into the box. If the coordinate is already in the box, this function will return a new position vector that equals the original vector.

Parameters:
  • pos (numpy.ndarray)
Returns: numpy.ndarray
A new position vector which is within the box. This function does NOT mutate and return the input vector pos.