Changeset 782


Ignore:
Timestamp:
Oct 17, 2012 9:03:11 AM (10 years ago)
Author:
vondreele
Message:

add flag for keep in cells from indexing result
add keep to indel cells result so cells can be retained from one index run to another

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIindex.py

    r762 r782  
    559559                                    print "%10.3f %3d %3d %10.5f %10.5f %10.5f %10.3f %10.3f %10.3f %10.2f %10.2f" % (M20,X20,Nc,a,b,c,alp,bet,gam,V,V1)
    560560                                    if M20 >= 2.0:
    561                                         cells.append([M20,X20,ibrav,a,b,c,alp,bet,gam,V,False])
     561                                        cells.append([M20,X20,ibrav,a,b,c,alp,bet,gam,V,False,False])
    562562                            if not GoOn:
    563563                                break
     
    589589        return True,dmin,cells
    590590    else:
    591         return False,0,0
     591        return False,0,[]
    592592       
    593593       
  • trunk/GSASIIpwdGUI.py

    r765 r782  
    774774        UpdateInstrumentGrid(G2frame,data)
    775775               
    776     def OnNewType(event):
    777         insVal['Type'] = typePick.GetValue()
    778         data = updateData(insVal,insRef)
    779         if 'P' in insVal['Type']:
    780             UpdateInstrumentGrid(G2frame,data)
    781        
    782776    def OnLamPick(event):
    783777        lamType = lamPick.GetValue()
     
    845839    G2frame.dataDisplay = wx.Panel(G2frame.dataFrame)
    846840    instSizer = wx.FlexGridSizer(2,6,5,5)
    847     instSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,' Histogram Type:'),0,wx.ALIGN_CENTER_VERTICAL)
     841    instSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,' Histogram Type: '+insVal['Type']),0,wx.ALIGN_CENTER_VERTICAL)
    848842    if 'P' in insVal['Type']:                   #powder data
    849843        G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.InstMenu)
     
    856850        G2frame.Bind(wx.EVT_MENU,OnInstFlagCopy,id=G2gd.wxID_INSTFLAGCOPY)
    857851        G2frame.Bind(wx.EVT_MENU,OnWaveChange,id=G2gd.wxID_CHANGEWAVETYPE)       
    858         typePick = wx.ComboBox(G2frame.dataDisplay,value=insVal['Type'],
    859             choices=['PXC','PNC','PNT'],style=wx.CB_READONLY|wx.CB_DROPDOWN)
    860         typePick.Bind(wx.EVT_COMBOBOX, OnNewType)
    861         instSizer.Add(typePick,0,wx.ALIGN_CENTER_VERTICAL)
    862852        if 'C' in insVal['Type']:               #constant wavelength
    863853            #patch
     
    954944
    955945    else:                       #single crystal data
    956         typePick = wx.ComboBox(G2frame.dataDisplay,value=insVal['Type'],
    957             choices=['SXC','SNC','SNT'],style=wx.CB_READONLY|wx.CB_DROPDOWN)
    958         typePick.Bind(wx.EVT_COMBOBOX, OnNewType)
    959         instSizer.Add(typePick,0,wx.ALIGN_CENTER_VERTICAL)
    960946        if 'C' in insVal['Type']:               #constant wavelength
    961947            instSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,' Lam: (%10.6f)'%(insDef['Lam'])),
     
    15791565        PatternId = G2frame.PatternId   
    15801566        print 'Peak Indexing'
     1567        keepcells = []
    15811568        try:
    15821569            controls,bravais,cells,dmin = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Unit Cells List'))
    1583             cells = []
     1570            for cell in cells:
     1571                if cell[11]:
     1572                    keepcells.append(cell)
     1573        except IndexError:
     1574            pass
    15841575        except ValueError:
    15851576            G2frame.ErrorDialog('Error','Need to set controls in Unit Cell List first')
     
    15901581        G2frame.dataFrame.CopyCell.Enable(False)
    15911582        G2frame.dataFrame.RefineCell.Enable(False)
    1592         OK,dmin,cells = G2indx.DoIndexPeaks(peaks,inst[1],controls,bravais)
     1583        OK,dmin,newcells = G2indx.DoIndexPeaks(peaks,inst[1],controls,bravais)
     1584        cells = keepcells+newcells
    15931585        if OK:
    15941586            data = [controls,bravais,cells,dmin]
     
    16071599            G2frame.dataFrame.IndexPeaks.Enable(True)
    16081600            G2frame.dataFrame.MakeNewPhase.Enable(True)
    1609             wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
     1601        wx.CallAfter(UpdateUnitCellsGrid,G2frame,data)
    16101602               
    16111603    def RefreshUnitCellsGrid(event):
     
    16291621                else:
    16301622                    G2plt.PlotPatterns(G2frame)
     1623            elif c == 11:
     1624                if UnitCellsTable.GetValue(r,c):
     1625                    UnitCellsTable.SetValue(r,c,False)
     1626                else:
     1627                    UnitCellsTable.SetValue(r,c,True)
     1628                gridDisplay.ForceRefresh()               
    16311629       
    16321630    def MakeNewPhase(event):
     
    17411739    littleSizer.Add(bravSel,0,wx.ALIGN_CENTER_VERTICAL)
    17421740    littleSizer.Add(wx.StaticText(G2frame.dataDisplay,label=" Space group "),0,wx.ALIGN_CENTER_VERTICAL)
     1741    print controls
    17431742    spcSel = wx.Choice(G2frame.dataDisplay,choices=SPGlist[controls[5]])
    17441743    spcSel.SetSelection(SPGlist[controls[5]].index(controls[13]))
     
    18001799        wx.StaticText(parent=G2frame.bottom,label=' Indexing Result ')
    18011800        rowLabels = []
    1802         colLabels = ['M20','X20','use','Bravais','a','b','c','alpha','beta','gamma','Volume']
     1801        colLabels = ['M20','X20','use','Bravais','a','b','c','alpha','beta','gamma','Volume','Keep']
    18031802        Types = [wg.GRID_VALUE_FLOAT+':10,2',wg.GRID_VALUE_NUMBER,wg.GRID_VALUE_BOOL,wg.GRID_VALUE_STRING,]+ \
    18041803            3*[wg.GRID_VALUE_FLOAT+':10,5',]+3*[wg.GRID_VALUE_FLOAT+':10,3',]+ \
    1805             [wg.GRID_VALUE_FLOAT+':10,2']
     1804            [wg.GRID_VALUE_FLOAT+':10,2',wg.GRID_VALUE_BOOL]
    18061805        numRows = len(cells)
    18071806        table = []
    18081807        for cell in cells:
    18091808            rowLabels.append('')
    1810             row = cell[0:2]+[cell[-1]]+[bravaisSymb[cell[2]]]+cell[3:10]
     1809            row = cell[0:2]+[cell[-1]]+[bravaisSymb[cell[2]]]+cell[3:11]
    18111810            if cell[-1]:
    18121811                A = G2lat.cell2A(cell[3:9])
  • trunk/help/Fit Peaks.htm

    r780 r782  
    2323  <o:Author>Von Dreele</o:Author>
    2424  <o:LastAuthor>Von Dreele</o:LastAuthor>
    25   <o:Revision>20</o:Revision>
    26   <o:TotalTime>306</o:TotalTime>
     25  <o:Revision>22</o:Revision>
     26  <o:TotalTime>429</o:TotalTime>
    2727  <o:Created>2012-05-05T16:28:00Z</o:Created>
    28   <o:LastSaved>2012-10-05T18:55:00Z</o:LastSaved>
    29   <o:Pages>9</o:Pages>
    30   <o:Words>1909</o:Words>
    31   <o:Characters>10886</o:Characters>
     28  <o:LastSaved>2012-10-16T19:18:00Z</o:LastSaved>
     29  <o:Pages>2</o:Pages>
     30  <o:Words>1952</o:Words>
     31  <o:Characters>11133</o:Characters>
    3232  <o:Company>Argonne National Laboratory</o:Company>
    33   <o:Lines>90</o:Lines>
    34   <o:Paragraphs>25</o:Paragraphs>
    35   <o:CharactersWithSpaces>12770</o:CharactersWithSpaces>
     33  <o:Lines>92</o:Lines>
     34  <o:Paragraphs>26</o:Paragraphs>
     35  <o:CharactersWithSpaces>13059</o:CharactersWithSpaces>
    3636  <o:Version>14.00</o:Version>
    3737 </o:DocumentProperties>
     
    4040 </o:OfficeDocumentSettings>
    4141</xml><![endif]-->
    42 <link rel=dataStoreItem href="Fit%20Peaks_files/item0028.xml"
    43 target="Fit%20Peaks_files/props029.xml">
     42<link rel=dataStoreItem href="Fit%20Peaks_files/item0030.xml"
     43target="Fit%20Peaks_files/props031.xml">
    4444<link rel=themeData href="Fit%20Peaks_files/themedata.thmx">
    4545<link rel=colorSchemeMapping href="Fit%20Peaks_files/colorschememapping.xml">
     
    14171417style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>2.<span
    14181418style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>Now
    1419 add refinement of the peak positions. This can be done by clicking on all the refinement
    1420 flags for the individual peaks or it is possible to set them all at the same
    1421 time using this recipe: </p>
     1419add refinement of the peak positions. This can be done by clicking on all the
     1420refinement flags for the individual peaks or it is possible to set them all at
     1421the same time using this recipe: </p>
    14221422
    14231423<p class=MsoListParagraphCxSpMiddle style='margin-left:1.0in;mso-add-space:
     
    14801480
    14811481<p class=MsoListParagraphCxSpFirst>The plot window shows the resolution curves
    1482 corresponding to the values of the Gaussian U, V, W, Lorentzian X &amp; Y coefficients;
    1483 ‘+’ marks show the individual values based on the sig &amp; gam values for the
    1484 peaks in Peak List. Select the refine flag checkbox for Gaussian <b
    1485 style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
     1482corresponding to the values of the Gaussian U, V, W, Lorentzian X &amp; Y
     1483coefficients; ‘+’ marks show the individual values based on the sig &amp; gam
     1484values for the peaks in Peak List. Select the refine flag checkbox for Gaussian
     1485<b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    14861486mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:
    14871487minor-latin'>U</span></b>, <b style='mso-bidi-font-weight:normal'><span
     
    15171517src="Fit%20Peaks_files/image012.png" v:shapes="Picture_x0020_11"><![endif]></span></p>
    15181518
    1519 <p class=MsoListParagraphCxSpLast>The <span class=SpellE>Rwp</span> is ~6% as shown
    1520 on the console window. Again the <b style='mso-bidi-font-weight:normal'><span
     1519<p class=MsoListParagraphCxSpLast>The <span class=SpellE>Rwp</span> is ~6% as
     1520shown on the console window. Again the <b style='mso-bidi-font-weight:normal'><span
    15211521style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    15221522mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Peak List</span></b>
     
    18171817style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    18181818mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:minor-latin'>Cancel</span></b>
    1819 on the progress bar window. It may take more than one press to fully stop it.
    1820 My result was </p>
     1819on the progress bar window. Notice the ‘<b style='mso-bidi-font-weight:normal'>keep’</b>
     1820column; this allows you to keep some solutions from one indexing run to the
     1821next. It may take more than one press to fully stop it. My result was </p>
    18211822
    18221823<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
    1823  id="Picture_x0020_20" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:527.25pt;
     1824 id="Picture_x0020_24" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:527.25pt;
    18241825 height:376.5pt;visibility:visible;mso-wrap-style:square'>
    18251826 <v:imagedata src="Fit%20Peaks_files/image021.png" o:title=""/>
    18261827</v:shape><![endif]--><![if !vml]><img border=0 width=703 height=502
    1827 src="Fit%20Peaks_files/image021.png" v:shapes="Picture_x0020_20"><![endif]></span></p>
    1828 
    1829 <p class=MsoNormal>Notice an equally good M20 result with twice the volume. The
    1830 plot shows every peak indexed including a couple of weak peaks not selected for
    1831 the peak fitting.</p>
     1828src="Fit%20Peaks_files/image021.png" v:shapes="Picture_x0020_24"><![endif]></span></p>
     1829
     1830<p class=MsoNormal>Notice two equally good M20 results with different volumes;
     1831other solutions may be obtained as you keep trying the indexing. Be sure to use
     1832keep to keep good ones as you try new indexing runs. The best solution is the
     1833one with the smaller volume. The plot shows every peak indexed including a
     1834couple of weak peaks not selected for the peak fitting.</p>
    18321835
    18331836<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
  • trunk/help/Fit Peaks_files/filelist.xml

    r780 r782  
    11<xml xmlns:o="urn:schemas-microsoft-com:office:office">
    22 <o:MainFile HRef="../Fit%20Peaks.htm"/>
    3  <o:File HRef="item0028.xml"/>
    4  <o:File HRef="props029.xml"/>
     3 <o:File HRef="item0030.xml"/>
     4 <o:File HRef="props031.xml"/>
    55 <o:File HRef="themedata.thmx"/>
    66 <o:File HRef="colorschememapping.xml"/>
Note: See TracChangeset for help on using the changeset viewer.