Changeset 1611
- Timestamp:
- Dec 17, 2014 1:51:16 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.BAT
r1603 r1611 7 7 @echo Please cite: 8 8 @echo B.H. Toby and R.B. Von Dreele, J. Appl. Cryst. 46, 544-549 (2013) 9 @echo for small angle use also cite: 10 @echo R.B. Von Dreele, J. Appl. Cryst. 47, 1784-9 (2014) 9 11 @echo ======================================================================== 10 12 @ … … 14 16 @set gsasloc=%gsasloc:\\*=\*% 15 17 @set gsasloc=%gsasloc:\*=\% 16 D:\Python27\python "%gsasloc%\GSASII.py" %1 18 @rem one can use a specific reference to a python via, e.g.: 19 @set pythonloc=%D:\Python27\python% 20 %pythonloc% "%gsasloc%\GSASII.py" %1 17 21 @REM To keep the window from disappearing with any error messages 18 22 pause -
trunk/GSASIIphsGUI.py
r1610 r1611 620 620 SSChoice = G2spc.ssdict.get(generalData['SGData']['SpGrp'],[]) 621 621 if SSChoice: 622 superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=SSChoice,style=wx.CB_ READONLY|wx.CB_DROPDOWN)622 superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=SSChoice,style=wx.CB_DROPDOWN) #wx.CB_READONLY| 623 623 superGp.Bind(wx.EVT_COMBOBOX,OnSuperGp) 624 superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp) 624 625 else: #nonstandard space group symbol not in my dictionary 625 626 superGp = wx.TextCtrl(General,value=generalData['SuperSg'],style=wx.TE_PROCESS_ENTER) … … 2008 2009 return atomSizer 2009 2010 2010 def WaveSizer(waveBlk,Stype,typeName,Names ):2011 def WaveSizer(waveBlk,Stype,typeName,Names,waveCSI): 2011 2012 2012 2013 def OnAddWave(event): … … 2053 2054 for iwave,wave in enumerate(waveBlk): 2054 2055 for ival,val in enumerate(wave[0]): 2055 waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER) 2056 waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal) 2057 waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal) 2058 Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival] 2056 if waveCSI[0][ival] < 0: 2057 waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_READONLY) 2058 waveVal.SetBackgroundColour(VERY_LIGHT_GREY) 2059 else: 2060 waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER) 2061 waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal) 2062 waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal) 2063 Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival] 2059 2064 Waves.Add(waveVal,0,WACV) 2060 2065 if len(wave[0]) > 6 and ival == 5: … … 2101 2106 G2frame.dataFrame.SetStatusText('') 2102 2107 generalData = data['General'] 2108 SGData = generalData['SGData'] 2109 SSGData = generalData['SSGData'] 2103 2110 cx,ct,cs,cia = generalData['AtomPtrs'] 2104 2111 atomData = data['Atoms'] … … 2119 2126 mainSizer.Add(MapSizer(),0,WACV) 2120 2127 for iatm,atom in enumerate(atomData): 2128 xyz = atom[cx:cx+3] 2129 uij = atom[cia+2:cia+8] 2130 CSI = G2spc.GetSSfxuinel(xyz,uij,SGData,SSGData) 2121 2131 for SS in ['SS1',]: #future SS2 & SS3 - I doubt it! 2122 2132 G2gd.HorizontalLine(mainSizer,waveData) … … 2125 2135 if generalData['Type'] == 'modulated' and Stype == 'Smag': 2126 2136 break 2127 mainSizer.Add(WaveSizer(atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype] ))2137 mainSizer.Add(WaveSizer(atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype],CSI[Stype])) 2128 2138 2129 2139 SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer) … … 2637 2647 XYZ = XYZ+cent+Cell 2638 2648 if Force: 2639 XYZ =G2spc.MoveToUnitCell(XYZ)2649 XYZ %= 1. #G2spc.MoveToUnitCell(XYZ) 2640 2650 if noDuplicate(XYZ,atomData): 2641 2651 atom = copy.copy(atomData[ind]) … … 2647 2657 if atom[cuia] == 'A': 2648 2658 Uij = atom[cuij:cuij+6] 2649 U = G2spc.Uij2U(Uij) 2650 U = np.inner(np.inner(M,U),M) 2651 Uij = G2spc.U2Uij(U) 2659 Uij = G2spc.U2Uij(np.inner(np.inner(M,G2spc.Uij2U(Uij)),M)) 2652 2660 atom[cuij:cuij+6] = Uij 2653 2661 atomData.append(atom) -
trunk/GSASIIspc.py
r1606 r1611 22 22 import sys 23 23 import os.path as ospath 24 import config 24 25 25 26 import GSASIIpath … … 603 604 E,SSGOps = extendSSGOps(SSGOps) 604 605 if not E: 605 return E,SSGOps 606 606 return E,SSGOps 607 607 # tetragonal - all done & checked 608 608 elif SGData['SGPtGrp'] == '4': #OK … … 727 727 return E,SSGOps 728 728 729 def specialGen(gensym ):729 def specialGen(gensym,modsym): 730 730 sym = ''.join(gensym) 731 731 if SGData['SGPtGrp'] in ['2/m',] and 'n' in SGData['SpGrp']: … … 741 741 elif sym == 's00': 742 742 gensym = 's0s' 743 elif SGData['SGPtGrp'] in ['mmm',]: 744 if 'g' in modsym: 745 if sym == 's00': 746 gensym = 's0s' 747 elif sym == '0s0': 748 gensym = '0ss' 749 elif 'a' in modsym: 750 if sym == '0s0': 751 gensym = 'ss0' 752 elif sym == '00s': 753 gensym = 's0s' 754 elif 'b' in modsym: 755 if sym == '00s': 756 gensym = '0ss' 757 elif sym == 's00': 758 gensym = 'ss0' 743 759 return gensym 744 760 … … 842 858 if not checkGen(gensym): 843 859 return 'Generator '+''.join(gensym)+' not consistent with space group '+SGData['SpGrp'],None 844 gensym = specialGen(gensym )860 gensym = specialGen(gensym,modsym) 845 861 genQ = [Fracs[mod] for mod in gensym] 846 862 if not genQ: … … 862 878 if E: 863 879 SSGData['SSGOps'] = Result 864 # print SSGData['SSpGrp'] 865 # for Op in Result: 866 # print SSMT2text(Op).replace(' ','') 880 if config.debug: 881 print 'Super spacegroup operators for '+SSGData['SSpGrp'] 882 for Op in Result: 883 print SSMT2text(Op).replace(' ','') 884 if SGData['SGInv']: 885 for Op in Result: 886 Op = [-Op[0],-Op[1]%1.] 887 print SSMT2text(Op).replace(' ','') 867 888 return None,SSGData 868 889 else: … … 1400 1421 indx = GetNXUPQsym(siteSym) 1401 1422 return CSuinel[indx[1]] 1423 1424 def GetSSfxuinel(XYZ,UIJ,SGData,SSGData): 1425 CSI = {'Sfrac':[[0,1],[1.,1.]],'Spos':[[0,1,2, 0,1,2],[1.,1.,1., 1.,1.,1.]], #sin & cos 1426 'Sadp':[[0,1,2,3,4,5, 0,1,2,3,4,5],[1.,1.,1.,1.,1.,1., 1.,1.,1.,1.,1.,1.]], 1427 'Smag':[[0,1,2, 0,1,2],[1.,1.,1., 1.,1.,1.]]} 1428 deltx = np.eye((3))*.001 1429 deltu = np.eye((6))*.0001 1430 xyz = np.array(XYZ)%1. 1431 uij = np.array(UIJ) 1432 SGOps = SGData['SGOps'] 1433 SSGOps = SSGData['SSGOps'] 1434 ssop = SSGOps[0] 1435 sop = SGOps[0] 1436 for iop,Op in enumerate(SGOps): 1437 nxyz = (np.inner(Op[0],xyz)+Op[1])%1. 1438 if SGData['SGInv'] and np.allclose(xyz,-nxyz%1.,1.e-6): 1439 ssop = SSGOps[iop] 1440 ssop = [-ssop[0],-ssop[1]%1.] 1441 sop = [-Op[0],-Op[1]%1.] 1442 break 1443 elif np.allclose(xyz,nxyz,1.e-6) and iop: 1444 ssop = SSGOps[iop] 1445 sop = SGOps[iop] 1446 break 1447 siteSym = SytSym(XYZ,SGData)[0].strip().split('(')[0] 1448 OpText = MT2text(sop).replace(' ','') 1449 SSOptext = SSMT2text(ssop).replace(' ','') 1450 if siteSym == '1': #"1" site symmetry 1451 return CSI 1452 elif siteSym == '-1': #"-1" site symmetry 1453 CSI['Spos'][0] = [0,1,2, -1,-1,-1] 1454 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,3,4,5,] 1455 return CSI 1456 print siteSym[0],OpText,SSOptext 1457 UniqAx = {'a':'a','b':'b','c':'g'} 1458 if SGData['SGLaue'] == '2/m': 1459 if UniqAx[SGData['SGUniq']] in SSGData['modSymb']: #e.g. (0b0) 1460 if 's' in SSGData['SSpGrp'].split('(')[1]: 1461 if siteSym == 'm': 1462 CSI['Spos'][0] = [0,-1,1, -1,1,-1] 1463 CSI['Sadp'][0] = [0,1,2,-1,3,-1, -1,-1,-1,4,-1,5] 1464 elif siteSym == '2/m': 1465 CSI['Spos'][0] = [0,-1,1, -1,-1,-1] 1466 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,0,-1,1] 1467 elif siteSym == '2': 1468 CSI['Spos'][0] = [0,-1,1, 2,-1,3] 1469 CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3] 1470 elif '1/2' in SSGData['modSymb']: #e.g. (0b1/2) 1471 if siteSym == 'm': 1472 CSI['Spos'][0] = [-1,-1,-1, -1,-1,-1] 1473 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1] 1474 elif siteSym == '2/m': 1475 CSI['Spos'][0] = [0,-1,1, -1,-1,-1] 1476 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1] 1477 elif siteSym == '2': 1478 CSI['Spos'][0] = [0,-1,1, 2,-1,3] 1479 CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3] 1480 else: 1481 if siteSym == 'm': 1482 CSI['Spos'][0] = [-1,0,-1, 1,-1,2] 1483 CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, 2,3,4,-1,5,-1] 1484 elif siteSym == '2/m': 1485 CSI['Spos'][0] = [-1,0,-1, -1,-1,-1] 1486 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1] 1487 elif siteSym == '2': 1488 CSI['Spos'][0] = [-1,0,-1, -1,1,-1] 1489 CSI['Sadp'][0] = [0,1,2,-1,3,-1, 4,5,6,-1,7,-1] 1490 1491 else: #e.g. (a0g) 1492 if 's' in SSGData['SSpGrp'].split('(')[1]: 1493 if siteSym == 'm': 1494 CSI['Spos'][0] = [-1,0,-1, -1,1,-1] 1495 CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, -1,-1,-1,2,-1,3] 1496 elif siteSym == '2/m': 1497 CSI['Spos'][0] = [-1,0,-1, -1,-1,-1] 1498 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, -1,-1,-1,0,-1,1] 1499 elif siteSym == '2': 1500 CSI['Spos'][0] = [-1,0,-1, 1,-1,2] 1501 CSI['Sadp'][0] = [0,1,2,-1,3,-1, -1,-1,-1,4,-1,5] 1502 else: 1503 if siteSym == 'm': 1504 CSI['Spos'][0] = [0,-1,1, 2,-1,3] 1505 CSI['Sadp'][0] = [0,1,2,-1,3,-1, 4,5,6,-1,7,-1] 1506 elif siteSym == '2/m': 1507 CSI['Spos'][0] = [0,-1,1, -1,-1,-1] 1508 CSI['Sadp'][0] = [-1,-1,-1,-1,-1,-1, 0,1,2,-1,3,-1] 1509 elif siteSym == '2': 1510 CSI['Spos'][0] = [0,-1,1, -1,2,-1] 1511 CSI['Sadp'][0] = [-1,-1,-1,0,-1,1, 2,3,4,-1,5,-1] 1512 Sx = CSI['Spos'][0] 1513 Su = CSI['Sadp'][0] 1514 if SGData['SGUniq'] == 'a': 1515 CSI['Spos'][0] = [Sx[1],Sx[2],Sx[0], Sx[4],Sx[5],Sx[3]] 1516 CSI['Sadp'][0] = [Su[1],Sx[2],Sx[0],Su[4],Su[5],Su[3], Su[7],Su[8],Su[6],Su[10],Su[11],Su[9]] 1517 elif SGData['SGUniq'] == 'c': 1518 CSI['Spos'][0] = [Sx[2],Sx[0],Sx[1], Sx[5],Sx[3],Sx[4]] 1519 CSI['Sadp'][0] = [Su[2],Su[0],Su[1],Su[5],Su[3],Su[4], Su[8],Su[6],Su[7],Su[11],Su[9],Su[10]] 1520 # return CSI 1521 # elif SGData['SGLaue'] == 'mmm': 1522 # elif SGData['SGLaue'] in ['4/m','4/mmm']: 1523 # elif SGData['SGLaue'] in ['3','3m1','31m']: 1524 # elif SGData['SGLaue'] in ['6/m','6/mmm']: 1525 # 1526 xsin = np.zeros(3) 1527 xcos = np.zeros(3) 1528 usin = np.zeros(6) 1529 ucos = np.zeros(6) 1530 for i,idelt in enumerate(deltx): 1531 nxyz = (np.inner(sop[0],(xyz+idelt))+sop[1])%1. 1532 xcos[i] = np.allclose((xyz+idelt)%1.,nxyz,1.e-6) 1533 xsin[i] = np.allclose((xyz-idelt)%1.,nxyz,1.e-6) 1534 print CSI['Spos'][0] 1535 print xsin,xcos 1536 for i,idelt in enumerate(deltu): 1537 nuij = U2Uij(np.inner(sop[0],np.inner(Uij2U(uij+idelt),sop[0]))) 1538 ucos[i] = np.allclose((uij+idelt),nuij,1.e-6) 1539 usin[i] = np.allclose((uij-idelt),nuij,1.e-6) 1540 print CSI['Sadp'][0] 1541 print usin,ucos 1542 return CSI 1402 1543 1403 1544 def MustrainNames(SGData): … … 1904 2045 #monoclinic - done 1905 2046 #3 1906 'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','( 1/2b0)s','(0b1/2)','(0b1/2)s',],2047 'P 2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)',], 1907 2048 #4 1908 'P 21':['(a0g)','(0b0)','( 0b0)s','(1/2b0)','(1/2b0)s','(0b1/2)','(0b1/2)s',],2049 'P 21':['(a0g)','(0b0)','(1/2b0)','(0b1/2)',], 1909 2050 #5 1910 'C 2':['(a0g)','(0b0)','(0b0)s','(0b1/2)', '(0b1/2)s',],2051 'C 2':['(a0g)','(0b0)','(0b0)s','(0b1/2)',], 1911 2052 #6 1912 'P m':['(a0g)','(a0g)s','(a1/2g)','( a1/2g)s','(0b0)','(1/2b0)','(0b1/2)',],2053 'P m':['(a0g)','(a0g)s','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)',], 1913 2054 #7 1914 'P a':['(a0g)','(a 0g)s','(a1/2g)','(a1/2g)s','(0b0)','(0b1/2)',],1915 'P c':['(a0g)','(a 0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b0)',],1916 'P n':['(a0g)','(a 0g)s','(a1/2g)','(a1/2g)s','(0b0)','(1/2b1/2)',],2055 'P a':['(a0g)','(a1/2g)','(0b0)','(0b1/2)',], 2056 'P c':['(a0g)','(a1/2g)','(0b0)','(1/2b0)',], 2057 'P n':['(a0g)','(a1/2g)','(0b0)','(1/2b1/2)',], 1917 2058 #8 1918 2059 'C m':['(a0g)','(a0g)s','(0b0)','(0b1/2)',], … … 1921 2062 'C n':['(a0g)','(a0g)s','(0b0)',], 1922 2063 #10 1923 'P 2/m':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s', 1924 '(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0','(0b1/2)','(0b1/2)s0',], 2064 'P 2/m':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b0)','(0b1/2)',], 1925 2065 #11 1926 'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0', 1927 '(1/2b0)','(1/2b0)s0','(0b1/2)','(0b1/2)s0'], 2066 'P 21/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(1/2b0)','(0b1/2)',], 1928 2067 #12 1929 'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)', '(0b1/2)s0',],2068 'C 2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)',], 1930 2069 #13 1931 'P 2/c':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s', 1932 '(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0',], 1933 'P 2/a':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s', 1934 '(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',], 1935 'P 2/n':['(a0g)','(a0g)0s','(a1/2g)','(a1/2g)0s', 1936 '(0b0)','(0b0)s0','(1/2b1/2)','(1/2b1/2)s0',], 2070 'P 2/c':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b0)',], 2071 'P 2/a':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(0b1/2)',], 2072 'P 2/n':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b1/2)',], 1937 2073 #14 1938 'P 21/c':['(a0g)','( a0g)0s','(0b0)','(0b0)s0','(1/2b0)','(1/2b0)s0',],1939 'P 21/a':['(a0g)','( a0g)0s','(0b0)','(0b0)s0','(0b1/2)','(0b1/2)s0',],1940 'P 21/n':['(a0g)','( a0g)0s','(0b0)','(0b0)s0','(1/2b1/2)','(1/2b1/2)s0',],2074 'P 21/c':['(a0g)','(0b0)','(1/2b0)',], 2075 'P 21/a':['(a0g)','(0b0)','(0b1/2)',], 2076 'P 21/n':['(a0g)','(0b0)','(1/2b1/2)',], 1941 2077 #15 1942 'C 2/c':['(a0g)','( a0g)0s','(0b0)','(0b0)s0',],1943 'C 2/n':['(a0g)','( a0g)0s','(0b0)','(0b0)s0',],2078 'C 2/c':['(a0g)','(0b0)','(0b0)s0',], 2079 'C 2/n':['(a0g)','(0b0)','(0b0)s0',], 1944 2080 #orthorhombic 1945 2081 #16
Note: See TracChangeset
for help on using the changeset viewer.