Package diffpy :: Package pdfgui :: Package control :: Module calculation :: Class Calculation
[hide private]
[frames] | no frames]

Class Calculation

source code

               object --+    
                        |    
pdfcomponent.PDFComponent --+
                            |
                           Calculation

Perform a theoretical computation of PDF from model structure.

Data members:

serverFactory -- class used for creating PdfFit engine server
serverFactoryArgs -- tuple of arguments passed to serverFactory
rmin   -- read-only lower boundary of rcalc, change with setRGrid()
rstep  -- read-only r-grid step, use setRGrid() to change it
rmax   -- read-only upper boundary of rcalc, change with setRGrid()
rlen   -- read-only number of r points, set by setRGrid().
          To be used in PdfFit.alloc()
rcalc  -- list of r values, this is set after calculation is finished
Gcalc  -- list of calculated G values
stype  -- scattering type, 'X' or 'N'
qmax   -- maximum value of Q in inverse Angstroms.  Termination ripples
          are ignored for qmax=0.
qdamp  -- specifies width of Gaussian damping factor in pdf_obs due
          to imperfect Q resolution
qbroad -- quadratic peak broadening factor related to dataset
spdiameter -- particle diameter for shape damping function.
          Note: this attribute has been moved to FitStructure and is
          maintained only for backward compatible reading of PDFgui
          project files.
dscale -- total scale factor



Instance Methods [hide private]
 
__init__(self, name)
initialize Calculation...
source code
 
_getStrId(self)
make a string identifier...
source code
 
setRGrid(self, rmin=None, rstep=None, rmax=None)
Change specified r-grid parameters (rmin, rstep, rmax).
source code
 
start(self)
entry function for calculation
source code
 
calculate(self)
do the real calculation...
source code
 
write(self, filename)
write this calculated PDF to a file filename -- name of file to write to No return value.
source code
 
writeStr(self)
String representation of calculated PDF.
source code
 
load(self, z, subpath)
load data from a zipped project file...
source code
 
save(self, z, subpath)
save data from a zipped project file...
source code
 
copy(self, other=None)
copy self to other.
source code
 
getYNames(self)
get names of data item which can be plotted as y...
source code
 
getXNames(self)
get names of data item which can be plotted as x...
source code
 
getData(self, dataname, step=None)
get Calculation data member...
source code
 
getMetaDataNames(self)
return all applicable meta data names...
source code
 
getMetaData(self, name)
get meta data value...
source code

Inherited from pdfcomponent.PDFComponent: close

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, name)
(Constructor)

source code 
initialize Calculation

name -- calculation name

Overrides: pdfcomponent.PDFComponent.__init__

_getStrId(self)

source code 
make a string identifier

return value: string id

setRGrid(self, rmin=None, rstep=None, rmax=None)

source code 
Change specified r-grid parameters (rmin, rstep, rmax).
Adjust rmax for integer number of steps.

rmin  -- new low rcalc boundary
rstep -- new r-grid step
rmax  -- new maximum rcalc, slightly adjusted to accommodate rstep

No return value.
Raise ControlValueError for invalid range specification.

calculate(self)

source code 
do the real calculation
        

writeStr(self)

source code 
String representation of calculated PDF.

Returns data string

load(self, z, subpath)

source code 
load data from a zipped project file

z       -- zipped project file
subpath -- path to its own storage within project file

returns a tree of internal hierachy

save(self, z, subpath)

source code 
save data from a zipped project file

z       -- zipped project file
subpath -- path to its own storage within project file

copy(self, other=None)

source code 
copy self to other. if other is None, create new instance

other -- reference to other object

returns reference to copied object

getYNames(self)

source code 
get names of data item which can be plotted as y

returns a name str list

getXNames(self)

source code 
get names of data item which can be plotted as x

returns a name str list

getData(self, dataname, step=None)

source code 
get Calculation data member

name -- data item name
step -- ignored, just for compatibility with Organizer.getData()

returns data object, be it a single number, a list, or a list of list

getMetaDataNames(self)

source code 
return all applicable meta data names
        

getMetaData(self, name)

source code 
get meta data value

name -- meta data name
returns meta data value