Package gromacs :: Package analysis :: Package plugins :: Module gridmatmd :: Class Grid2D
[hide private]
[frames] | no frames]

Class Grid2D

source code

object --+
         |
        Grid2D

Represents a 2D array with bin sizes.

Addition and subtraction of grids is defined for the arrays and the bins. Multiplication and division with scalars is also defined. Each operation returns a new :class:`Grid2D` object.

(Actually, it should work for arrays of any dimension, not just 2D.)

Instance Methods [hide private]
 
__init__(self, data, bins)
Initialize the Grid2D instance.
source code
 
_midpoints(self, x) source code
 
imshow(self, **kwargs)
Display data as a 2D image using :func:`pylab.imshow`.
source code
 
__add__(self, other)
Add arrays and bins (really only makes sense when averaging).
source code
 
__sub__(self, other)
Subtract other from self (also subtracts bins...
source code
 
__mul__(self, x)
Multiply arrays (and bins) by a scalar *x*.
source code
 
__div__(self, x)
Divide arrays (and bins) by a scalar *x*.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data, bins)
(Constructor)

source code 
Initialize the Grid2D instance.

:Arguments:
  *data*
     array data, e.g. a list of array
  *bins*
     tuple of lists of bin **edges**, one for each dimension

Overrides: object.__init__

__sub__(self, other)
(Subtraction operator)

source code 

Subtract other from self (also subtracts bins... which is odd but consistent).