Changeset 2470
- Timestamp:
- Sep 16, 2016 2:40:22 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r2430 r2470 255 255 if atom[cia] == 'A': 256 256 atom[cia+2:cia+8] = TransformU6(atom[cia+2:cia+8],invTrans) 257 atom[cs:cs+2] = G2spc.SytSym(atom[cx:cx+3],SGData) 257 atom[cs:cs+2] = G2spc.SytSym(atom[cx:cx+3],SGData)[:2] 258 258 atom[cia+8] = ran.randint(0,sys.maxint) 259 259 newPhase['Atoms'] = newAtoms -
trunk/GSASIIphsGUI.py
r2468 r2470 444 444 for atom in Atoms: 445 445 XYZ = atom[cx:cx+3] 446 Sytsym,Mult = G2spc.SytSym(XYZ,SGData) 446 Sytsym,Mult = G2spc.SytSym(XYZ,SGData)[:2] 447 447 atom[cx+4] = Sytsym 448 448 atom[cx+5] = Mult … … 1483 1483 Mulcol = colLabels.index('mult') 1484 1484 E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp']) 1485 Sytsym,Mult = G2spc.SytSym(XYZ,SGData) 1485 Sytsym,Mult = G2spc.SytSym(XYZ,SGData)[:2] 1486 1486 atomData[r][SScol] = Sytsym 1487 1487 atomData[r][Mulcol] = Mult … … 1679 1679 Atoms.SetCellTextColour(row,cj,VERY_LIGHT_GREY) 1680 1680 if colM: 1681 CSI = G2spc.GetCSpqinel(atomData[row][colSS]) 1681 SytSym,Mul,Nop = G2spc.SytSym(atomData[row][colX:colX+3],SGData) 1682 if SpnFlp[Nop] > 0.: #black 1683 CSI = G2spc.GetCSpqinel(SytSym)[0] 1684 else: #red 1685 CSI = G2spc.GetCSpqinel(SytSym)[1] 1682 1686 for i in range(3): 1683 1687 ci = i+colM 1684 1688 Atoms.SetCellStyle(row,ci,VERY_LIGHT_GREY,True) 1685 if CSI[0] and CSI[0][1][i]: 1689 Atoms.SetCellTextColour(row,ci,VERY_LIGHT_GREY) 1690 if CSI and CSI[1][i]: 1686 1691 Atoms.SetCellStyle(row,ci,WHITE,False) 1692 Atoms.SetCellTextColour(row,ci,BLACK) 1693 1687 1694 if 'X' in rbExcl: 1688 1695 for c in range(0,colX+3): … … 1779 1786 atId = ran.randint(0,sys.maxint) 1780 1787 E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp']) 1781 Sytsym,Mult = G2spc.SytSym([x,y,z],SGData) 1788 Sytsym,Mult = G2spc.SytSym([x,y,z],SGData)[:2] 1782 1789 if generalData['Type'] == 'macromolecular': 1783 1790 atomData.append([0,Name,'',Name,El,'',x,y,z,1.,Sytsym,Mult,'I',0.10,0,0,0,0,0,0,atId]) … … 2014 2021 Ncol = Atoms.GetNumberCols() 2015 2022 E,SGData = G2spc.SpcGroup(generalData['SGData']['SpGrp']) 2016 Sytsym,Mult = G2spc.SytSym([x,y,z],SGData) 2023 Sytsym,Mult = G2spc.SytSym([x,y,z],SGData)[:2] 2017 2024 atId = ran.randint(0,sys.maxint) 2018 2025 if generalData['Type'] == 'macromolecular': … … 2209 2216 atom = atomData[ind] 2210 2217 atom[cx:cx+3] = XYZ 2211 atom[css:css+2] = G2spc.SytSym(XYZ,SGData) 2218 atom[css:css+2] = G2spc.SytSym(XYZ,SGData)[:2] 2212 2219 if atom[cuia] == 'A': 2213 2220 Uij = atom[cuij:cuij+6] … … 2271 2278 # if np.all(XYZ>=0.) and np.all(XYZ<1.0): 2272 2279 # atomData[ind][cx:cx+3] = XYZ 2273 ## atom[css:css+2] = G2spc.SytSym(XYZ,SGData) 2280 ## atom[css:css+2] = G2spc.SytSym(XYZ,SGData)[:2] 2274 2281 # break 2275 2282 finally: … … 4208 4215 cx,ct,cs,ci = data['Drawing']['atomPtrs'] 4209 4216 cuij = cs+5 4217 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4210 4218 cmx = 0 4211 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())]4212 4219 if 'Mx' in colLabels: 4213 4220 cmx = colLabels.index('Mx') … … 4234 4241 atom = copy.copy(atomB) 4235 4242 atom[cx:cx+3] = item[0] 4243 Opr = abs(item[2])%100 4244 Cent = abs(item[2]/100) 4245 M = SGData['SGOps'][Opr-1][0] 4246 if cmx: 4247 opNum = G2spc.GetOpNum(item[2],SGData) 4248 atom[cmx:cmx+3] = np.inner(M,np.array(atom[cmx:cmx+3])) 4236 4249 atom[cs-1] = str(item[2])+'+' 4237 4250 atom[cuij:cuij+6] = item[1] … … 4306 4319 4307 4320 def FillCoordSphere(event): 4321 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4308 4322 generalData = data['General'] 4309 4323 Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7]) … … 4322 4336 cx,ct,cs,ci = data['Drawing']['atomPtrs'] 4323 4337 cij = ci+2 4324 generalData = data['General'] 4338 cmx = 0 4339 if 'Mx' in colLabels: 4340 cmx = colLabels.index('Mx') 4325 4341 SGData = generalData['SGData'] 4342 SpnFlp = SGData.get('SpnFlp',[]) 4326 4343 cellArray = G2lat.CellBlock(1) 4327 4344 wx.BeginBusyCursor() … … 4339 4356 if 0 < dist <= data['Drawing']['radiusFactor']*sumR: 4340 4357 if noDuplicate(xyz,atomData): 4341 oprB = atomB[c x+3]4358 oprB = atomB[cs-1] 4342 4359 C = xyz-xyzB 4343 4360 newOp = '1+'+str(int(round(C[0])))+','+str(int(round(C[1])))+','+str(int(round(C[2]))) 4344 4361 newAtom = atomB[:] 4345 4362 newAtom[cx:cx+3] = xyz 4363 OpN = int(oprB.split('+')[0]) 4364 Opr = abs(OpN)%100 4365 Cent = abs(OpN/100) 4366 M = SGData['SGOps'][Opr-1][0] 4367 if cmx: 4368 opNum = G2spc.GetOpNum(OpN,SGData) 4369 newAtom[cmx:cmx+3] = np.inner(M,np.array(newAtom[cmx:cmx+3])) 4346 4370 newAtom[cs-1] = G2spc.StringOpsProd(oprB,newOp,SGData) 4347 4371 atomData.append(newAtom[:cij+9]) #not SS stuff -
trunk/GSASIIplot.py
r2469 r2470 5213 5213 glEnable(GL_LIGHT0) 5214 5214 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0) 5215 glLightfv(GL_LIGHT0,GL_AMBIENT,[ 1,1,1,.8])5216 glLightfv(GL_LIGHT0,GL_DIFFUSE,[ 1,1,1,1])5217 glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1, .5])5215 glLightfv(GL_LIGHT0,GL_AMBIENT,[.5,.5,.5,1]) 5216 glLightfv(GL_LIGHT0,GL_DIFFUSE,[.8,.8,.8,1]) 5217 glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1,1]) 5218 5218 5219 5219 def GetRoll(newxy,rhoshape): … … 5477 5477 Dx = Moment/2. 5478 5478 Z = np.sqrt(np.sum(Dx**2)) 5479 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color)5480 glPushMatrix()5481 glTranslate(x,y,z)5482 glMultMatrixf(B4mat.T)5483 5479 if Z: 5480 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color) 5481 glPushMatrix() 5482 glTranslate(x,y,z) 5483 glMultMatrixf(B4mat.T) 5484 5484 glTranslate(-Dx[0],-Dx[1],-Dx[2]) 5485 5485 azm = atan2d(-Dx[1],-Dx[0]) … … 5489 5489 q = gluNewQuadric() 5490 5490 gluQuadricOrientation(q,GLU_INSIDE) 5491 gluDisk(q,0.,. 08,slice,1)5491 gluDisk(q,0.,.1,slice,1) 5492 5492 gluQuadricOrientation(q,GLU_OUTSIDE) 5493 gluCylinder(q,.1,.1,2.*Z,slice, 10)5494 glTranslate(0,0,2*Z +.02)5493 gluCylinder(q,.1,.1,2.*Z,slice,2) 5494 glTranslate(0,0,2*Z) 5495 5495 gluQuadricOrientation(q,GLU_INSIDE) 5496 gluDisk(q,.1 2,.18,slice,1)5496 gluDisk(q,.1,.2,slice,1) 5497 5497 gluQuadricOrientation(q,GLU_OUTSIDE) 5498 gluCylinder(q,.2,0.,.4,slice, 10)5499 glPopMatrix()5498 gluCylinder(q,.2,0.,.4,slice,2) 5499 glPopMatrix() 5500 5500 5501 5501 def RenderLines(x,y,z,Bonds,color): … … 5707 5707 except: #problem with old files - missing code 5708 5708 pass 5709 if generalData['Type'] == 'magnetic':5710 SymOp = int(atom[cs-1].split('+')[0])5711 OpNum = G2spc.GetOpNum(SymOp,SGData)-15712 Moment = np.array(atom[cx+3:cx+6])5713 color = Wt-Bc5714 if SpnFlp[OpNum] < 0:5715 color = Rd5716 RenderMoment(x,y,z,Moment,color)5717 5709 if 'balls' in atom[cs]: 5718 5710 vdwScale = drawingData['vdwScale'] … … 5771 5763 BackboneColor.append(list(atColor)) 5772 5764 5765 if generalData['Type'] == 'magnetic': 5766 SymOp = int(atom[cs-1].split('+')[0]) 5767 OpNum = G2spc.GetOpNum(SymOp,SGData)-1 5768 Moment = np.array(atom[cx+3:cx+6]) 5769 color = (Wt-Bc)/255. 5770 if SpnFlp[OpNum] < 0: 5771 color = Rd/255. 5772 RenderMoment(x,y,z,Moment,color) 5773 5773 5774 if atom[cs+1] == 'type': 5774 5775 RenderLabel(x,y,z,' '+atom[ct],radius,wxGreen,matRot) -
trunk/GSASIIspc.py
r2468 r2470 2584 2584 Isym = 1073741824 2585 2585 Jdup = 0 2586 Ndup = 0 2586 2587 Xeqv = GenAtom(XYZ,SGData,True) 2587 2588 IRT = PackRot(SGData['SGOps']) … … 2593 2594 L += 1 2594 2595 if not Xeqv[L][1]: 2596 Ndup = io 2595 2597 Jdup += 1 2596 2598 jx = GetOprPtrName(str(irtx)) … … 2600 2602 Mult = len(SGData['SGOps'])*len(SGData['SGCen'])*(int(SGData['SGInv'])+1)/Jdup 2601 2603 2602 return GetKNsym(str(Isym)),Mult 2604 return GetKNsym(str(Isym)),Mult,Ndup 2603 2605 2604 2606 def ElemPosition(SGData): … … 3735 3737 assert not E, msg 3736 3738 for t in crdlist: 3737 symb, m = SytSym(t[0],S)3739 symb, m, n = SytSym(t[0],S) 3738 3740 if symb.strip() != t[2].strip() or m != t[1]: 3739 print spc,t[0],m, symb,t[2]3741 print spc,t[0],m,n,symb,t[2] 3740 3742 assert m == t[1] 3741 3743 #assert symb.strip() == t[2].strip() -
trunk/imports/G2phase.py
r2468 r2470 129 129 XYZ = np.inner(AB,XYZ) 130 130 XYZ = np.where(abs(XYZ)<0.00001,0,XYZ) 131 SytSym,Mult = G2spc.SytSym(XYZ,SGData) 131 SytSym,Mult = G2spc.SytSym(XYZ,SGData)[:2] 132 132 Uiso = float(S[61:67])/EightPiSq 133 133 Type = S[12:14].lower() … … 295 295 float(S[108:118]),float(S[118:128])] 296 296 XYZ = Atom[3:6] 297 Atom[7],Atom[8] = G2spc.SytSym(XYZ,SGData) 297 Atom[7],Atom[8] = G2spc.SytSym(XYZ,SGData)[:2] 298 298 if Ptype == 'magnetic': 299 299 Atom = Atom[:7]+[0.,0.,0.]+Atom[7:] … … 312 312 float(S[8:16]),'1',1,'I',float(S[40:46]),0,0,0,0,0,0] 313 313 XYZ = Atom[6:9] 314 Atom[10],Atom[11] = G2spc.SytSym(XYZ,SGData) 314 Atom[10],Atom[11] = G2spc.SytSym(XYZ,SGData)[:2] 315 315 Atom.append(ran.randint(0,sys.maxint)) 316 316 Atoms.append(Atom) … … 483 483 Smag = [] 484 484 XYZ = [float(S1[27:36]),float(S1[36:45]),float(S1[45:54])] 485 SytSym,Mult = G2spc.SytSym(XYZ,SGData) 485 SytSym,Mult = G2spc.SytSym(XYZ,SGData)[:2] 486 486 aType = Atypes[int(S1[9:11])-1] 487 487 Name = S1[:8].strip() -
trunk/imports/G2phase_CIF.py
r2039 r2470 258 258 if col: 259 259 atomlist[col] = cif.get_number_with_esd(val)[0] 260 atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData) 260 atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2] 261 261 atomlist[1] = G2elem.FixValence(atomlist[1]) 262 262 self.Phase['Atoms'].append(atomlist) -
trunk/imports/G2phase_INS.py
r2289 r2470 124 124 XYZ = np.array([float(x),float(y),float(z)]) 125 125 XYZ = np.where(np.abs(XYZ)<0.00001,0,XYZ) 126 SytSym,Mult = G2spc.SytSym(XYZ,SGData) 126 SytSym,Mult = G2spc.SytSym(XYZ,SGData)[:2] 127 127 if '=' not in S: 128 128 IA = 'I'
Note: See TracChangeset
for help on using the changeset viewer.