Changeset 311 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Jun 27, 2011 10:27:29 AM (10 years ago)
Author:
vondreele
Message:

finish new indexing refinement stuff
more on texture plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r303 r311  
    664664    def OnStartVol(event):
    665665        try:
    666             stVol = int(startVol.GetValue())
     666            stVol = int(float(startVol.GetValue()))
     667            if stVol < 25:
     668                raise ValueError
    667669        except ValueError:
    668670            stVol = 25
     
    678680            Zero = min(0.1,max(-0.1,float(zero.GetValue())))
    679681        except ValueError:
    680             Zero = 0.1
     682            Zero = 0.0
    681683        controls[1] = Zero
    682         zero.SetValue("%.2f"%(Zero))
     684        zero.SetValue("%.4f"%(Zero))
    683685       
    684686    def OnZeroVar(event):
     
    790792        ibrav = bravaisSymb.index(controls[5])
    791793        dmin = G2indx.getDmin(peaks)-0.005
    792         Lhkl,M20,X20,A = G2indx.refinePeaks(peaks,ibrav,A)
    793         controls[6:12] = G2lat.A2cell(A)
    794         controls[12] = G2lat.calc_V(A)
     794        Lhkl,M20,X20,Aref,Zero = G2indx.refinePeaks(peaks,ibrav,A,controls[:2])
     795        controls[:2] = Zero
     796        controls[6:12] = G2lat.A2cell(Aref)
     797        controls[12] = G2lat.calc_V(Aref)
    795798        data = [controls,bravais,cells,dmin]
    796799        self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,PatternId, 'Unit Cells List'),data)
    797         self.HKL = G2lat.GenHBravais(dmin,ibrav,A)
     800        self.HKL = G2lat.GenHBravais(dmin,ibrav,Aref)
    798801        UpdateUnitCellsGrid(self,data)
    799802        print "%s%10.3f" % ('refinement M20 = ',M20)
    800803        print 'unindexed lines = ',X20
    801         cellPrint(ibrav,A)
     804        cellPrint(ibrav,Aref)
    802805        for hkl in self.HKL:
    803806            hkl.append(2.0*asind(inst[1]/(2.*hkl[3])))             
     
    960963    littleSizer.Add(NcNo,0,wx.ALIGN_CENTER_VERTICAL)
    961964    littleSizer.Add(wx.StaticText(parent=self.dataDisplay,label=' Start Volume '),0,wx.ALIGN_CENTER_VERTICAL)
    962     startVol = wx.TextCtrl(self.dataDisplay,value=str(controls[3]),style=wx.TE_PROCESS_ENTER)
     965    startVol = wx.TextCtrl(self.dataDisplay,value=str('%d'%(controls[3])),style=wx.TE_PROCESS_ENTER)
    963966    startVol.Bind(wx.EVT_TEXT_ENTER,OnStartVol)
    964967    startVol.Bind(wx.EVT_KILL_FOCUS,OnStartVol)
     
    980983    mainSizer.Add(littleSizer,0)
    981984    mainSizer.Add((5,5),0)
    982     littleSizer = wx.FlexGridSizer(1,3,5,5)
    983     littleSizer.Add(wx.StaticText(self.dataDisplay,label=" Zero offset"),0,wx.ALIGN_CENTER_VERTICAL)
    984     zero = wx.TextCtrl(self.dataDisplay,value="%.2f"%(controls[1]),style=wx.TE_PROCESS_ENTER)
    985     zero.Bind(wx.EVT_TEXT_ENTER,OnZero)
    986     zero.Bind(wx.EVT_KILL_FOCUS,OnZero)
    987     littleSizer.Add(zero,0,wx.ALIGN_CENTER_VERTICAL)
    988     zeroVar = wx.CheckBox(self.dataDisplay,label="Vary? (not implemented)")
    989     zeroVar.Bind(wx.EVT_CHECKBOX,OnZeroVar)
    990     littleSizer.Add(zeroVar,0,wx.ALIGN_CENTER_VERTICAL)
    991     mainSizer.Add(littleSizer,0)
    992     mainSizer.Add((5,5),0)
     985   
    993986    mainSizer.Add(wx.StaticText(parent=self.dataDisplay,label=' Cell Refinement: '),0,wx.ALIGN_CENTER_VERTICAL)
    994987    mainSizer.Add((5,5),0)
    995     littleSizer = wx.FlexGridSizer(1,3,5,5)
     988    littleSizer = wx.BoxSizer(wx.HORIZONTAL)
    996989    littleSizer.Add(wx.StaticText(self.dataDisplay,label=" Bravais lattice "),0,wx.ALIGN_CENTER_VERTICAL)
    997990    bravSel = wx.Choice(self.dataDisplay,choices=bravaisSymb)
     
    999992    bravSel.Bind(wx.EVT_CHOICE,OnBravSel)
    1000993    littleSizer.Add(bravSel,0,wx.ALIGN_CENTER_VERTICAL)
    1001     hklShow = wx.CheckBox(self.dataDisplay,label="Show starting hkl positions")
     994    littleSizer.Add(wx.StaticText(self.dataDisplay,label=" Zero offset"),0,wx.ALIGN_CENTER_VERTICAL)
     995    zero = wx.TextCtrl(self.dataDisplay,value="%.4f"%(controls[1]),style=wx.TE_PROCESS_ENTER)
     996    zero.Bind(wx.EVT_TEXT_ENTER,OnZero)
     997    zero.Bind(wx.EVT_KILL_FOCUS,OnZero)
     998    littleSizer.Add(zero,0,wx.ALIGN_CENTER_VERTICAL)
     999    zeroVar = wx.CheckBox(self.dataDisplay,label="Refine? (not implemented)")
     1000    zeroVar.Bind(wx.EVT_CHECKBOX,OnZeroVar)
     1001    littleSizer.Add(zeroVar,0,wx.ALIGN_CENTER_VERTICAL)
     1002    hklShow = wx.CheckBox(self.dataDisplay,label="  Show starting hkl positions")
    10021003    hklShow.Bind(wx.EVT_CHECKBOX,OnHklShow)
    10031004    littleSizer.Add(hklShow,0,wx.ALIGN_CENTER_VERTICAL)
    10041005    mainSizer.Add(littleSizer,0)
     1006   
    10051007    mainSizer.Add((5,5),0)
    10061008    ibrav = SetLattice(controls)
     
    10231025            littleSizer.Add(volVal,0,wx.ALIGN_CENTER_VERTICAL)
    10241026    mainSizer.Add(littleSizer,0)
     1027       
    10251028    mainSizer.Layout()   
    10261029    self.dataDisplay.SetSizer(mainSizer)
Note: See TracChangeset for help on using the changeset viewer.