Changeset 3068 for trunk/GSASIIstrMain.py
- Timestamp:
- Sep 12, 2017 10:54:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMain.py
r3049 r3068 54 54 begin = time.time() 55 55 values = np.array(G2stMth.Dict2Values(parmDict, varyList)) 56 if np.any(np.isnan(values)): 57 raise G2obj.G2Exception('ERROR - nan found in LS parameters - use Calculate/View LS parms to locate') 56 58 # test code to compute GOF and save for external repeat 57 59 #args = ([Histograms,Phases,restraintDict,rigidbodyDict],parmDict,varyList,calcControls,pawleyLookup,dlg) … … 135 137 del(varyList[ipvt-1]) 136 138 break 137 G2stMth.GetFobsSq(Histograms,Phases,parmDict,calcControls) 139 if IfOK: 140 G2stMth.GetFobsSq(Histograms,Phases,parmDict,calcControls) 138 141 return IfOK,Rvals,result,covMatrix,sig 139 142 … … 212 215 IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histograms,Phases,restraintDict, 213 216 rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifPrint,printFile,dlg) 214 sigDict = dict(zip(varyList,sig)) 215 newCellDict = G2stMth.GetNewCellParms(parmDict,varyList) 216 newAtomDict = G2stMth.ApplyXYZshifts(parmDict,varyList) 217 covData = {'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals, 218 'varyListStart':varyListStart, 219 'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict, 220 'newCellDict':newCellDict,'freshCOV':True} 221 # add the uncertainties into the esd dictionary (sigDict) 222 sigDict.update(G2mv.ComputeDepESD(covMatrix,varyList,parmDict)) 223 G2mv.PrintIndependentVars(parmDict,varyList,sigDict,pFile=printFile) 224 G2stMth.ApplyRBModels(parmDict,Phases,rigidbodyDict,True) 225 G2stIO.SetRigidBodyModels(parmDict,sigDict,rigidbodyDict,printFile) 226 G2stIO.SetPhaseData(parmDict,sigDict,Phases,rbIds,covData,restraintDict,printFile) 227 G2stIO.SetHistogramPhaseData(parmDict,sigDict,Phases,Histograms,calcControls['FFtables'],pFile=printFile) 228 G2stIO.SetHistogramData(parmDict,sigDict,Histograms,calcControls['FFtables'],pFile=printFile) 229 G2stIO.SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,rigidbodyDict,covData,makeBack) 230 printFile.close() 231 print ' Refinement results are in file: '+ospath.splitext(GPXfile)[0]+'.lst' 232 print ' ***** Refinement successful *****' 217 if IfOK: 218 sigDict = dict(zip(varyList,sig)) 219 newCellDict = G2stMth.GetNewCellParms(parmDict,varyList) 220 newAtomDict = G2stMth.ApplyXYZshifts(parmDict,varyList) 221 covData = {'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals, 222 'varyListStart':varyListStart, 223 'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict, 224 'newCellDict':newCellDict,'freshCOV':True} 225 # add the uncertainties into the esd dictionary (sigDict) 226 sigDict.update(G2mv.ComputeDepESD(covMatrix,varyList,parmDict)) 227 G2mv.PrintIndependentVars(parmDict,varyList,sigDict,pFile=printFile) 228 G2stMth.ApplyRBModels(parmDict,Phases,rigidbodyDict,True) 229 G2stIO.SetRigidBodyModels(parmDict,sigDict,rigidbodyDict,printFile) 230 G2stIO.SetPhaseData(parmDict,sigDict,Phases,rbIds,covData,restraintDict,printFile) 231 G2stIO.SetHistogramPhaseData(parmDict,sigDict,Phases,Histograms,calcControls['FFtables'],pFile=printFile) 232 G2stIO.SetHistogramData(parmDict,sigDict,Histograms,calcControls['FFtables'],pFile=printFile) 233 G2stIO.SetUsedHistogramsAndPhases(GPXfile,Histograms,Phases,rigidbodyDict,covData,makeBack) 234 printFile.close() 235 print ' Refinement results are in file: '+ospath.splitext(GPXfile)[0]+'.lst' 236 print ' ***** Refinement successful *****' 237 else: 238 print '****ERROR - Refinement failed' 239 raise G2obj.G2Exception('****ERROR - Refinement failed') 233 240 except G2obj.G2Exception,Msg: 234 241 printFile.close() … … 236 243 237 244 #for testing purposes!!! 238 if DEBUG :245 if DEBUG and IfOK: 239 246 #needs: values,HistoPhases,parmDict,varylist,calcControls,pawleyLookup 240 247 import cPickle
Note: See TracChangeset
for help on using the changeset viewer.