Changeset 2211


Ignore:
Timestamp:
Apr 13, 2016 3:16:53 PM (6 years ago)
Author:
vondreele
Message:

some work on Transform Phase menu item.
uncomment the if Page.context lines in OGL plots to make multistructure plots behave.
Trap trying to plot reflections when none available.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2198 r2211  
    165165    'P->F':np.array([[-1,1,1],[1,-1,1],[1,1,-1]]),'F->P':np.array([[0,.5,.5],[.5,0,.5],[.5,.5,0]]),   
    166166    'P->I':np.array([[0,1,1],[1,0,1],[1,1,0]]),'I->P':np.array([[-.5,.5,.5],[.5,-.5,.5],[.5,.5,-.5]]),   
    167     'A->P':np.array([[-1,0,0],[0,-.5,.5],[0,.5,.5]]),'O->R':np.array([[-1,0,0],[0,-1,0],[0,0,1]]), }
    168 commonNames = ['abc','bca','cab','a-cb','ba-c','-cba','P->A','A->P',
    169     'P->B','B->P','P->C','C->P','P->I','I->P','P->F','F->P','P->R','R->P','R->O','O->R']
     167    'A->P':np.array([[-1,0,0],[0,-.5,.5],[0,.5,.5]]),'O->R':np.array([[-1,0,0],[0,-1,0],[0,0,1]]),
     168    'abc*':np.eye(3), }
     169commonNames = ['abc','bca','cab','a-cb','ba-c','-cba','P->A','A->P','P->B','B->P','P->C','C->P',
     170    'P->I','I->P','P->F','F->P','P->R','R->P','R->O','O->R','abc*',]
    170171
    171172# Should SGMessageBox, SymOpDialog, DisAglDialog be moved?
     
    372373            for fld in Flds: fld = fld.strip()
    373374            SpcGp = ' '.join(Flds)
     375            if SpcGp == self.SpGrp: #didn't change it!
     376                return
    374377            # try a lookup on the user-supplied name
    375378            SpGrpNorm = G2spc.StandardizeSpcName(SpcGp)
     
    388391                text,table = G2spc.SGPrint(SGData)
    389392                self.Phase['General']['SGData'] = SGData
    390                 self.SpGrp = SpGrp
     393                self.SpGrp = SpcGp
    391394                SGTxt.SetValue(self.Phase['General']['SGData']['SpGrp'])
    392395                msg = 'Space Group Information'
     
    478481       
    479482    def GetSelection(self):
    480         self.Phase['General']['Name'] += ' %s'%(self.SpGrp)
     483        self.Phase['General']['Name'] += ' %s'%(self.Common)
    481484        self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans)           
    482485        return self.Phase,self.Trans,self.Vec
     
    703706            commonSizer = wx.BoxSizer(wx.HORIZONTAL)
    704707            commonSizer.Add(wx.StaticText(self.panel,label=' Common transformations: '),0,WACV)
    705             common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames,
     708            common = wx.ComboBox(self.panel,value=self.Common,choices=commonNames[:-1], #not the last one!
    706709                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    707710            common.Bind(wx.EVT_COMBOBOX,OnCommon)
  • trunk/GSASIIphsGUI.py

    r2210 r2211  
    12271227            dlg.Destroy()
    12281228        phaseName = newPhase['General']['Name']
     1229        print phaseName
    12291230        sub = G2frame.PatternTree.AppendItem(parent=
    1230             G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases'),text=PhaseName)
     1231            G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases'),text=phaseName)
    12311232        G2frame.PatternTree.SetItemPyData(sub,newPhase)
    12321233
  • trunk/GSASIIplot.py

    r2209 r2211  
    11131113        RenderDots(HKL,RC)
    11141114        time0 = time.time()
    1115 #        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
     1115        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
    11161116        Page.canvas.SwapBuffers()
    11171117
     
    49604960                    G2frame.G2plotNB.status.SetStatusText('New quaternion: %.2f+, %.2fi+ ,%.2fj+, %.2fk'%(Q[0],Q[1],Q[2],Q[3]),1)
    49614961                Draw('move')
    4962            
    49634962       
    49644963    def OnMouseWheel(event):
     
    56575656                RenderBackbone(Backbone,BackboneColor,bondR)
    56585657#        print time.time()-time0
    5659 #        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
     5658        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
    56605659        Page.canvas.SwapBuffers()
    56615660       
     
    57125711    except:
    57135712        pass
    5714     Draw('main')
     5713    wx.CallAfter(Draw,'main')
    57155714    if firstCall: Draw('main') # draw twice the first time that graphics are displayed
    57165715
     
    59645963            RenderBonds(x,y,z,Bonds[iat],0.05,color)
    59655964            RenderLabel(x,y,z,'  '+atNames[iat],matRot)
    5966 #        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
     5965        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
    59675966        Page.canvas.SwapBuffers()
    59685967
     
    63506349            if Page.labels:
    63516350                RenderLabel(x,y,z,'  '+AtNames[iat],matRot)
    6352 #        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
     6351        if Page.context: Page.canvas.SetCurrent(Page.context)    # wx 2.9 fix
    63536352        Page.canvas.SwapBuffers()
    63546353
  • trunk/GSASIIpwdGUI.py

    r2202 r2211  
    32093209            refList = data[1]['RefList']
    32103210        else:                           #powder data is a dict of dicts; each same structure as SC 2nd dict
    3211             refList = np.array(data[phaseName]['RefList'])
     3211            if 'RefList' in data[phaseName]:
     3212                refList = np.array(data[phaseName]['RefList'])
     3213            else:
     3214                wx.MessageBox('No reflection list - do Refine first',caption='Reflection plotting')
     3215                return
    32123216        FoMax = np.max(refList.T[8+Super])
    32133217        Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])
     
    32333237            refList = data[1]['RefList']
    32343238        else:                           #powder data is a dict of dicts; each same structure as SC 2nd dict
    3235             refList = np.array(data[phaseName]['RefList'])
     3239            if 'RefList' in data[phaseName]:
     3240                refList = np.array(data[phaseName]['RefList'])
     3241            else:
     3242                wx.MessageBox('No reflection list - do Refine first',caption='Reflection plotting')
     3243                return
    32363244        refList.T[3+Super] = np.where(refList.T[4+Super]<dMin,-refList.T[3+Super],refList.T[3+Super])
    32373245        FoMax = np.max(refList.T[8+Super])
Note: See TracChangeset for help on using the changeset viewer.