Changeset 1517


Ignore:
Timestamp:
Oct 4, 2014 11:47:43 AM (9 years ago)
Author:
vondreele
Message:

fix UpdateSeqResults? to treat varying Sample parameters correctly in pseudovariables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1516 r1517  
    46624662        return parmDict
    46634663
    4664     def EvalPSvarDeriv(calcobj,parmDict,var,ESD):
     4664    def EvalPSvarDeriv(calcobj,parmDict,sampleDict,var,ESD):
    46654665        '''Evaluate an expression derivative with respect to a
    46664666        GSAS-II variable name.
     
    46754675        results = []
    46764676        phaselist = []
     4677        VparmDict = sampleDict.copy()
    46774678        for incr in step,-step:
    4678             VparmDict = parmDict.copy()            
     4679            VparmDict.update(parmDict.copy())           
    46794680            # as saved, the parmDict has updated 'A[xyz]' values, but 'dA[xyz]'
    46804681            # values are not zeroed: fix that!
     
    46844685            # generate the atom positions and the direct & reciprocal cell values now, because they might
    46854686            # needed to evaluate the pseudovar
    4686             for item in VparmDict:
     4687            for item in VparmDict:
     4688                if item in sampleDict:
     4689                    continue
    46874690                if ':' not in item: continue
    46884691                key = item.split(':')
     
    50825085        colLabels += [key]
    50835086        Types += [wg.GRID_VALUE_FLOAT,]
     5087    sampleDict = {}
     5088    for i,name in enumerate(histNames):
     5089        sampleDict[name] = dict(zip(sampleParms.keys(),[sampleParms[key][i] for key in sampleParms.keys()]))
    50845090    # add unique cell parameters
    50855091    if Controls.get('ShowCell',False):
     
    51705176            G2mv.GenerateConstraints(groups,parmlist,varyList,constrDict,fixedList,parmDict,SeqHist=ihst)
    51715177            derivs = np.array(
    5172                 [EvalPSvarDeriv(calcobj,parmDict.copy(),var,ESD)
     5178                [EvalPSvarDeriv(calcobj,parmDict.copy(),sampleDict[name],var,ESD)
    51735179                 for var,ESD in zip(varyList,sigs)]
    51745180                )
     
    51775183                ))
    51785184            PSvarDict = parmDict.copy()
     5185            PSvarDict.update(sampleDict[name])
    51795186            UpdateParmDict(PSvarDict)
    51805187            calcobj.UpdateDict(PSvarDict)
Note: See TracChangeset for help on using the changeset viewer.