Changeset 5108
- Timestamp:
- Dec 6, 2021 7:55:56 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r5106 r5108 414 414 415 415 def OnTest(event): 416 if not self.TestMat(): 417 return 416 418 if self.Mtrans: 417 419 self.newCell = G2lat.TransformCell(self.oldCell[:6],self.Trans.T) … … 590 592 self.Fit() 591 593 594 def TestMat(self): 595 VC = nl.det(self.Trans) 596 if VC < 0.: 597 wx.MessageBox('Warning - left handed transformation',caption='Transformation matrix check', 598 style=wx.ICON_EXCLAMATION) 599 return True 600 try: 601 nl.inv(self.Trans) 602 except nl.LinAlgError: 603 wx.MessageBox('ERROR - bad transformation matrix',caption='Transformation matrix check', 604 style=wx.ICON_ERROR) 605 return False 606 return True 607 592 608 def GetSelection(self): 593 609 self.Phase['General']['SGData'] = self.SGData … … 596 612 else: 597 613 self.Phase['General']['Name'] += ' %s'%(self.Common) 614 if not self.TestMat(): 615 return None 598 616 if self.Mtrans: 599 617 self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans.T) … … 2826 2844 try: 2827 2845 if dlg.ShowModal() == wx.ID_OK: 2828 newPhase,Trans,Uvec,Vvec,ifMag,ifConstr,Common = dlg.GetSelection() 2846 result = dlg.GetSelection() 2847 if result is None: 2848 return 2849 newPhase,Trans,Uvec,Vvec,ifMag,ifConstr,Common = result 2829 2850 newPhase['ranId'] = ran.randint(0,sys.maxsize) 2830 2851 SGData = newPhase['General']['SGData']
Note: See TracChangeset
for help on using the changeset viewer.