Package diffpy :: Package srrietveld :: Module fitrt :: Class FitRT
[frames] | no frames]

Class FitRT

source code

object --+
         |
        FitRT

FitRT provides the runtime control of refinements. It uses two basic ways
to run a refinement, either step by step or finish everything by one call.

Data member:

    fit       -- a diffpy.refinementdata.Refinement object that stores a fit
    strategy  -- a refine strategy to be applied
    index     -- the index to a single fit (if multiple fits are saved
                 together as an array)
    enginefit -- the engine fit object
    step      -- record the refinement step
    tempDir   -- the working folder
    workdingDir -- the current working directory

Instance Methods
 
__init__(self, job, fit, index=None)
Initialization.
source code
 
clean(self)
Clean up after each refinement
source code
 
prepare(self)
Prepare the refinement, consisting of three steps:
source code
 
prepareFile(self, fid, engineName, bankid=None, instFilePath=None)
Write or move data/instrument files in running/tmp directory
source code
 
refineSingleStep(self)
Refine a single step in the strategy list.
source code
 
run(self, isStrategyEnabled=False, continuous=True)
Run the refinement according to its strategy.
source code
 
setConstraint(self, key, formula)
Turn on the refinement flag for parameters
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, job, fit, index=None)
(Constructor)

source code 
Initialization.

job       -- the job this fitrt belonged to
fit       -- a diffpy.refinementdata.Refinement object that stores a fit
index     -- the index to a single fit (if multiple fits are saved
             together as an array)

Overrides: object.__init__

prepare(self)

source code 

Prepare the refinement, consisting of three steps:

  1. Check if the engine fit object is available
  2. Create temporary folder for running
  3. Generate the data file

    return: True if it runs sucessfully, otherwise False.

prepareFile(self, fid, engineName, bankid=None, instFilePath=None)

source code 

Write or move data/instrument files in running/tmp directory

enginename -- the type of engine, can be either gsas or fullprof fid -- the file id bankid -- the bankid, used to convert the file format instFilePath -- The instrument file path

return the file name

run(self, isStrategyEnabled=False, continuous=True)

source code 

Run the refinement according to its strategy.

isStrategyEnabled -- if the strategy is enabled

continuous -- run the whole refinement continuously or not

return: True if the refinement finished. False if not.