Changeset 1784


Ignore:
Timestamp:
Apr 9, 2015 11:40:32 AM (7 years ago)
Author:
vondreele
Message:

Make F refinement the default
Add a clearreject option for HKLF DataFrame?
fix problems with chi2, Rw, etc. for single xtal data - now agrees with old GSAS

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1781 r1784  
    144144] = [wx.NewId() for item in range(12)]
    145145
    146 [ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,wxID_REJECTHKL,
    147 ] = [wx.NewId() for item in range(4)]
     146[ wxID_SELECTPHASE,wxID_PWDHKLPLOT,wxID_PWD3DHKLPLOT,wxID_REJECTHKL,wxID_CLEARREJECT,
     147] = [wx.NewId() for item in range(5)]
    148148
    149149[ wxID_PDFCOPYCONTROLS, wxID_PDFSAVECONTROLS, wxID_PDFLOADCONTROLS,
     
    14851485        self.ReflEdit.Append(id=wxID_PWD3DHKLPLOT,kind=wx.ITEM_NORMAL,text='Plot 3D HKLs',
    14861486            help='Plot HKLs from powder pattern in 3D')
    1487         self.RejectHKL = self.ReflEdit.Append(id=wxID_REJECTHKL,kind=wx.ITEM_NORMAL,text='Reject selected HKL',
    1488             help='Reject selected HKL; make mul < 0')
     1487        self.RejectHKL = self.ReflEdit.Append(id=wxID_REJECTHKL,kind=wx.ITEM_NORMAL,text='Reject HKL toggle',
     1488            help='Reject selected HKL toggle; make mul *= -1')
     1489        self.ClearReject = self.ReflEdit.Append(id=wxID_CLEARREJECT,kind=wx.ITEM_NORMAL,text='Clear rejects',
     1490            help='Clear all rejected HKLs')
    14891491        self.PostfillDataMenu()
    14901492       
     
    22592261        data['max cyc'] = 3
    22602262    if 'F**2' not in data:
    2261         data['F**2'] = True
     2263        data['F**2'] = False
    22622264        data['minF/sig'] = 0
    22632265    if 'Author' not in data:
     
    22802282       
    22812283        def OnSelectData(event):
    2282             choices = GetPatternTreeDataNames(G2frame,['PWDR',])
     2284            choices = GetPatternTreeDataNames(G2frame,['PWDR','HKLF',])
    22832285            sel = []
    22842286            try:
     
    23152317        SeqData = data.get('Seq Data',[])
    23162318        if not SeqData:
    2317             lbl = ' (no powder data selected)'
     2319            lbl = ' (no data selected)'
    23182320        else:
    23192321            lbl = ' ('+str(len(SeqData))+' dataset(s) selected)'
  • trunk/GSASIIpwdGUI.py

    r1783 r1784  
    29632963        ShowReflTable(phaseName)
    29642964       
     2965    def OnClearReject(event):
     2966        phaseName = G2frame.RefList
     2967        pId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases')
     2968        phaseId =  G2gd.GetPatternTreeItemId(G2frame,pId,phaseName)
     2969        General = G2frame.PatternTree.GetItemPyData(phaseId)['General']
     2970        im = General.get('Super',0)
     2971        for row in range(G2frame.refTable[phaseName].GetNumberRows()):
     2972            if data[1]['RefList'][row][3+im] < 0:
     2973                data[1]['RefList'][row][3+im] *= -1 #toggles mul & -mul
     2974                G2frame.refTable[phaseName].SetCellBackgroundColour(row,3+im,wx.WHITE)
     2975        UpdateReflectionGrid(G2frame,data,True,Name)
     2976                   
    29652977    def MakeReflectionTable(phaseName):
    29662978        '''Returns a wx.grid table (G2gd.Table) containing a list of all reflections
     
    31153127        G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2gd.wxID_PWD3DHKLPLOT)
    31163128        G2frame.Bind(wx.EVT_MENU,OnRejectHKL, id=G2gd.wxID_REJECTHKL)
     3129        G2frame.Bind(wx.EVT_MENU,OnClearReject, id=G2gd.wxID_CLEARREJECT)
    31173130        G2frame.dataFrame.SelectPhase.Enable(False)
    31183131    else:
     
    31243137        G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2gd.wxID_PWD3DHKLPLOT)
    31253138        G2frame.dataFrame.RejectHKL.Enable(False)
     3139        G2frame.dataFrame.ClearReject.Enable(False)
    31263140        G2frame.dataFrame.SelectPhase.Enable(False)
    31273141           
  • trunk/GSASIIstrMath.py

    r1782 r1784  
    27032703                    if ref[6+im] > 0:
    27042704                        ref[11+im] = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist)[0]
    2705                         w = 1.0/ref[6+im]
     2705                        w = 1.0/ref[6+im]   # 1/sig(F^2)
    27062706                        ref[7+im] = parmDict[phfx+'Scale']*ref[9+im]*ref[11+im]  #correct Fc^2 for extinction
    27072707                        ref[8+im] = ref[5+im]/(parmDict[phfx+'Scale']*ref[11+im])
     
    27142714                            nobs += 1
    27152715                            df[i] = -w*(ref[5+im]-ref[7+im])
    2716                             sumwYo += (w*ref[5+im])**2
     2716                            sumwYo += (w*ref[5+im])**2      #w*Fo^2
    27172717                        else:
    27182718                            nrej += 1
     
    27252725                        Fo = np.sqrt(ref[5+im])
    27262726                        Fc = np.sqrt(ref[7+im])
    2727                         w = 2.0*Fo/ref[6+im]
     2727                        w = 2.0*(Fo/ref[6+im])**2    # 1/sig(F)?
    27282728                        if w*Fo >= calcControls['minF/sig'] and ref[3+im] > 0:  #min cutoff & user rejection
    27292729                            sumFo += Fo
     
    27392739            Histogram['Residuals']['sumwYo'] = sumwYo
    27402740            SumwYo += sumwYo
    2741             Histogram['Residuals']['wR'] = min(100.,np.sqrt(np.sum(df**2)/Histogram['Residuals']['sumwYo'])*100.)
     2741            Histogram['Residuals']['wR'] = min(100.,np.sqrt(np.sum(df**2)/sumwYo)*100.)
    27422742            Histogram['Residuals'][phfx+'Rf'] = 100.*sumdF/sumFo
    27432743            Histogram['Residuals'][phfx+'Rf^2'] = 100.*sumdF2/sumFo2
Note: See TracChangeset for help on using the changeset viewer.