Changeset 2675


Ignore:
Timestamp:
Jan 30, 2017 2:38:50 PM (5 years ago)
Author:
toby
Message:

Make new PDF names unique; plot G(r); minor fixes

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2674 r2675  
    36023602                if dlg.ShowModal() == wx.ID_OK:
    36033603                    for i in dlg.GetSelections():
    3604                         G2obj.CreatePDFitems(self,TextList[i],ElLists[i],Qlimits[i])
     3604                        PDFnames = G2gd.GetPatternTreeDataNames(self,['PDF ',])
     3605                        G2obj.CreatePDFitems(self,TextList[i],ElLists[i],Qlimits[i],PDFnames)
    36053606                for item in self.ExportPDF: item.Enable(True)
    36063607            finally:
  • trunk/GSASIIgrid.py

    r2674 r2675  
    21152115        self.MaskEdit.Append(help='Save mask to file',
    21162116            id=wxID_MASKSAVE, kind=wx.ITEM_NORMAL,text='Save mask')
    2117         self.MaskEdit.Append(help='Load mask from file',
    2118             id=wxID_MASKLOAD, kind=wx.ITEM_NORMAL,text='Load mask')
    2119         self.MaskEdit.Append(help='Load mask from file; ignore threshold',
    2120             id=wxID_MASKLOADNOT, kind=wx.ITEM_NORMAL,text='Load mask w/o threshold')
     2117        self.MaskEdit.Append(help='Load mask from file; ignoring threshold',
     2118            id=wxID_MASKLOADNOT, kind=wx.ITEM_NORMAL,text='Load mask')
     2119        self.MaskEdit.Append(help='Load mask from file keeping the threshold value',
     2120            id=wxID_MASKLOAD, kind=wx.ITEM_NORMAL,text='Load mask w/threshold')
    21212121        self.MaskEdit.Append(help='Auto search for spot masks; NB: will clear old spot masks',
    21222122            id=wxID_FINDSPOTS, kind=wx.ITEM_NORMAL,text='Auto spot masks')
     
    21772177        self.PDFEdit.Append(help='Compute PDF', id=wxID_PDFCOMPUTE, kind=wx.ITEM_NORMAL,
    21782178            text='Compute PDF')
    2179         self.PDFEdit.Append(help='Compute all PDFs', id=wxID_PDFCOMPUTEALL, kind=wx.ITEM_NORMAL,
     2179        self.PDFEdit.Append(help='Compute all PDFs with or w/o optimization',
     2180                            id=wxID_PDFCOMPUTEALL, kind=wx.ITEM_NORMAL,
    21802181            text='Compute all PDFs')
    21812182#        self.PDFEdit.Append(help='Optimize PDF', id=wxID_PDFOPT, kind=wx.ITEM_NORMAL,
  • trunk/GSASIIimgGUI.py

    r2674 r2675  
    23592359            fInp4a.Enable(self.params['ComputePDF'])
    23602360            btn4.Enable(self.params['ComputePDF'])
     2361            cOpt.Enable(self.params['ComputePDF'])
    23612362            if self.params['ComputePDF']:
    23622363                lbl4.SetForegroundColour("black")
     
    23922393        self.params['pdfDmax'] = 0.0
    23932394        self.params['pdfprm'] = ''
     2395        self.params['optPDF'] = True
    23942396        self.pdfControls = {}
    23952397
     
    24682470        fInp4a = G2G.ValidatedTxtCtrl(mnpnl,self.params,'pdfDmax',min=0.0)
    24692471        sizer.Add(fInp4a,0,wx.ALIGN_CENTER_VERTICAL)
     2472        cOpt = G2G.G2CheckBox(mnpnl,'Optimize',self.params,'optPDF')
     2473        sizer.Add(cOpt)
    24702474        lblsizr.Add(sizer,0)
    24712475        sizer = wx.BoxSizer(wx.HORIZONTAL)
     
    28482852                            ElData['FormulaNo'] = float(num)
    28492853                            ElList[elem] = ElData
    2850                 PDFid = G2obj.CreatePDFitems(G2frame,pwdr,ElList.copy(),Qlimits)
     2854                PDFnames = G2gd.GetPatternTreeDataNames(G2frame,['PDF ',])
     2855                PDFid = G2obj.CreatePDFitems(G2frame,pwdr,ElList.copy(),Qlimits,PDFnames)
    28512856                PDFdata = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(
    28522857                    G2frame,PDFid, 'PDF Controls'))
     
    28582863                G2pdG.computePDF(G2frame,PDFdata)
    28592864                wx.Yield()
    2860                 G2pdG.OptimizePDF(G2frame,PDFdata,maxCycles=10,)
    2861                 wx.Yield()
     2865                G2frame.PatternId = PDFid
     2866                G2plt.PlotISFG(G2frame,PDFdata,newPlot=False,plotType='G(R)')
     2867                if self.params['optPDF']:
     2868                    G2pdG.OptimizePDF(G2frame,PDFdata,maxCycles=10,)
     2869                    wx.Yield()
     2870                    G2plt.PlotISFG(G2frame,PDFdata,newPlot=False,plotType='G(R)')
    28622871                G2frame.AutointPDFnames.append(pwdr)
    28632872                # save names of PDF entry to be deleted later if needed
  • trunk/GSASIIobj.py

    r2667 r2675  
    20842084        return repr(self.msg)
    20852085
    2086 def CreatePDFitems(G2frame,PWDRtree,ElList,Qlimits):
     2086def CreatePDFitems(G2frame,PWDRtree,ElList,Qlimits,PDFnames=[]):
    20872087    '''Create and initialize a new set of PDF tree entries
    20882088
     
    20932093    :returns: the Id of the newly created PDF entry
    20942094    '''
    2095     PWDRname = PWDRtree[4:]
    2096     Id = G2frame.PatternTree.AppendItem(parent=G2frame.root,text='PDF '+PWDRname)
     2095    PDFname = 'PDF '+PWDRtree[4:] # this places two spaces after PDF which is needed is some places
     2096    PDFname = MakeUniqueLabel(PDFname,PDFnames)
     2097    Id = G2frame.PatternTree.AppendItem(parent=G2frame.root,text=PDFname)
    20972098    Data = {
    20982099        'Sample':{'Name':PWDRtree,'Mult':1.0},
  • trunk/GSASIIpwdGUI.py

    r2674 r2675  
    50185018            if dlg.ShowModal() == wx.ID_OK:
    50195019                results = dlg.GetSelections()
     5020            else:
     5021                return
    50205022        finally:
    50215023            dlg.Destroy()
Note: See TracChangeset for help on using the changeset viewer.