Changeset 3219
- Timestamp:
- Jan 11, 2018 2:27:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3216 r3219 891 891 psub = self.GPXtree.AppendItem(parent=sub,text=PhaseName) 892 892 self.GPXtree.SetItemPyData(psub,rd.MPhase) 893 except AttributeError:893 except (AttributeError,TypeError): 894 894 pass 895 895 self.GPXtree.Expand(self.root) # make sure phases are seen -
trunk/GSASIImath.py
r3215 r3219 1613 1613 ''' 1614 1614 generalData = data['General'] 1615 cell = generalData['Cell'][1:7] 1616 ABC = np.array(cell[:3]) 1617 G,g = G2lat.cell2Gmat(cell) 1615 1618 SGData = generalData['SGData'] 1616 1619 SSGData = generalData['SSGData'] … … 1635 1638 for ind in indx: 1636 1639 drawatom = drawAtoms[ind] 1637 dratxyz = np.array(drawatom[dcx:dcx+3])1638 1640 opr = drawatom[dcs-1] 1639 sop,ssop,icent = G2spc.OpsfromStringOps(opr,SGData,SSGData) 1640 sdet,ssdet,dtau,dT,tauT = G2spc.getTauT(tau,sop,ssop,dratxyz,modul) 1641 sop,ssop,icent,cent,unit = G2spc.OpsfromStringOps(opr,SGData,SSGData) 1642 drxyz = (np.inner(sop[0],atxyz)+sop[1])*icent+cent+np.array(unit) 1643 sdet,ssdet,dtau,dT,tauT = G2spc.getTauT(tau,sop,ssop,drxyz,modul) 1641 1644 tauT *= icent #invert wave on -1 1642 1645 wave = np.zeros(3) -
trunk/GSASIIphsGUI.py
r3215 r3219 87 87 if len(Cents) > 1: 88 88 cents = text[-1].split(';') 89 lentable = len(self.table) 89 90 for line in text: 90 91 mainSizer.Add(wx.StaticText(self.panel,label=' %s '%(line)),0,WACV) … … 103 104 tableSizer = wx.FlexGridSizer(0,2*ncol+3,0,0) 104 105 Red = True 106 lentable //= 2 105 107 j = 0 106 108 continue … … 116 118 tableSizer.Add(text,0,WACV) 117 119 text = wx.StaticText(self.panel,label=' (%s) '%(self.names[j])) 118 if self.spins[j+ic*len (self.table)] < 0 or Red:120 if self.spins[j+ic*lentable] < 0 or Red: 119 121 text.SetForegroundColour('Red') 120 122 tableSizer.Add(text,0,WACV) … … 1155 1157 generalData['AtomPtrs'] = [3,1,10,12] 1156 1158 if generalData['Modulated']: 1159 if 'SGGray' not in generalData['SGData']: 1160 generalData['SGData']['SGGray'] = False 1157 1161 generalData['Modulated'] = True 1158 1162 if 'Super' not in generalData: 1159 1163 generalData['Super'] = 1 1160 generalData['SuperVec'] = [[0 ,0,.1],False,4]1164 generalData['SuperVec'] = [[0.,0.,0.],False,4] 1161 1165 generalData['SSGData'] = {} 1162 1166 if '4DmapData' not in generalData: … … 1339 1343 wx.CallAfter(UpdateGeneral) 1340 1344 elif generalData['Type'] == 'magnetic': 1345 generalData['AtomPtrs'] = [3,1,10,12] 1341 1346 SGData = generalData['SGData'] 1342 1347 Nops = len(SGData['SGOps'])*len(SGData['SGCen']) … … 1468 1473 if 'Super' not in generalData: 1469 1474 generalData['Super'] = 1 1470 generalData['SuperVec'] = [[0 ,0,.1],False,4]1475 generalData['SuperVec'] = [[0.,0.,0.],False,4] 1471 1476 generalData['SSGData'] = {} 1472 1477 if '4DmapData' not in generalData: … … 1757 1762 text[0] = ' Magnetic Space Group: '+SGData['MagSpGrp'] 1758 1763 text[3] = ' The magnetic lattice point group is '+SGData['MagPtGp'] 1759 if SGData['SGGray'] :1764 if SGData['SGGray'] and "1'" not in text[0]: 1760 1765 text[0] += " 1'" 1761 1766 text[3] += "1'" … … 1765 1770 Indx = {} 1766 1771 MagSym = SGData['MagSpGrp'] 1767 if SGData['SGGray'] :1772 if SGData['SGGray'] and "1'" not in MagSym: 1768 1773 MagSym += " 1'" 1769 1774 magSizer = wx.BoxSizer(wx.VERTICAL) … … 1806 1811 def OnSuperGp(event): #for HKLF needs to reject SSgps not agreeing with modVec! 1807 1812 event.Skip() 1808 SSymbol = superGp.GetValue() 1809 E,SSGData = G2spc.SSpcGroup(generalData['SGData'],SSymbol) 1813 try: 1814 SSymbol = superGp.GetValue() 1815 except AttributeError: 1816 SSymbol = superGp.GetLabel() 1817 SSGData = generalData['SSGData'] 1818 if not generalData['SGData']['SGFixed']: 1819 E,SSGData = G2spc.SSpcGroup(generalData['SGData'],SSymbol) 1810 1820 if SSGData: 1811 1821 Vec = generalData['SuperVec'][0] #(3+1) only … … 1836 1846 modSizer = wx.BoxSizer(wx.HORIZONTAL) 1837 1847 modSizer.Add(wx.StaticText(General,label=' '+name.capitalize()+' structure controls: '),0,WACV) 1838 modSizer.Add(wx.StaticText(General,label=' Superspace group: %s '%generalData['SGData']['SpGrp']),0,WACV) 1848 SpGrp = generalData['SGData']['SpGrp'] 1849 if generalData['SGData']['SGGray']: 1850 SpGrp += " 1'" 1851 modSizer.Add(wx.StaticText(General,label=' Superspace group: %s '%SpGrp),0,WACV) 1839 1852 SSGptgp = generalData['SGData']['SGLatt']+generalData['SGData']['SGPtGrp'] 1840 1853 SSChoice = G2spc.ptssdict.get(SSGptgp,[]) 1854 if generalData['SGData']['SGGray']: 1855 SSChoice = [item+'s' for item in SSChoice] 1841 1856 Choice = [] 1842 for item in SSChoice: 1843 if generalData['SGData'].get('SGGray',False): 1844 E,SSG = G2spc.SSpcGroup(generalData['SGData'],item+'s') 1845 else: 1857 if not generalData['SGData']['SGFixed']: 1858 for item in SSChoice: 1846 1859 E,SSG = G2spc.SSpcGroup(generalData['SGData'],item) 1847 if SSG: Choice.append(item)1848 if SSChoice:1860 if SSG: Choice.append(item) 1861 if len(Choice): 1849 1862 superGp = wx.ComboBox(General,value=generalData['SuperSg'],choices=Choice,style=wx.CB_DROPDOWN|wx.TE_PROCESS_ENTER) 1850 1863 superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp) 1851 1864 superGp.Bind(wx.EVT_COMBOBOX,OnSuperGp) 1852 else: #nonstandard space group symbol not in my dictionary 1853 superGp = wx.TextCtrl(General,value=generalData['SuperSg'],style=wx.TE_PROCESS_ENTER) 1854 superGp.Bind(wx.EVT_TEXT_ENTER,OnSuperGp) 1865 else: 1866 superGp = wx.StaticText(General,label=generalData['SuperSg']) 1855 1867 modSizer.Add(superGp,0,WACV) 1856 1868 modSizer.Add((5,5),0) … … 2205 2217 G2frame.dataWindow.GeneralCalc.Enable(G2G.wxID_MULTIMCSA,False) 2206 2218 G2frame.dataWindow.GeneralCalc.Enable(G2G.wxID_4DCHARGEFLIP,True) 2207 mainSizer.Add(ModulatedSizer(generalData['Type'] ))2219 mainSizer.Add(ModulatedSizer(generalData['Type']+' modulated')) 2208 2220 G2G.HorizontalLine(mainSizer,General) 2209 2221 else: … … 2300 2312 if r < 0: #double click on col label! Change all atoms! 2301 2313 noSkip = True 2314 parms = '' 2302 2315 if Atoms.GetColLabelValue(c) == 'refine': 2303 2316 Type = generalData['Type'] … … 2381 2394 elif Atoms.GetColLabelValue(c) == 'Uiso': #this needs to ask for value 2382 2395 pass #& then change all 'I' atoms 2396 else: 2397 return 2383 2398 if noSkip: 2384 2399 ui = colLabels.index('U11') … … 2993 3008 mom = np.array(atom[7:10]) 2994 3009 Mom = G2spc.ApplyStringOpsMom(opr,SGData,mom) 2995 atomInfo = oldatom[:5]+list(Mom)+oldatom[8:] 3010 if atom[12] == 'A': 3011 X,U = G2spc.ApplyStringOps(opr,SGData,atom[3:6],atom[14:20]) 3012 atomInfo = [atom[:2]+list(X)+list(Mom)+oldatom[8:12]+atom[12:14]+list(U)+oldatom[20:]][0] 3013 else: 3014 X = G2spc.ApplyStringOps(opr,SGData,atom[3:6]) 3015 atomInfo = [atom[:2]+list(X)+list(Mom)+oldatom[8:12]+atom[12:]+oldatom[20:]][0] 2996 3016 else: 2997 3017 atomInfo = [atom[:2]+atom[3:6]+atom[7:10]+['1',]+['vdW balls',]+ … … 5233 5253 XYZ = np.array(atomData[ind][cx:cx+3]) 5234 5254 XYZ = np.inner(M,XYZ)+T 5235 if Inv :5255 if Inv and not SGData['SGFixed']: 5236 5256 XYZ = -XYZ 5237 5257 XYZ = XYZ+cent+Cell … … 5348 5368 XYZ = np.array(atomData[ind][cx:cx+3]) 5349 5369 XYZ = np.inner(M,XYZ)+T 5350 if Inv :5370 if Inv and not SGData['SGFixed']: 5351 5371 XYZ = -XYZ 5352 5372 XYZ = XYZ+cent+Cell -
trunk/GSASIIplot.py
r3215 r3219 5718 5718 generalData = data['General'] 5719 5719 cell = generalData['Cell'][1:7] 5720 ABC = np.array(cell[ 1:4])5720 ABC = np.array(cell[0:3]) 5721 5721 Vol = generalData['Cell'][7:8][0] 5722 5722 Amat,Bmat = G2lat.cell2AB(cell) #Amat - crystal to cartesian, Bmat - inverse … … 5815 5815 raise Exception("PIL/pillow Image module not found") 5816 5816 projFile = G2frame.GSASprojectfile 5817 Fname = (os.path.splitext(projFile)[0]+'.'+mode).replace('*','+') 5817 if projFile: 5818 Fname = (os.path.splitext(projFile)[0]+'.'+mode).replace('*','+') 5819 else: 5820 dlg = wx.FileDialog(G2frame, 'Choose graphics save file', 5821 wildcard='Graphics file (*.'+mode+')|*.'+mode,style=wx.FD_OPEN| wx.CHANGE_DIR) 5822 try: 5823 if dlg.ShowModal() == wx.ID_OK: 5824 Fname = dlg.GetPath() 5825 finally: 5826 dlg.Destroy() 5818 5827 size = Page.canvas.GetSize() 5819 5828 GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1) … … 5917 5926 G2frame.tau = 0. 5918 5927 for i in range(100): 5919 G2frame.tau += 0. 15928 G2frame.tau += 0.02 5920 5929 G2frame.tau %= 1. 5921 5930 G2frame.G2plotNB.status.SetStatusText('Modulation tau = %.2f'%(G2frame.tau),1) … … 5946 5955 G2frame.tau = 0. 5947 5956 elif key in ['+','=']: 5948 G2frame.tau += 0. 15957 G2frame.tau += 0.05 5949 5958 elif key == '-': 5950 G2frame.tau -= 0. 15959 G2frame.tau -= 0.05 5951 5960 G2frame.tau %= 1. #force 0-1 range; makes loop 5952 5961 G2frame.G2plotNB.status.SetStatusText('Modulation tau = %.2f'%(G2frame.tau),1) -
trunk/GSASIIspc.py
r3215 r3219 968 968 XYZ = {'x':[1,0,0],'-x':[-1,0,0],'y':[0,1,0],'-y':[0,-1,0],'z':[0,0,1],'-z':[0,0,-1], 969 969 'x-y':[1,-1,0],'-x+y':[-1,1,0],} 970 # TRA = {'+1/2':0.5,'+1/4':.25,'+3/4':.75,'+1/3':1./3.,'+2/3':2./3.,'+1/6':1./6.,'+5/6':5./6.,971 # '+1/9'}972 970 ops = mcifOpr.split(",") 973 971 M = [] … … 984 982 spnflp = 1 985 983 if '-1' in ops[3]: 984 spnflp = -1 985 return np.array(M),np.array(T),spnflp 986 987 def MagSSText2MTS(mcifOpr): 988 "From magnetic super space group cif text returns matrix/translation + spin flip" 989 XYZ = {'x1':[1,0,0,0],'-x1':[-1,0,0,0],'x2':[0,1,0,0],'-x2':[0,-1,0,0],'x3':[0,0,1,0],'-x3':[0,0,-1,0], 990 'x1-x2':[1,-1,0,0],'-x1+x2':[-1,1,0,0],'x4':[0,0,0,1],'-x4':[0,0,0,-1], 991 '-x1+x4':[-1,0,0,1],'-x2+x4':[0,-1,0,1]} 992 ops = mcifOpr.split(",") 993 M = [] 994 T = [] 995 for op in ops[:4]: 996 ip = len(op) 997 if '/' in op: 998 ip = op.index('/')-2 999 T.append(eval(op[ip:])) 1000 else: 1001 T.append(0.) 1002 M.append(XYZ[op[:ip]]) 1003 spnflp = 1 1004 if '-1' in ops[4]: 986 1005 spnflp = -1 987 1006 return np.array(M),np.array(T),spnflp … … 1033 1052 opNum = abs(Opr)%100 1034 1053 cent = abs(Opr)//100 1035 if Opr < 0 :1054 if Opr < 0 and not SGData['SGFixed']: 1036 1055 opNum += Nops 1037 1056 if SGData['SGInv'] and not SGData['SGFixed']: … … 1388 1407 gensym = 'ss0' 1389 1408 return gensym 1390 1391 def checkGen(gensym): 1392 ''' 1393 GenSymList = ['','s','0s','s0', '00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q', '0qq', 1394 'q','qqs','s0s0','00ss','s00s','t','t00','t0','h','h00','000s',] 1395 ''' 1396 sym = ''.join(gensym) 1397 if SGData['SGGray'] and sym in ['s','0s','00s','000s','0000s']: 1398 return True 1399 if SGData.get('SGGray',False): 1400 if sym and sym[-1] == 's': 1401 sym = sym[:-1] 1402 if sym == '': 1403 return True 1404 else: 1405 sym += 's' 1406 return True 1407 # monoclinic - all done 1408 if str(SSGKl) == '[-1]' and sym == 's': 1409 return False 1410 elif SGData['SGPtGrp'] in ['2/m',]: 1411 if str(SSGKl) == '[-1, 1]' and sym == '0s': 1412 return False 1413 elif str(SSGKl) == '[1, -1]' and sym == 's0': 1414 return False 1415 #orthorhombic - all 1416 elif SGData['SGPtGrp'] in ['222',] and sym not in ['','s00','0s0','00s']: 1417 return False 1418 elif SGData['SGPtGrp'] in ['2mm','m2m','mm2','mmm'] and sym not in ['',]+GenSymList[4:16]: 1419 return False 1420 #tetragonal - all done 1421 elif SGData['SGPtGrp'] in ['4',] and sym not in ['','s','q']: 1422 return False 1423 elif SGData['SGPtGrp'] in ['-4',] and sym not in ['',]: 1424 return False 1425 elif SGData['SGPtGrp'] in ['4/m',] and sym not in ['','s0','q0']: 1426 return False 1427 elif SGData['SGPtGrp'] in ['422',] and sym not in ['','q00','s00']: 1428 return False 1429 elif SGData['SGPtGrp'] in ['4mm',] and sym not in ['','ss0','s0s','0ss','00s','qq0','qqs']: 1430 return False 1431 elif SGData['SGPtGrp'] in ['-4m2',] and sym not in ['','0s0','0q0']: 1432 return False 1433 elif SGData['SGPtGrp'] in ['-42m',] and sym not in ['','0ss','00q',]: 1434 return False 1435 elif SGData['SGPtGrp'] in ['4/mmm',] and sym not in ['','s00s','s0s0','00ss','000s',]: 1436 return False 1437 #trigonal/rhombohedral - all done 1438 elif SGData['SGPtGrp'] in ['3',] and sym not in ['','t']: 1439 return False 1440 elif SGData['SGPtGrp'] in ['-3',] and sym not in ['',]: 1441 return False 1442 elif SGData['SGPtGrp'] in ['32',] and sym not in ['','t0']: 1443 return False 1444 elif SGData['SGPtGrp'] in ['321','312'] and sym not in ['','t00']: 1445 return False 1446 elif SGData['SGPtGrp'] in ['3m','-3m'] and sym not in ['','0s']: 1447 return False 1448 elif SGData['SGPtGrp'] in ['3m1','-3m1'] and sym not in ['','0s0']: 1449 return False 1450 elif SGData['SGPtGrp'] in ['31m','-31m'] and sym not in ['','00s']: 1451 return False 1452 #hexagonal - all done 1453 elif SGData['SGPtGrp'] in ['6',] and sym not in ['','s','h','t']: 1454 return False 1455 elif SGData['SGPtGrp'] in ['-6',] and sym not in ['',]: 1456 return False 1457 elif SGData['SGPtGrp'] in ['6/m',] and sym not in ['','s0']: 1458 return False 1459 elif SGData['SGPtGrp'] in ['622',] and sym not in ['','h00','t00','s00']: 1460 return False 1461 elif SGData['SGPtGrp'] in ['6mm',] and sym not in ['','ss0','s0s','0ss']: 1462 return False 1463 elif SGData['SGPtGrp'] in ['-6m2',] and sym not in ['','0s0']: 1464 return False 1465 elif SGData['SGPtGrp'] in ['-62m',] and sym not in ['','00s']: 1466 return False 1467 elif SGData['SGPtGrp'] in ['6/mmm',] and sym not in ['','s00s','s0s0','00ss']: 1468 return False 1469 return True 1470 1409 1471 1410 LaueModList = [ 1472 1411 'abg','ab0','ab1/2','a0g','a1/2g', '0bg','1/2bg','a00','a01/2','a1/20', … … 1504 1443 if len(gensym) and Ngen != len(SSGKl): 1505 1444 return 'Wrong number of items in generator symbol '+''.join(gensym),None 1506 # if not checkGen(gensym):1507 # return 'Generator '+''.join(gensym)+' not consistent with space group '+SGData['SpGrp'],None1508 1445 gensym = specialGen(gensym[:Ngen],modsym) 1509 1446 genQ = [Fracs[mod] for mod in gensym[:Ngen]] … … 1512 1449 SSGData = {'SSpGrp':SGData['SpGrp']+SSymbol,'modQ':modQ,'modSymb':modsym,'SSGKl':SSGKl} 1513 1450 SSCen = np.zeros((len(SGData['SGCen']),4)) 1514 for icen,cen in enumerate(SGData['SGCen']): 1515 SSCen[icen,0:3] = cen 1516 SSCen[0] = np.zeros(4) 1451 if SGData['SGFixed']: 1452 for icen,cen in enumerate(SGData['SGCen']): 1453 SSCen[icen] = cen 1454 else: 1455 for icen,cen in enumerate(SGData['SGCen']): 1456 SSCen[icen,0:3] = cen 1457 SSCen[0] = np.zeros(4) 1517 1458 SSGData['SSGCen'] = SSCen 1518 1459 SSGData['SSGOps'] = [] … … 1520 1461 T = np.zeros(4) 1521 1462 ssop = np.zeros((4,4)) 1522 ssop[:3,:3] = op[0] 1523 T[:3] = op[1] 1463 if SGData['SGFixed']: 1464 ssop = op[0] 1465 T = op[1] 1466 else: 1467 ssop[:3,:3] = op[0] 1468 T[:3] = op[1] 1524 1469 SSGData['SSGOps'].append([ssop,T]) 1525 1470 E,Result = genSSGOps() … … 1632 1577 modQ = [Fracs[mod] for mod in modSymb] 1633 1578 if newMod: 1634 newVec = [0.1 if (vec == 0.0 and mod in ['a','b','g']) else vec for [vec,mod] in zip(Vec,modSymb)] 1579 newVec = Vec 1580 if not np.any(Vec): 1581 newVec = [0.1 if (vec == 0.0 and mod in ['a','b','g']) else vec for [vec,mod] in zip(Vec,modSymb)] 1635 1582 return [Q if mod not in ['a','b','g'] and vec != Q else vec for [vec,mod,Q] in zip(newVec,modSymb,modQ)], \ 1636 1583 [True if mod in ['a','b','g'] else False for mod in modSymb] … … 1780 1727 U = np.inner(M,np.inner(U,M).T) 1781 1728 newUij = U2Uij(U) 1782 if invers :1729 if invers and not SGData['SGFixed']: 1783 1730 XT = -XT 1784 1731 XT += C … … 2167 2114 2168 2115 def getTauT(tau,sop,ssop,XYZ,wave=np.zeros(3)): 2169 phase = 2.*np.pi*np.sum(XYZ*wave)2116 phase = 4.*np.pi*np.sum(XYZ*wave) 2170 2117 ssopinv = nl.inv(ssop[0]) 2171 2118 mst = ssopinv[3][:3] … … 2190 2137 Ax[0] = abs(Ax[0]) 2191 2138 nA = Ax[0]%100-1 2192 return SGOps[nA],SSGOps[nA],iC 2139 nC = Ax[0]//100 2140 unit = [0,0,0] 2141 if len(Ax) > 1: 2142 unit = eval('['+Ax[1]+']') 2143 return SGOps[nA],SSGOps[nA],iC,SGData['SGCen'][nC],unit 2193 2144 2194 2145 def GetSSfxuinel(waveType,nH,XYZ,SGData,SSGData,debug=False): … … 3139 3090 'P -6 2 c','P 6/m m m','P 6/m c c','P 63/m c m','P 63/m m c',), 3140 3091 'Pm3m': ('P 2 3','P 21 3','P m 3','P n 3','P a 3','P 4 3 2','P 42 3 2', 3141 'P 43 3 2','P 41 3 2','P -4 3 m','P -4 3 n','P m 3 m','P n 3 n',3092 'P 43 3 2','P 41 3 2','P -4 3 m','P -4 3 n','P m 3 m','P m -3 m','P n 3 n', 3142 3093 'P m 3 n','P n 3 m','P n -3 n','P n -3 m','P m -3 n',), 3143 3094 'Im3m':('I 2 3','I 21 3','I m -3','I a -3', 'I 4 3 2','I 41 3 2', -
trunk/GSASIIstrMath.py
r3157 r3219 3133 3133 #?? 3134 3134 Dij = GetDij(phfx,SGData,parmDict) 3135 A = [parmDict[pfx+'A%d'%(i)]+Dij[i] for i in range(6)] 3135 A = [parmDict[pfx+'A%d'%(i)]+Dij[i] for i in range(6)] #TODO: need to do someting if Dij << 0. 3136 3136 G,g = G2lat.A2Gmat(A) #recip & real metric tensors 3137 3137 if np.any(np.diag(G)<0.) or np.any(np.isnan(A)): -
trunk/imports/G2phase_CIF.py
r3215 r3219 239 239 SGData = G2obj.P1SGData # P 1 240 240 self.Phase['General']['SGData'] = SGData 241 242 if magnetic and not Super:243 SGData['SGFixed'] = True244 try:245 sgoploop = blk.GetLoop('_space_group_symop_magn.id')246 sgcenloop = blk.GetLoop('_space_group_symop_magn_centering.id')247 opid = sgoploop.GetItemPosition('_space_group_symop_magn_operation.xyz')[1]248 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_centering.xyz')[1]249 except KeyError: #old mag cif names250 sgoploop = blk.GetLoop('_space_group_symop.magn_id')251 sgcenloop = blk.GetLoop('_space_group_symop.magn_centering_id')252 opid = sgoploop.GetItemPosition('_space_group_symop.magn_operation_xyz')[1]253 centid = sgcenloop.GetItemPosition('_space_group_symop.magn_centering_xyz')[1]254 SGData['SGOps'] = []255 SGData['SGCen'] = []256 spnflp = []257 for op in sgoploop:258 M,T,S = G2spc.MagText2MTS(op[opid])259 SGData['SGOps'].append([np.array(M,dtype=float),T])260 spnflp.append(S)261 censpn = []262 for cent in sgcenloop:263 M,C,S = G2spc.MagText2MTS(cent[centid])264 SGData['SGCen'].append(C)265 censpn += list(np.array(spnflp)*S)266 self.MPhase['General']['SGData'] = SGData267 self.MPhase['General']['SGData']['SpnFlp'] = censpn268 self.MPhase['General']['SGData']['MagSpGrp'] = MSpGrp269 MagPtGp = blk.get('_space_group.magn_point_group')270 if not MagPtGp:271 MagPtGp = blk.get('_space_group_magn.point_group_name')272 self.MPhase['General']['SGData']['MagPtGp'] = MagPtGp273 # GenSym,GenFlg = G2spc.GetGenSym(SGData)274 # self.MPhase['General']['SGData']['GenSym'] = GenSym275 # self.MPhase['General']['SGData']['GenFlg'] = GenFlg276 277 241 if Super: 278 242 E,SSGData = G2spc.SSpcGroup(SGData,SuperSg) … … 288 252 # self.MPhase['General']['SGData']['SpnFlp'] = censpn 289 253 self.MPhase['General']['SGData']['MagSpGrp'] = MSSpGrp.replace(',','').replace('\\','') 290 self.MPhase['General']['SGData']['MagPtGp'] = blk.get('_space_group.magn_point_group') 254 # self.MPhase['General']['SGData']['MagPtGp'] = blk.get('_space_group.magn_point_group') 255 # if not self.MPhase['General']['SGData']['MagPtGp']: 256 # self.MPhase['General']['SGData']['MagPtGp'] = blk.get('_space_group.magn_point_group_name') 291 257 self.MPhase['General']['SSGData'] = SSGData 292 258 # GenSym,GenFlg = G2spc.GetGenSym(SGData) 293 259 # self.MPhase['General']['SGData']['GenSym'] = GenSym 294 260 # self.MPhase['General']['SGData']['GenFlg'] = GenFlg 261 262 if magnetic: #replace std operaors with those from cif file - probably not the same! 263 SGData['SGFixed'] = True 264 SGData['SGOps'] = [] 265 SGData['SGCen'] = [] 266 if Super: 267 SSGData['SSGOps'] = [] 268 SSGData['SSGCen'] = [] 269 try: 270 sgoploop = blk.GetLoop('_space_group_symop_magn_ssg_operation.id') 271 sgcenloop = blk.GetLoop('_space_group_symop_magn_ssg_centering.id') 272 opid = sgoploop.GetItemPosition('_space_group_symop_magn_ssg_operation.algebraic')[1] 273 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_ssg_centering.algebraic')[1] 274 except KeyError: #old mag cif names 275 sgoploop = blk.GetLoop('_space_group_symop.magn_ssg_id') 276 sgcenloop = blk.GetLoop('_space_group_symop.magn_ssg_centering_id') 277 opid = sgoploop.GetItemPosition('_space_group_symop.magn_ssg_operation_algebraic')[1] 278 centid = sgcenloop.GetItemPosition('_space_group_symop.magn_ssg_centering_algebraic')[1] 279 spnflp = [] 280 for op in sgoploop: 281 M,T,S = G2spc.MagSSText2MTS(op[opid]) 282 SSGData['SSGOps'].append([np.array(M,dtype=float),T]) 283 SGData['SGOps'].append([np.array(M,dtype=float)[:3,:3],T[:3]]) 284 spnflp.append(S) 285 censpn = [] 286 for cent in sgcenloop: 287 M,C,S = G2spc.MagSSText2MTS(cent[centid]) 288 SSGData['SSGCen'].append(C) 289 if not C[3]: 290 SGData['SGCen'].append(C[:3]) 291 censpn += list(np.array(spnflp)*S) 292 self.MPhase['General']['SSGData'] = SSGData 293 else: 294 try: 295 sgoploop = blk.GetLoop('_space_group_symop_magn.id') 296 sgcenloop = blk.GetLoop('_space_group_symop_magn_centering.id') 297 opid = sgoploop.GetItemPosition('_space_group_symop_magn_operation.xyz')[1] 298 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_centering.xyz')[1] 299 except KeyError: #old mag cif names 300 sgoploop = blk.GetLoop('_space_group_symop.magn_id') 301 sgcenloop = blk.GetLoop('_space_group_symop.magn_centering_id') 302 opid = sgoploop.GetItemPosition('_space_group_symop.magn_operation_xyz')[1] 303 centid = sgcenloop.GetItemPosition('_space_group_symop.magn_centering_xyz')[1] 304 spnflp = [] 305 for op in sgoploop: 306 M,T,S = G2spc.MagText2MTS(op[opid]) 307 SGData['SGOps'].append([np.array(M,dtype=float),T]) 308 spnflp.append(S) 309 censpn = [] 310 for cent in sgcenloop: 311 M,C,S = G2spc.MagText2MTS(cent[centid]) 312 SGData['SGCen'].append(C) 313 censpn += list(np.array(spnflp)*S) 314 self.MPhase['General']['SGData'] = SGData 315 self.MPhase['General']['SGData']['SpnFlp'] = censpn 316 self.MPhase['General']['SGData']['MagSpGrp'] = MSpGrp 317 MagPtGp = blk.get('_space_group.magn_point_group') 318 if not MagPtGp: 319 MagPtGp = blk.get('_space_group.magn_point_group_name') 320 if not MagPtGp: 321 MagPtGp = blk.get('_space_group_magn.point_group_name') 322 self.MPhase['General']['SGData']['MagPtGp'] = MagPtGp 323 295 324 296 325 … … 532 561 self.MPhase['General']['SuperVec'] = SuperVec 533 562 self.MPhase['General']['SuperSg'] = SuperSg 534 self.MPhase['General']['SSGData'] = G2spc.SSpcGroup(SGData,SuperSg)[1]535 563 else: 536 564 self.MPhase = None … … 539 567 self.Phase['General']['SuperVec'] = SuperVec 540 568 self.Phase['General']['SuperSg'] = SuperSg 541 self.Phase['General']['SSGData'] = G2spc.SSpcGroup(SGData,SuperSg)[1] 569 if not self.Phase['General']['SGData']['SGFixed']: 570 self.Phase['General']['SSGData'] = G2spc.SSpcGroup(SGData,SuperSg)[1] 542 571 if not self.isodistort_warnings: 543 572 if blk.get('_iso_displacivemode_label') or blk.get('_iso_occupancymode_label'):
Note: See TracChangeset
for help on using the changeset viewer.