Changeset 2468
- Timestamp:
- Sep 15, 2016 2:03:04 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r2467 r2468 1069 1069 dmin = np.min(ring['ImtaCalc'][0]) 1070 1070 dmax = np.max(ring['ImtaCalc'][0]) 1071 ring['Dcalc'] = dmin+(dmax-dmin)/4. 1071 if abs(Eij[0]) < abs(Eij[2]): #tension 1072 ring['Dcalc'] = dmin+(dmax-dmin)/4. 1073 else: #compression 1074 ring['Dcalc'] = dmin+3.*(dmax-dmin)/4. 1072 1075 # ring['Dcalc'] = np.mean(ring['ImtaCalc'][0]) 1073 1076 -
trunk/GSASIIphsGUI.py
r2467 r2468 1683 1683 ci = i+colM 1684 1684 Atoms.SetCellStyle(row,ci,VERY_LIGHT_GREY,True) 1685 if CSI[0] and CSI[ 1][1][i]:1685 if CSI[0] and CSI[0][1][i]: 1686 1686 Atoms.SetCellStyle(row,ci,WHITE,False) 1687 1687 if 'X' in rbExcl: … … 1696 1696 generalData = data['General'] 1697 1697 SpnFlp = generalData['SGData'].get('SpnFlp',[]) 1698 print SpnFlp1699 1698 OprNames = generalData['SGData'].get('OprNames',[]) 1700 print OprNames1701 1699 atomData = data['Atoms'] 1702 1700 DData = data['Drawing'] … … 3982 3980 G2frame.dataFrame.SetStatusText('') 3983 3981 generalData = data['General'] 3982 SpnFlp = generalData['SGData'].get('SpnFlp',[]) 3984 3983 SetupDrawingData() 3985 3984 drawingData = data['Drawing'] … … 4156 4155 if indx: 4157 4156 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4158 cx = colLabels.index('x') 4159 cuia = colLabels.index('I/A') 4160 cuij = cuia+2 4157 cx,ct,cs,cui = data['Drawing']['atomPtrs'] 4158 cuij = cui+2 4159 cmx = 0 4160 if 'Mx' in colLabels: 4161 cmx = colLabels.index('Mx') 4161 4162 atomData = data['Drawing']['Atoms'] 4162 4163 generalData = data['General'] 4163 4164 SGData = generalData['SGData'] 4165 SpnFlp = SGData.get('SpnFlp',[]) 4164 4166 dlg = G2gd.SymOpDialog(G2frame,SGData,False,True) 4165 4167 try: … … 4180 4182 atom = copy.copy(atomData[ind]) 4181 4183 atom[cx:cx+3] = XYZ 4182 atomOp = atom[cx+3] 4183 newOp = str(((Opr+1)+100*Cent)*(1-2*Inv))+'+'+ \ 4184 atomOp = atom[cs-1] 4185 OprNum = ((Opr+1)+100*Cent)*(1-2*Inv) 4186 newOp = str(OprNum)+'+'+ \ 4184 4187 str(int(Cell[0]))+','+str(int(Cell[1]))+','+str(int(Cell[2])) 4185 atom[cx+3] = G2spc.StringOpsProd(atomOp,newOp,SGData) 4186 if atom[cuia] == 'A': 4188 atom[cs-1] = G2spc.StringOpsProd(atomOp,newOp,SGData) 4189 if cmx: 4190 opNum = G2spc.GetOpNum(OprNum,SGData) 4191 atom[cmx:cmx+3] = np.inner(M,np.array(atom[cmx:cmx+3])) 4192 if atom[cui] == 'A': 4187 4193 Uij = atom[cuij:cuij+6] 4188 4194 Uij = G2spc.U2Uij(np.inner(np.inner(M,G2spc.Uij2U(Uij)),M)) … … 4202 4208 cx,ct,cs,ci = data['Drawing']['atomPtrs'] 4203 4209 cuij = cs+5 4210 cmx = 0 4211 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4212 if 'Mx' in colLabels: 4213 cmx = colLabels.index('Mx') 4204 4214 generalData = data['General'] 4205 4215 SGData = generalData['SGData'] 4216 SpnFlp = SGData.get('SpnFlp',[]) 4206 4217 cellArray = G2lat.CellBlock(1) 4207 4218 indx = drawAtoms.GetSelectedRows() … … 4223 4234 atom = copy.copy(atomB) 4224 4235 atom[cx:cx+3] = item[0] 4225 atom[c x+3] = str(item[2])+'+'4236 atom[cs-1] = str(item[2])+'+' 4226 4237 atom[cuij:cuij+6] = item[1] 4227 4238 for xyz in cellArray+np.array(atom[cx:cx+3]): … … 4232 4243 newAtom = atom[:] 4233 4244 newAtom[cx:cx+3] = xyz 4234 newAtom[c x+3] += str(int(round(C[0])))+','+str(int(round(C[1])))+','+str(int(round(C[2])))4245 newAtom[cs-1] += str(int(round(C[0])))+','+str(int(round(C[1])))+','+str(int(round(C[2]))) 4235 4246 atomData.append(newAtom) 4236 4247 finally: … … 4246 4257 atomData = data['Drawing']['Atoms'] 4247 4258 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4248 cx = colLabels.index('x') 4249 cuia = colLabels.index('I/A') 4250 cuij = cuia+2 4259 cx,ct,cs,ci = data['Drawing']['atomPtrs'] 4260 cuij = ci+2 4261 cmx = 0 4262 if 'Mx' in colLabels: 4263 cmx = colLabels.index('Mx') 4251 4264 atomData = data['Drawing']['Atoms'] 4252 4265 generalData = data['General'] 4253 4266 SGData = generalData['SGData'] 4267 SpnFlp = SGData.get('SpnFlp',[]) 4254 4268 dlg = G2gd.SymOpDialog(G2frame,SGData,False,True) 4255 4269 try: … … 4270 4284 atom = atomData[ind] 4271 4285 atom[cx:cx+3] = XYZ 4272 atomOp = atom[cx+3] 4286 OprNum = ((Opr+1)+100*Cent)*(1-2*Inv) 4287 if cmx: 4288 opNum = G2spc.GetOpNum(OprNum,SGData) 4289 atom[cmx:cmx+3] = np.inner(M,np.array(atom[cmx:cmx+3])) 4290 atomOp = atom[cs-1] 4273 4291 newOp = str(((Opr+1)+100*Cent)*(1-2*Inv))+'+'+ \ 4274 4292 str(int(Cell[0]))+','+str(int(Cell[1]))+','+str(int(Cell[2])) 4275 atom[c x+3] = G2spc.StringOpsProd(atomOp,newOp,SGData)4276 if atom[c uia] == 'A':4293 atom[cs-1] = G2spc.StringOpsProd(atomOp,newOp,SGData) 4294 if atom[ci] == 'A': 4277 4295 Uij = atom[cuij:cuij+6] 4278 4296 U = G2spc.Uij2U(Uij) … … 4326 4344 newAtom = atomB[:] 4327 4345 newAtom[cx:cx+3] = xyz 4328 newAtom[c x+3] = G2spc.StringOpsProd(oprB,newOp,SGData)4346 newAtom[cs-1] = G2spc.StringOpsProd(oprB,newOp,SGData) 4329 4347 atomData.append(newAtom[:cij+9]) #not SS stuff 4330 4348 finally: … … 4341 4359 atomData = data['Drawing']['Atoms'] 4342 4360 colLabels = [drawAtoms.GetColLabelValue(c) for c in range(drawAtoms.GetNumberCols())] 4343 cx = colLabels.index('x') 4344 cs = colLabels.index('Sym Op') 4345 cuia = colLabels.index('I/A') 4346 cuij = cuia+2 4361 cx,ct,cs,cui = data['Drawing']['atomPtrs'] 4362 cmx = 0 4363 if 'Mx' in colLabels: 4364 cmx = colLabels.index('Mx') 4365 cuij = cui+2 4347 4366 generalData = data['General'] 4348 4367 SGData = generalData['SGData'] 4368 SpnFlp = SGData.get('SpnFlp',[]) 4349 4369 wx.BeginBusyCursor() 4350 4370 try: … … 4352 4372 atom = atomData[ind] 4353 4373 XYZ = np.array(atom[cx:cx+3]) 4354 if atom[cui a] == 'A':4374 if atom[cui] == 'A': 4355 4375 Uij = atom[cuij:cuij+6] 4356 4376 result = G2spc.GenAtom(XYZ,SGData,False,Uij,True) … … 4358 4378 atom = copy.copy(atomData[ind]) 4359 4379 atom[cx:cx+3] = item[0] 4360 atom[cs] = str(item[2])+'+' \ 4380 Opr = abs(item[2])%100 4381 Cent = abs(item[2]/100) 4382 M = SGData['SGOps'][Opr-1][0] 4383 if cmx: 4384 opNum = G2spc.GetOpNum(item[2],SGData) 4385 atom[cmx:cmx+3] = np.inner(SGData['SGOps'],np.array(atom[cmx:cmx+3])) 4386 atom[cs-1] = str(item[2])+'+' \ 4361 4387 +str(item[3][0])+','+str(item[3][1])+','+str(item[3][2]) 4362 4388 atom[cuij:cuij+6] = item[1] … … 4366 4392 unit = np.array(eval(key))*1.-item[3] 4367 4393 cell = '%d+%d,%d,%d'%(item[2],unit[0],unit[1],unit[2]) 4368 #transform moment here4369 4394 atom[cx:cx+3] = Opp[key] 4370 atom[cs ] = cell4395 atom[cs-1] = cell 4371 4396 atomData.append(atom[:cuij+9]) #not SS stuff 4372 4397 else: 4373 4398 result = G2spc.GenAtom(XYZ,SGData,False,Move=True) 4399 # GSASIIpath.IPyBreak() 4374 4400 for item in result: 4375 4401 atom = copy.copy(atomData[ind]) 4402 Opr = abs(item[1])%100 4403 Cent = abs(item[1]/100) 4404 M = SGData['SGOps'][Opr-1][0] 4376 4405 atom[cx:cx+3] = item[0] 4377 atom[cs] = str(item[1])+'+' \ 4406 if cmx: 4407 opNum = G2spc.GetOpNum(item[1],SGData) 4408 atom[cmx:cmx+3] = np.inner(np.array(atom[cmx:cmx+3]),M) 4409 atom[cs-1] = str(item[1])+'+' \ 4378 4410 +str(item[2][0])+','+str(item[2][1])+','+str(item[2][2]) 4379 4411 Opp = G2spc.Opposite(item[0]) … … 4383 4415 cell = '%d+%d,%d,%d'%(item[1],unit[0],unit[1],unit[2]) 4384 4416 atom[cx:cx+3] = Opp[key] 4385 #transform moment here 4386 atom[cs] = cell 4417 atom[cs-1] = cell 4387 4418 atomData.append(atom[:cuij+9]) #not SS stuff 4388 4419 data['Drawing']['Atoms'] = atomData -
trunk/GSASIIplot.py
r2467 r2468 4777 4777 if generalData['Modulated']: 4778 4778 SSGData = generalData['SSGData'] 4779 SpnFlp = SGData.get('SpnFlp',[]) 4779 4780 Mydir = generalData['Mydir'] 4780 4781 Super = generalData.get('Super',0) … … 5213 5214 glLightfv(GL_LIGHT0,GL_AMBIENT,[1,1,1,.8]) 5214 5215 glLightfv(GL_LIGHT0,GL_DIFFUSE,[1,1,1,1]) 5216 glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1,.5]) 5215 5217 5216 5218 def GetRoll(newxy,rhoshape): … … 5474 5476 Dx = Moment/2. 5475 5477 Z = np.sqrt(np.sum(Dx**2)) 5476 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color -Bc)5478 glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,color) 5477 5479 glPushMatrix() 5478 5480 glTranslate(x,y,z) … … 5486 5488 q = gluNewQuadric() 5487 5489 gluQuadricOrientation(q,GLU_INSIDE) 5488 gluDisk(q,0.,. 1,slice,1)5490 gluDisk(q,0.,.08,slice,1) 5489 5491 gluQuadricOrientation(q,GLU_OUTSIDE) 5490 5492 gluCylinder(q,.1,.1,2.*Z,slice,10) 5491 glTranslate(0,0,2*Z )5493 glTranslate(0,0,2*Z+.02) 5492 5494 gluQuadricOrientation(q,GLU_INSIDE) 5493 gluDisk(q,.1 ,.2,slice,1)5495 gluDisk(q,.12,.18,slice,1) 5494 5496 gluQuadricOrientation(q,GLU_OUTSIDE) 5495 5497 gluCylinder(q,.2,0.,.4,slice,10) … … 5705 5707 pass 5706 5708 if generalData['Type'] == 'magnetic': 5709 SymOp = int(atom[cs-1].split('+')[0]) 5710 OpNum = G2spc.GetOpNum(SymOp,SGData)-1 5707 5711 Moment = np.array(atom[cx+3:cx+6]) 5708 color = Wt 5712 color = Wt-Bc 5713 if SpnFlp[OpNum] < 0: 5714 color = Rd 5709 5715 RenderMoment(x,y,z,Moment,color) 5710 5716 if 'balls' in atom[cs]: -
trunk/GSASIIspc.py
r2467 r2468 922 922 return OprNames,SpnFlp 923 923 924 925 926 924 def GetOpNum(Opr,SGData): 925 Inv = SGData['SGInv'] 926 Nops = len(SGData['SGOps']) 927 opNum = abs(Opr)%100 928 if Opr < 0: 929 opNum += Nops 930 cent = abs(Opr)/100 931 opNum += cent*Nops*Inv 932 return opNum 927 933 928 934 ################################################################################ -
trunk/imports/G2phase.py
r2406 r2468 296 296 XYZ = Atom[3:6] 297 297 Atom[7],Atom[8] = G2spc.SytSym(XYZ,SGData) 298 if Ptype == 'magnetic': 299 Atom = Atom[:7]+[0.,0.,0.]+Atom[7:] 298 300 Atom.append(ran.randint(0,sys.maxint)) 299 301 Atoms.append(Atom) 300 302 elif key[11:] == 'M' and key[6:8] == 'AT': 301 303 S = EXPphase[key] 302 Mag = [float(S[:10]),float(S[10:20]),float(S[20:30])] 303 Atoms[-1] = Atoms[-1][:7]+Mag+Atoms[-1][7:] 304 Atoms[-1][7:10] = [float(S[:10]),float(S[10:20]),float(S[20:30])] 304 305 elif Ptype == 'macromolecular': 305 306 for key in keyList:
Note: See TracChangeset
for help on using the changeset viewer.