Changeset 1297 for trunk/GSASIIsasd.py


Ignore:
Timestamp:
Apr 23, 2014 4:32:15 PM (8 years ago)
Author:
vondreele
Message:

setup sequential small angle refinements & display
includes copy & copy flags over Models
stop pattern plots in multiple integrations; now only when done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIsasd.py

    r1283 r1297  
    923923
    924924    def GetModelParms():
     925        parmOrder = ['Volume','Radius','Mean','StdDev','MinSize','G','Rg','B','P','Cutoff',
     926            'PkInt','PkPos','PkSig','PkGam',]
    925927        parmDict = {}
    926928        varyList = []
     
    953955                            values.append(controls['FFargs'][item][0])
    954956            distDict = controls['DistType']
    955             for item in level[distDict]:
    956                 parmDict[cid+item] = level[distDict][item][0]
    957                 if level[distDict][item][1]:
    958                     values.append(level[distDict][item][0])
    959                     varyList.append(cid+item)
     957            for item in parmOrder:
     958                if item in level[distDict]:
     959                    parmDict[cid+item] = level[distDict][item][0]
     960                    if level[distDict][item][1]:
     961                        values.append(level[distDict][item][0])
     962                        varyList.append(cid+item)
    960963        return levelTypes,parmDict,varyList,values
    961964       
     
    10511054    ncyc = int(result[2]['nfev']/2)
    10521055    chisq = np.sum(result[2]['fvec']**2)
    1053     Rwp = np.sqrt(chisq/np.sum(wt[Ibeg:Ifin]*Io[Ibeg:Ifin]**2))*100.      #to %
    1054     GOF = chisq/(Ifin-Ibeg-len(varyList))       #reduced chi^2
     1056    Rvals = {}
     1057    Rvals['Rwp'] = np.sqrt(chisq/np.sum(wt[Ibeg:Ifin]*Io[Ibeg:Ifin]**2))*100.      #to %
     1058    Rvals['GOF'] = chisq/(Ifin-Ibeg-len(varyList))       #reduced chi^2
    10551059    parmDict.update(zip(varyList,result[0]))
    10561060    Ic[Ibeg:Ifin] = getSASD(Q[Ibeg:Ifin],levelTypes,parmDict)
    10571061    try:
    1058         sigDict = dict(zip(varyList,np.sqrt(np.diag(result[1])*GOF)))
     1062        sig = np.sqrt(np.diag(result[1])*Rvals['GOF'])
     1063        sigDict = dict(zip(varyList,sig))
    10591064        print ' Results of small angle data modelling fit:'
    10601065        print 'Number of function calls:',result[2]['nfev'],' Number of observations: ',Ifin-Ibeg,' Number of parameters: ',len(varyList)
    1061         print 'Rwp = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f'%(Rwp,chisq,GOF)
     1066        print 'Rwp = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f'%(Rvals['Rwp'],chisq,Rvals['GOF'])
    10621067        SetModelParms()
    1063         return True
     1068        covMatrix = result[1]*Rvals['GOF']
     1069        return True,result,varyList,sig,Rvals,covMatrix
    10641070    except ValueError:
    1065         return False
    1066        
     1071        return False,0,0,0,0,0
    10671072   
    10681073def ModelFxn(Profile,ProfDict,Limits,Substances,Sample,sasdData):
Note: See TracChangeset for help on using the changeset viewer.