Changeset 400 for trunk/GSASII.py


Ignore:
Timestamp:
Oct 27, 2011 10:26:50 AM (10 years ago)
Author:
vondreele
Message:

new default for Vcov contour plot - RdYlGn?
faster cleanup on changing/reloading projects
cleanup data delete
implement sample parameter copy
improve Vcov plotting routine
implement plot of vcov from seq refinements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r399 r400  
    251251        self.PatternTree.Bind(wx.EVT_TREE_ITEM_EXPANDED,
    252252            self.OnPatternTreeItemExpanded, id=wxID_PATTERNTREE)
     253        self.PatternTree.Bind(wx.EVT_TREE_DELETE_ITEM,
     254            self.OnPatternTreeItemDelete, id=wxID_PATTERNTREE)
    253255        self.root = self.PatternTree.AddRoot('Loaded Data: ')
    254256       
     
    267269        self.dirname = ''
    268270        self.undofile = ''
     271        self.TreeItemDelete = False
    269272        self.Offset = [0.0,0.0]
    270273        self.Weight = False
     
    281284        self.Interpolate = 'nearest'
    282285        self.ContourColor = 'Paired'
     286        self.VcovColor = 'RdYlGn'
    283287        self.Projection = 'equal area'
    284288        self.logPlot = False
     
    312316                       
    313317    def OnPatternTreeSelChanged(self, event):
    314         pltNum = self.G2plotNB.nb.GetSelection()
    315         if pltNum >= 0:                         #to avoid the startup with no plot!
    316             pltPage = self.G2plotNB.nb.GetPage(pltNum)
    317             pltPlot = pltPage.figure
    318         item = event.GetItem()
    319         G2gd.MovePatternTreeToGrid(self,item)
     318        if self.TreeItemDelete:
     319            self.TreeItemDelete = False
     320        else:
     321            pltNum = self.G2plotNB.nb.GetSelection()
     322            if pltNum >= 0:                         #to avoid the startup with no plot!
     323                pltPage = self.G2plotNB.nb.GetPage(pltNum)
     324                pltPlot = pltPage.figure
     325            item = event.GetItem()
     326            G2gd.MovePatternTreeToGrid(self,item)
    320327       
    321328    def OnPatternTreeItemCollapsed(self, event):
     
    325332        event.Skip()
    326333       
    327     def OnPatternTreeDeleteItem(self, event):
    328         event.Skip()
     334    def OnPatternTreeItemDelete(self, event):
     335        self.TreeItemDelete = True
    329336
    330337    def OnPatternTreeItemActivated(self, event):
    331338        event.Skip()
    332        
     339               
    333340    def OnPwdrRead(self, event):
    334341        self.CheckNotebook()
     
    10061013            while item:
    10071014                name = self.PatternTree.GetItemText(item)
    1008                 if 'PWDR' in name or 'HKLF' in name or 'IMG' or 'PDF' in name:
     1015                if name not in ['Notebook','Controls','Covariance','Constraints','Restraints','Phases']:
    10091016                    if 'PWDR' in name: ifPWDR = True
    10101017                    if 'IMG' in name: ifIMG = True
     
    10541061                    self.PatternTree.DeleteChildren(self.root)
    10551062                    self.GSASprojectfile = ''
    1056                     self.PatternTree.DeleteChildren(self.root)
     1063#                    self.PatternTree.DeleteChildren(self.root)
    10571064                    if self.HKL: self.HKL = []
    10581065                    if self.G2plotNB.plotList:
     
    15271534        self.OnFileSave(event)
    15281535        Id = G2gd.GetPatternTreeItemId(self,self.root,'Sequental results')
     1536        print Id
    15291537        if not Id:
    15301538            Id = self.PatternTree.AppendItem(self.root,text='Sequental results')
     1539            print Id
    15311540            self.PatternTree.SetItemPyData(Id,{})           
    15321541        dlg = wx.ProgressDialog('Residual for histogram 0','Powder profile Rwp =',101.0,
Note: See TracChangeset for help on using the changeset viewer.