Changeset 1186


Ignore:
Timestamp:
Jan 9, 2014 11:09:53 AM (8 years ago)
Author:
vondreele
Message:

fix esd calc in image calib & strain refine
put in Dcalc for strain = ave dcalc around ring

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r1185 r1186  
    195195    p0 = [parmDict[key] for key in varyList]
    196196    result = leastsq(ellipseCalcD,p0,args=(rings.T,varyList,parmDict),full_output=True,ftol=1.e-8)
    197     chisq = np.sum(result[2]['fvec']**2)
     197    chisq = np.sum(result[2]['fvec']**2)/(rings.shape[0]-len(p0))   #reduced chi^2 = M/(Nobs-Nvar)
    198198    parmDict.update(zip(varyList,result[0]))
    199199    vals = list(result[0])
     
    899899        V = 1.+np.sum(np.sum(E*calcFij(90.,phi,azm,th0).T/1.e6,axis=2),axis=1)
    900900        ring['ImtaCalc'] = np.array([V*ring['Dset'],azm])
     901        ring['Dcalc'] = np.mean(ring['ImtaCalc'][0])
    901902
    902903def calcFij(omg,phi,azm,th):
     
    952953    result = leastsq(strainCalc,p0,args=(rings,dset,wave,phi),full_output=True)
    953954    vals = list(result[0])
    954     chisq = np.sum(result[2]['fvec']**2)
     955    chisq = np.sum(result[2]['fvec']**2)/(rings.shape[1]-3)     #reduced chi^2 = M/(Nobs-Nvar)
    955956    sig = list(np.sqrt(chisq*np.diag(result[1])))
    956957    ValSig = zip(names,fmt,vals,sig)
  • trunk/GSASIIimgGUI.py

    r1185 r1186  
    15001500            dZero.Bind(wx.EVT_KILL_FOCUS,OnDzero)
    15011501            Indx[dZero.GetId()] = id
    1502             dzeroSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,label=(' d-zero calc: %.5f'%(dzero['Dcalc']))),
     1502            dzeroSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,label=(' d-zero ave: %.5f'%(dzero['Dcalc']))),
    15031503                0,wx.ALIGN_CENTER_VERTICAL)
    15041504               
  • trunk/GSASIIpwd.py

    r1176 r1186  
    13681368            Values2Dict(parmDict, varyList, result[0])
    13691369            Rwp = np.sqrt(chisq/np.sum(w[xBeg:xFin]*y[xBeg:xFin]**2))*100.      #to %
    1370             GOF = chisq/(xFin-xBeg-len(varyList))
     1370            GOF = chisq/(xFin-xBeg-len(varyList))       #reduced chi^2
    13711371            print 'Number of function calls:',result[2]['nfev'],' Number of observations: ',xFin-xBeg,' Number of parameters: ',len(varyList)
    13721372            print 'fitpeak time = %8.3fs, %8.3fs/cycle'%(runtime,runtime/ncyc)
Note: See TracChangeset for help on using the changeset viewer.