Changeset 2146
- Timestamp:
- Feb 11, 2016 11:45:00 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r2145 r2146 344 344 def Draw(self): 345 345 346 commonTrans = {'abc':np.eye(3),'a-cb':np.array([[1,0,0],[0,0,-1],[0,1,0]]), 347 'ba-c':np.array([[0,1,0],[1,0,0],[0,0,-1]]),'-cba':np.array([[0,0,-1],[0,1,0],[1,0,0]]), 348 'bca':np.array([[0,1,0],[0,0,1],[1,0,0]]),'cab':np.array([[0,0,1],[1,0,0],[0,1,0]]), 349 'P->R':np.array([[1,-1,0],[0,1,-1],[1,1,1]]),'R->P':np.array([[2./3,1./3,1./3],[-1./3,1./3,1./3],[-1./3,-2./3,1./3]]), 350 'P->A':np.array([[-1,0,0],[0,-1,1],[0,1,1]]),'R->O':np.array([[-1,0,0],[0,-1,0],[0,0,1]]), 351 'P->B':np.array([[-1,0,1],[0,-1,0],[1,0,1]]),'B->P':np.array([[-.5,0,.5],[0,-1,0],[.5,0,.5]]), 352 'P->C':np.array([[1,1,0],[1,-1,0],[0,0,-1]]),'C->P':np.array([[.5,.5,0],[.5,-.5,0],[0,0,-1]]), 353 '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]]), 354 '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]]), 355 '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]]), } 356 commonNames = ['abc','bca','cab','a-cb','ba-c','-cba','P->A','A->P', 357 'P->B','B->P','P->C','C->P','P->I','I->P','P->F','F->P','P->R','R->P','R->O','O->R'] 358 346 359 def OnMatValue(event): 347 360 Obj = event.GetEventObject() … … 365 378 self.Laue = '' 366 379 wx.CallAfter(self.Draw) 380 381 def OnCommon(event): 382 Obj = event.GetEventObject() 383 self.Trans = commonTrans[Obj.GetValue()] 384 wx.CallAfter(self.Draw) 367 385 368 386 self.panel.Destroy() … … 376 394 Trmat = wx.FlexGridSizer(4,4,0,0) 377 395 else: 396 commonSizer = wx.BoxSizer(wx.HORIZONTAL) 397 commonSizer.Add(wx.StaticText(self.panel,label=' Common transformations: '),0,WACV) 398 common = wx.ComboBox(self.panel,value='abc',choices=commonNames, 399 style=wx.CB_READONLY|wx.CB_DROPDOWN) 400 common.Bind(wx.EVT_COMBOBOX,OnCommon) 401 commonSizer.Add(common,0,WACV) 402 transSizer.Add(commonSizer) 378 403 Trmat = wx.FlexGridSizer(3,3,0,0) 379 404 for iy,line in enumerate(self.Trans): 380 405 for ix,val in enumerate(line): 381 item = wx.TextCtrl(self.panel,value='% d'%(val),406 item = wx.TextCtrl(self.panel,value='%5.3f'%(val), 382 407 size=(50,25),style=wx.TE_PROCESS_ENTER) 383 408 Ind[item.GetId()] = [ix,iy] … … 3032 3057 Super = data[1]['Super'] 3033 3058 refList = G2lat.transposeHKLF(Trans,Super,refList) 3059 if not len(refList): 3060 G2frame.ErrorDialog('Failed transformation','Matrix yields fractional hkl indices') 3061 return 3062 Comments.append(" Transformation M*H = H' applied; M=") 3063 Comments.append(str(Trans)) 3034 3064 SG = 'P '+Laue 3035 3065 SGData = G2spc.SpcGroup(SG)[1] -
trunk/GSASIIlattice.py
r2144 r2146 527 527 newRefs = np.copy(refList) 528 528 for H in newRefs: 529 H[:3+Super] = np.rint(np.inner(transMat,H[:3+Super])) 529 newH = np.inner(transMat,H[:3+Super]) 530 H[:3+Super] = np.rint(newH) 531 if not np.allclose(newH,H[:3+Super],atol=0.01): 532 return [] 530 533 return newRefs 531 534
Note: See TracChangeset
for help on using the changeset viewer.