Python: module densityGrid
 
densityGrid
index

Three-dimensional density map for use with atomic structures. atomProb 
contains a facility to generate such a density map.
 
DensityGrid class
 
constructors:
    
  DensityGrid(xnum,
              ynum,
              znum)   - xnum,ynum,znum specify grid size. They default to
                        zero.
  DensityGrid(omap,
              zSlice=-1) - a copy constructor. If the optional zSlice argument
                           is a non-negative integer, a 2D slice will be
                           generated from the specified z grid number of omap.
 
  toPoint(i,j,k)  - return the Cartesian position corresponding to indices 
                    i,j,k as a vec3.Vec3.
 
 
  readCCP4(filename,
           verbose=False,
           zeroNegatives=True) - read CCP4- or MRC-formatted map from the 
                            specified file. The verbose argument is optional.
                            Currently, there are the following restrictions on
                            parameters of density map files read in:
                               MAPC = 1
                               MAPR = 2
                               MAPS = 3
                               NX = NC
                               NY = NR
                             Also, unit-cell parameters are not supported, so
                             ISPG must be 1. By default, negative values in the
                             input map are changed to zero. To prevent this
                             behavior, set the zeroNegatives argument to False
 
  readCCP4fromBytes(bytes,
                    verbose=False,
                    zeroNegatives=True) - same as readCCP4, except input is
                                          in a Python Bytes object, instead of
                                          a file.
 
  writeCCP4(filename,
            verbose=False,
            isMRC=True   ) - write CCP4- or MRC-formatted map to the
                             specified file. If isMRC is False, CCP4 format is
                             used.
 
  writeEDM(filename)       - write the map to an XPLOR EDM-formatted file.
 
Members
  xnum, ynum, znum       - number of grid points in each dimension
  xmin, ymin, zmin       - minimum values along axes
  xdelta, ydelta, zdelta - grid spacing along axes
  data                   - grid data in column-major format. Its use is rather
                           tricky:
 
      data = dens.data  #this is ugly: dens.data is a copy here (not reference)
      data[k*dens.ynum*dens.xnum + j*dens.xnum + i] = val
      dens.data = data
                          It is better to use the method interface.
 
  setData(i,j,k,val)
  __operator__(i,j,k)    - accessors for grid data.
 
  xValues()              - accessors each of which returns a list of 
  yValues()                values along each axis.
  zValues()             
 
  scale(val)             - scale the map by constant val.
  shift(val)             - add val to every grid point of the map.
  minVal()               - minumum value of the map.
  maxVal()               - maximum value of the map.
  aveVal()               - average value of the map.
  maxPos()               - position of map maximum
  centroid()             - centroid of probability dist
  variance()             - covariance matrix of probability dist
  rotateTranslate(R,t)   - return a new DensityGrid whose grid is the
                           same as that of the parent, and whose data is
                           taken from interpolated values of those on the
                           parent grid positions q transformed as R*(q+t)
                           where R is a rotation matrix and t is a translation
                           vector. Data for transformed positions more than
                           two grid spacings away from the parent grid are
                           zeroed.
  interpolate(q,
              rot=I,
              trans=0)   - return an interpolated data value for coordinate
                           q'=rot*(q+trans), with rotation R and translation t.
                           R defaults to the unit matrix and t defaults to the
                           zero vector.
 
  gridInfo()             - return the grid parameters 
 
  zero()                 - zero the density data.
  zSlice(sliceNum)       - return a cdsMatrix.CDSMatrix_double containing
                           a 2D slice at the specified z grid number.
 
 and accessors (for accessor set value with syntax setAccessor(val)):
 
    noOffset      - control computation of x/y/zmin from grid params:
                    If True, x/y/zmin are multiples of x/y/zdelta.
 
The DensityGrid_Params class:
 
  This is used for autogenerating the grid extents
 
members:
        xdelta, ydelta, zdelta
        xmin, ymin, zmin
        xmax, ymax, zmax        - grid parameters
        cushion                 - space around molecule for auto-grid 
                                  generation
 
  
Function:
 
 correlation(map1,map2) - return the correlation between maps:
                          \sum_i \rho_1(i) \rho_2(i) / sqrt(S1 * S2)
                          where S1 = \sum_i \rho_1^2(i)
                                Se = \sum_i \rho_2^2(i)
 
 
                          
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
CDSVectorBase_float_type_size_t
CDSVector_float_type_0_size_t_ssize_t
DensityGrid
DensityGrid_Params

 
class CDSVectorBase_float_type_size_t(builtins.object)
    CDSVectorBase_float_type_size_t(*args)
 

 
  Methods defined here:
__call__(self, *args, **kwargs) -> 'double const &'
Call self as a function.
__iadd__(self, *args) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__isub__(self, *args) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
__repr__ = _swig_repr(self)
copy(self, *args) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
count(self, *args, **kwargs) -> 'int'
data(self, *args) -> 'double const &'
loadRawArray(self, *args, **kwargs) -> 'void'
pointer(self, *args) -> 'double *'
remove(self, *args, **kwargs) -> 'void'
resize(self, *args, **kwargs) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
set(self, *args, **kwargs) -> 'void'
setAlloc(self, *args, **kwargs) -> 'void'
size(self, *args, **kwargs) -> 'size_t'
splitRep(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSVectorBase_float_type_size_t(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

 
class CDSVector_float_type_0_size_t_ssize_t(CDSVectorBase_float_type_size_t)
    CDSVector_float_type_0_size_t_ssize_t(*args)
 

 
 
Method resolution order:
CDSVector_float_type_0_size_t_ssize_t
CDSVectorBase_float_type_size_t
builtins.object

Methods defined here:
__add__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__call__(self, *args) -> 'double const &'
Call self as a function.
__getitem__(self, *args, **kwargs)
__getslice__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__iadd__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__imul__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__isub__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__itruediv__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__len__(self, *args, **kwargs) -> 'size_t'
__mul__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__neg__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__pow__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__radd__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__repr__ = _swig_repr(self)
__rmul__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__rsub__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__rtruediv__(self, *args, **kwargs) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__setitem__(self, *args, **kwargs) -> 'void'
__str__(self, *args, **kwargs) -> 'String'
Return str(self).
__sub__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
__truediv__(self, *args) -> 'CDSVector< float_type,0,CDS::DefaultAlloc,size_t,ssize_t >'
append(self, *args, **kwargs) -> 'void'
fromList(s, l)
get(self, *args, **kwargs) -> 'double'
help(self, *args, **kwargs) -> 'String'
offset(self, *args, **kwargs) -> 'ssize_t'
scale(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_CDSVector_float_type_0_size_t_ssize_t(...)

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from CDSVectorBase_float_type_size_t:
copy(self, *args) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
count(self, *args, **kwargs) -> 'int'
data(self, *args) -> 'double const &'
loadRawArray(self, *args, **kwargs) -> 'void'
pointer(self, *args) -> 'double *'
remove(self, *args, **kwargs) -> 'void'
resize(self, *args, **kwargs) -> 'CDSVectorBase< double,CDS::DefaultAlloc,size_t > &'
set(self, *args, **kwargs) -> 'void'
setAlloc(self, *args, **kwargs) -> 'void'
size(self, *args, **kwargs) -> 'size_t'
splitRep(self, *args, **kwargs) -> 'void'

Data descriptors inherited from CDSVectorBase_float_type_size_t:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class DensityGrid(builtins.object)
    DensityGrid(*args)
 

 
  Methods defined here:
GridTest(self, *args, **kwargs) -> 'void'
WriteData(self, *args, **kwargs) -> 'void'
__call__(self, *args) -> 'float_type const &'
Call self as a function.
__iadd__(self, *args, **kwargs) -> 'DensityGrid &'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
aveVal(self, *args, **kwargs) -> 'float_type'
centroid(self, *args, **kwargs) -> 'Vec3'
getData(self, *args, **kwargs) -> 'float_type'
gridInfo(self, *args, **kwargs) -> 'String'
interpolate(self, *args, **kwargs) -> 'float_type'
maxPos(self, *args, **kwargs) -> 'Vec3'
maxVal(self, *args, **kwargs) -> 'float_type'
minVal(self, *args, **kwargs) -> 'float_type'
pyXplorHelp(self, *args, **kwargs) -> 'String'
readCCP4(self, *args, **kwargs) -> 'void'
readCCP4fromBytes(self, *args, **kwargs) -> 'void'
readCCP4fromString(self, *args, **kwargs) -> 'void'
rotateTranslate(self, *args, **kwargs) -> 'DensityGrid'
scale(self, *args, **kwargs) -> 'DensityGrid &'
setData(self, *args) -> 'void'
shift(self, *args, **kwargs) -> 'DensityGrid &'
toGrid(self, *args, **kwargs) -> 'Vec3'
toGridX(self, *args, **kwargs) -> 'uint32_t'
toGridY(self, *args, **kwargs) -> 'uint32_t'
toGridZ(self, *args, **kwargs) -> 'uint32_t'
toPoint(self, *args, **kwargs) -> 'Vec3'
variance(self, *args, **kwargs) -> 'Mat3'
writeCCP4(self, *args, **kwargs) -> 'void'
writeEDM(self, *args, **kwargs) -> 'void'
xValues(self, *args, **kwargs) -> 'CDSVector< float_type >'
yValues(self, *args, **kwargs) -> 'CDSVector< float_type >'
zSlice(self, *args, **kwargs) -> 'CDSMatrix< float_type >'
zValues(self, *args, **kwargs) -> 'CDSVector< float_type >'
zero(self, *args, **kwargs) -> 'void'

Static methods defined here:
__swig_destroy__ = delete_DensityGrid(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
data

 
thisown

 
The membership flag
xdelta

 
xmin

 
xnum

 
ydelta

 
ymin

 
ynum

 
zdelta

 
zmin

 
znum

 

 
class DensityGrid_Params(builtins.object)
    DensityGrid_Params(*args, **kwargs)
 

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)

Static methods defined here:
__swig_destroy__ = delete_DensityGrid_Params(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
cushion

 
thisown

 
The membership flag
xdelta

 
xmax

 
xmin

 
ydelta

 
ymax

 
ymin

 
zdelta

 
zmax

 
zmin

 

 
Functions
       
correlation(*args, **kwargs) -> 'float_type'
pyXplorHelp(*args) -> 'String'