Changeset 1517
- Timestamp:
- Oct 4, 2014 11:47:43 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r1516 r1517 4662 4662 return parmDict 4663 4663 4664 def EvalPSvarDeriv(calcobj,parmDict, var,ESD):4664 def EvalPSvarDeriv(calcobj,parmDict,sampleDict,var,ESD): 4665 4665 '''Evaluate an expression derivative with respect to a 4666 4666 GSAS-II variable name. … … 4675 4675 results = [] 4676 4676 phaselist = [] 4677 VparmDict = sampleDict.copy() 4677 4678 for incr in step,-step: 4678 VparmDict = parmDict.copy()4679 VparmDict.update(parmDict.copy()) 4679 4680 # as saved, the parmDict has updated 'A[xyz]' values, but 'dA[xyz]' 4680 4681 # values are not zeroed: fix that! … … 4684 4685 # generate the atom positions and the direct & reciprocal cell values now, because they might 4685 4686 # needed to evaluate the pseudovar 4686 for item in VparmDict: 4687 for item in VparmDict: 4688 if item in sampleDict: 4689 continue 4687 4690 if ':' not in item: continue 4688 4691 key = item.split(':') … … 5082 5085 colLabels += [key] 5083 5086 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()])) 5084 5090 # add unique cell parameters 5085 5091 if Controls.get('ShowCell',False): … … 5170 5176 G2mv.GenerateConstraints(groups,parmlist,varyList,constrDict,fixedList,parmDict,SeqHist=ihst) 5171 5177 derivs = np.array( 5172 [EvalPSvarDeriv(calcobj,parmDict.copy(), var,ESD)5178 [EvalPSvarDeriv(calcobj,parmDict.copy(),sampleDict[name],var,ESD) 5173 5179 for var,ESD in zip(varyList,sigs)] 5174 5180 ) … … 5177 5183 )) 5178 5184 PSvarDict = parmDict.copy() 5185 PSvarDict.update(sampleDict[name]) 5179 5186 UpdateParmDict(PSvarDict) 5180 5187 calcobj.UpdateDict(PSvarDict)
Note: See TracChangeset
for help on using the changeset viewer.