Changeset 4857 for trunk/GSASIIstrMain.py
- Timestamp:
- Mar 19, 2021 12:56:44 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMain.py
r4850 r4857 82 82 msg += ', {}'.format(varyList[val]) 83 83 if m: G2fil.G2Print(m, mode='warn') 84 SVD0 = result[2].get('SVD0' )84 SVD0 = result[2].get('SVD0',0) 85 85 if SVD0 == 1: 86 86 msg += 'Warning: Soft (SVD) singularity in the Hessian' … … 253 253 covMatrix = result[1]*Rvals['GOF']**2 254 254 sig = np.sqrt(np.diag(covMatrix)) 255 Lastshft = result[2].get('Xvec',None) 256 if Lastshft is None: 257 Rvals['Max shft/sig'] = None 258 else: 259 Rvals['Max shft/sig'] = np.max(np.nan_to_num(Lastshft/sig)) 255 Lastshft = result[0]-values 256 Rvals['Max shft/sig'] = np.max(np.nan_to_num(Lastshft/sig)) 260 257 if np.any(np.isnan(sig)) or not sig.shape: 261 258 G2fil.G2Print ('*** Least squares aborted - some invalid esds possible ***',mode='error') 262 # table = dict(zip(varyList,zip(values,result[0],(result[0]-values)/sig)))263 # for item in table: print item,table[item] #useful debug - are things shifting?264 259 # report on refinement issues. Result in Rvals['msg'] 265 260 ReportProblems(result,Rvals,varyList) … … 304 299 if chisq0 is not None: 305 300 Rvals['GOF0'] = np.sqrt(chisq0/(Histograms['Nobs']-len(varyList))) 306 return IfOK,Rvals,result,covMatrix,sig 301 return IfOK,Rvals,result,covMatrix,sig,Lastshft 307 302 308 303 def Refine(GPXfile,dlg=None,makeBack=True,refPlotUpdate=None): … … 398 393 try: 399 394 covData = {} 400 IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histograms,Phases,restraintDict,395 IfOK,Rvals,result,covMatrix,sig,Lastshft = RefineCore(Controls,Histograms,Phases,restraintDict, 401 396 rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifSeq,printFile,dlg, 402 397 refPlotUpdate=refPlotUpdate) … … 406 401 newAtomDict = G2stMth.ApplyXYZshifts(parmDict,varyList) 407 402 covData = {'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals, 408 'varyListStart':varyListStart, 403 'varyListStart':varyListStart,'Lastshft':Lastshft, 409 404 'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict, 410 405 'newCellDict':newCellDict,'freshCOV':True} … … 818 813 .format(s)) 819 814 try: 820 IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histo,Phases,restraintDict,815 IfOK,Rvals,result,covMatrix,sig,Lastshft = RefineCore(Controls,Histo,Phases,restraintDict, 821 816 rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifSeq,printFile,dlg, 822 817 refPlotUpdate=refPlotUpdate) … … 860 855 histRefData = { 861 856 'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals, 862 'varyListStart':varyListStart, 857 'varyListStart':varyListStart,'Lastshft':Lastshft, 863 858 'covMatrix':covMatrix,'title':histogram,'newAtomDict':newAtomDict, 864 859 'newCellDict':newCellDict,'depParmDict':depParmDict,
Note: See TracChangeset
for help on using the changeset viewer.