Ignore:
Timestamp:
Mar 19, 2021 12:56:44 PM (9 months ago)
Author:
vondreele
Message:

Add new button to Covariance page - Show last shift/esd bar plot
Add PlotNamedFloatBarGraph? to G2plot to do it.
Fix a missing default on get in ReportProblems? in G2strMain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r4850 r4857  
    8282                    msg += ', {}'.format(varyList[val])
    8383        if m: G2fil.G2Print(m, mode='warn')
    84     SVD0 = result[2].get('SVD0')
     84    SVD0 = result[2].get('SVD0',0)
    8585    if SVD0 == 1:
    8686        msg += 'Warning: Soft (SVD) singularity in the Hessian'
     
    253253            covMatrix = result[1]*Rvals['GOF']**2
    254254            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))
    260257            if np.any(np.isnan(sig)) or not sig.shape:
    261258                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?
    264259            # report on refinement issues. Result in Rvals['msg']
    265260            ReportProblems(result,Rvals,varyList)
     
    304299    if chisq0 is not None:
    305300        Rvals['GOF0'] = np.sqrt(chisq0/(Histograms['Nobs']-len(varyList)))
    306     return IfOK,Rvals,result,covMatrix,sig
     301    return IfOK,Rvals,result,covMatrix,sig,Lastshft
    307302
    308303def Refine(GPXfile,dlg=None,makeBack=True,refPlotUpdate=None):
     
    398393    try:
    399394        covData = {}
    400         IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histograms,Phases,restraintDict,
     395        IfOK,Rvals,result,covMatrix,sig,Lastshft = RefineCore(Controls,Histograms,Phases,restraintDict,
    401396            rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifSeq,printFile,dlg,
    402397            refPlotUpdate=refPlotUpdate)
     
    406401            newAtomDict = G2stMth.ApplyXYZshifts(parmDict,varyList)
    407402            covData = {'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals,
    408                        'varyListStart':varyListStart,
     403                       'varyListStart':varyListStart,'Lastshft':Lastshft,
    409404                       'covMatrix':covMatrix,'title':GPXfile,'newAtomDict':newAtomDict,
    410405                       'newCellDict':newCellDict,'freshCOV':True}
     
    818813               .format(s))
    819814        try:
    820             IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histo,Phases,restraintDict,
     815            IfOK,Rvals,result,covMatrix,sig,Lastshft = RefineCore(Controls,Histo,Phases,restraintDict,
    821816                rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifSeq,printFile,dlg,
    822817                refPlotUpdate=refPlotUpdate)
     
    860855            histRefData = {
    861856                'variables':result[0],'varyList':varyList,'sig':sig,'Rvals':Rvals,
    862                 'varyListStart':varyListStart,
     857                'varyListStart':varyListStart,'Lastshft':Lastshft,
    863858                'covMatrix':covMatrix,'title':histogram,'newAtomDict':newAtomDict,
    864859                'newCellDict':newCellDict,'depParmDict':depParmDict,
Note: See TracChangeset for help on using the changeset viewer.