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

Class GridMatData

source code

object --+    
         |    
    Grid2D --+
             |
            GridMatData

Represent GridMatMD data file.

The loaded array data is accessible as a numpy array in :attr:`GridMatData.array` and bins and midpoints as :attr:`GridMatData.bins` and :attr:`GridMatData.midpoints` respectively.

Instance Methods [hide private]
 
__init__(self, filename, shape=None, delta=None)
Load the data into a numpy array.
source code
 
parse_filename(self, filename)
Get dimensions from filename
source code

Inherited from Grid2D: __add__, __div__, __mul__, __sub__, imshow

Inherited from Grid2D (private): _midpoints

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

Class Variables [hide private]
  DATANAME = re.compile(...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, shape=None, delta=None)
(Constructor)

source code 
Load the data into a numpy array.

The *filename* is an output file from GridMAT-MD. *shape* and
*delta* are optional. The *shape* of the array is parsed from
the filename if not provided. The spacing is set to (1,1) if
not provided.

:Arguments:
  *filename*
     2D grid as written by GridMAT-MD
  *shape*
     Shape tuple (NX, NY) of the array in filename.
  *delta*
     Tuple of bin sizes of grid (DX, DY).

Overrides: object.__init__

Class Variable Details [hide private]

DATANAME

Value:
re.compile("""
                         (?P<NX>\d+)     # number of grid points in X
                         x
                         (?P<NY>\d+)     # number of grid points in Y
                         _(top|bottom|average)_.*\.dat  # all the rest
                         """, re.VERBOSE)