Changeset 3435 for trunk/GSASIIphsGUI.py
- Timestamp:
- Jun 14, 2018 3:31:10 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r3429 r3435 326 326 def OnSpaceGroup(event): 327 327 event.Skip() 328 Flds = SGTxt.GetValue().split() 329 Flds[0] = Flds[0].upper() 330 #get rid of extra spaces between fields first 331 for fld in Flds: fld = fld.strip() 332 SpcGp = ' '.join(Flds) 328 SpcGp = GetSpGrpfromUser(self.panel,self.newSpGrp) 333 329 if SpcGp == self.newSpGrp: #didn't change it! 334 330 return … … 432 428 sgSizer = wx.BoxSizer(wx.HORIZONTAL) 433 429 sgSizer.Add(wx.StaticText(self.panel,label=' Space group: '),0,WACV) 434 SGTxt = wx.TextCtrl(self.panel,value=self.newSpGrp,style=wx.TE_PROCESS_ENTER) 435 SGTxt.Bind(wx.EVT_TEXT_ENTER,OnSpaceGroup) 436 SGTxt.Bind(wx.EVT_KILL_FOCUS,OnSpaceGroup) 430 SGTxt = wx.Button(self.panel,wx.ID_ANY,self.newSpGrp,size=(100,-1)) 431 SGTxt.Bind(wx.EVT_BUTTON,OnSpaceGroup) 437 432 sgSizer.Add(SGTxt,0,WACV) 438 433 mainSizer.Add(sgSizer,0,WACV) … … 943 938 ################################################################################ 944 939 ################################################################################ 940 def GetSpGrpfromUser(parent,SpGrp): 941 helptext = '''\t\t\tGSAS-II space group information 942 943 Space groups are entered here as given in Volume I or Volume A of the 944 International Tables using the short Hermann-Mauguin symbol,except that spaces 945 are placed between axial fields (e.g. "P 4/m m m", "F D 3 M" or "p -3 1 m"). 946 NB: the cubic "bar" in "F d -3 m" is unnecessary, and upper/lower case is not required. 947 948 Where a centrosymmetric tetragonal or cubic space group has alternate origin settings, 949 Origin choice 2 (with the center of symmetry at the origin, which gives an -x,-y,-z 950 symmetry operator) is always used. Refer to the relevant pages in IT I or A to find 951 the offset in atom positions between the two choices. 952 953 For rhombohedral space groups, (R xxx) the hexagonal setting is assumed. Append a 954 final R to the name (R xxx R) to indicate that a rhombohedral cell should be 955 used (not recommended when alpha >> 120 or << 60, due to correlation.) 956 957 For standard settings of space groups, space group numbers (1-230) can alternately 958 be entered. 959 960 GSAS-II will accept non-standard settings of space groups. For example, space 961 group "P -1" can be set to include face centering, using symbol "F -1" and "P 1 1 21/a" 962 as a nonstandard version of "P 21/c". 963 964 Review the symmetry operators generated by GSAS-II to confirm that you have 965 entered the right symbol for your structure. 966 ''' 967 dlg = G2G.SingleStringDialog(parent,'Get Space Group', 968 ' Input the space group with spaces between axial fields \n (e.g. p 21/c, P 63/m m c, P 4/m m m) or enter a space\n group number between 1 and 230.', 969 value=SpGrp,help=helptext) 970 if not dlg.Show(): 971 dlg.Destroy() 972 return 973 else: 974 try: 975 # has a space group number been input? 976 spcnum = int(dlg.GetValue()) 977 if 1 <= spcnum <= 230: 978 SpcGp = G2spc.spgbyNum[spcnum] 979 else: 980 msg = 'Space Group Error' 981 wx.MessageBox('Invalid space group number',caption=msg,style=wx.ICON_EXCLAMATION) 982 return 983 except: 984 #get rid of extra spaces between fields first 985 Flds = dlg.GetValue().split() 986 for fld in Flds: fld = fld.strip() 987 SpcGp = ' '.join(Flds) 988 finally: 989 dlg.Destroy() 990 return SpcGp 945 991 946 992 … … 1335 1381 G2G.SGMessageBox(General,msg,text,table).Show() 1336 1382 return 1337 helptext = '''\t\t\tGSAS-II space group information1338 1339 Space groups are entered here as given in Volume I or Volume A of the1340 International Tables using the short Hermann-Mauguin symbol,except that spaces1341 are placed between axial fields (e.g. "P 4/m m m", "F D 3 M" or "p -3 1 m").1342 NB: the cubic "bar" in "F d -3 m" is unnecessary, and upper/lower case is not required.1343 1344 Where a centrosymmetric tetragonal or cubic space group has alternate origin settings,1345 Origin choice 2 (with the center of symmetry at the origin, which gives an -x,-y,-z1346 symmetry operator) is always used. Refer to the relevant pages in IT I or A to find1347 the offset in atom positions between the two choices.1348 1349 For rhombohedral space groups, (R xxx) the hexagonal setting is assumed. Append a1350 final R to the name (R xxx R) to indicate that a rhombohedral cell should be1351 used (not recommended when alpha >> 120 or << 60, due to correlation.)1352 1353 For standard settings of space groups, space group numbers (1-230) can alternately1354 be entered.1355 1356 GSAS-II will accept non-standard settings of space groups. For example, space1357 group "P -1" can be set to include face centering, using symbol "F -1" and "P 1 1 21/a"1358 as a nonstandard version of "P 21/c".1359 1360 Review the symmetry operators generated by GSAS-II to confirm that you have1361 entered the right symbol for your structure.1362 '''1363 dlg = G2G.SingleStringDialog(General,'Get Space Group',1364 ' Input the space group with spaces between axial fields \n (e.g. p 21/c, P 63/m m c, P 4/m m m) or enter a space\n group number between 1 and 230.',1365 value=SpGrp,help=helptext)1366 if not dlg.Show():1367 dlg.Destroy()1368 return1369 else:1370 try:1371 # has a space group number been input?1372 spcnum = int(dlg.GetValue())1373 if 1 <= spcnum <= 230:1374 SpcGp = G2spc.spgbyNum[spcnum]1375 else:1376 msg = 'Space Group Error'1377 wx.MessageBox('Invalid space group number',caption=msg,style=wx.ICON_EXCLAMATION)1378 return1379 except:1380 #get rid of extra spaces between fields first1381 Flds = dlg.GetValue().split()1382 for fld in Flds: fld = fld.strip()1383 SpcGp = ' '.join(Flds)1384 finally:1385 dlg.Destroy()1386 1383 # try a lookup on the user-supplied name 1384 SpcGp = GetSpGrpfromUser(General,SpGrp) 1387 1385 SpGrpNorm = G2spc.StandardizeSpcName(SpcGp) 1388 1386 if SpGrpNorm:
Note: See TracChangeset
for help on using the changeset viewer.