Changeset 5464
- Timestamp:
- Jan 3, 2023 2:38:18 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ElementTable.py
r5433 r5464 122 122 (["Va",], 13.5,7.5, "Vacancy", White, 0.000,(255,255,255)), 123 123 (["Q",], 14.5,7.5, "Special form factor", REcolor, 0.000,(161,54,212)), 124 (["Qa",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)),125 (["Qb",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)),126 (["Qc",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)),127 (["Qd",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)),124 # (["Qa",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)), 125 # (["Qb",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)), 126 # (["Qc",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)), 127 # (["Qd",], -1,-1, "Special form factor", REcolor, 0.000,(161,54,212)), 128 128 (["None",], 15.5,7.5, "No element choice",REcolor, 0.000,(161,54,212)), 129 129 ] -
trunk/GSASIIElem.py
r5460 r5464 252 252 Elements = [elem[0][0] for elem in Elem] 253 253 AtomInfo = {} 254 if 'Q' in El: El = 'Q' #patch - remove Qa, etc. 254 255 ElS = getElSym(El) 255 256 if El not in atmdata.XrayFF and El not in atmdata.MagFF: … … 729 730 landeg.append(2.0) 730 731 if 'Q' in atom[ct]: 732 atom[ct] = 'Q' #patch - remove 'QA', etc. 731 733 for Srb in RBModels.get('Spin',[]): 732 734 if Srb['Ids'][0] != atom[cia+8]: -
trunk/GSASIIconstrGUI.py
r5453 r5464 3027 3027 radius = 1.0 3028 3028 atType = 'C' 3029 rbType = 'Q a'3029 rbType = 'Q' 3030 3030 Natoms = 1 3031 3031 name = 'UNKRB' … … 3437 3437 for ibod,spinID in enumerate(data['Spin']): 3438 3438 bodSizer.Add(G2G.ValidatedTxtCtrl(SpinRBDisplay,data['Spin'][spinID],'RBname')) 3439 choices = ['Q','Qa','Qb','Qc','Qd'] 3440 typeSel = wx.ComboBox(SpinRBDisplay,choices=choices,value=data['Spin'][spinID]['rbType'], 3441 style=wx.CB_READONLY|wx.CB_DROPDOWN) 3442 typeSel.Bind(wx.EVT_COMBOBOX,OnTypeSel) 3443 Indx[typeSel.GetId()] = spinID 3444 bodSizer.Add(typeSel,0) 3439 bodSizer.Add(wx.StaticText(SpinRBDisplay,label='Q'),0) 3440 data['Spin'][spinID]['rbType'] = 'Q' #patch 3441 # choices = ['Q','Qa','Qb','Qc','Qd'] 3442 # typeSel = wx.ComboBox(SpinRBDisplay,choices=choices,value=data['Spin'][spinID]['rbType'], 3443 # style=wx.CB_READONLY|wx.CB_DROPDOWN) 3444 # typeSel.Bind(wx.EVT_COMBOBOX,OnTypeSel) 3445 # Indx[typeSel.GetId()] = spinID 3446 # bodSizer.Add(typeSel,0) 3445 3447 symchoice = ['53m','m3m','-43m','6/mmm','-6m2','-3m','4/mmm','-42m','mmm','2/m','-1','1'] 3446 3448 data['Spin'][spinID]['RBsym'] = data['Spin'][spinID].get('RBsym','53m') -
trunk/GSASIImath.py
r5453 r5464 5665 5665 5666 5666 ################################################################################ 5667 #### Quaternion stuff5667 #### Quaternion & other geometry stuff 5668 5668 ################################################################################ 5669 5670 def Cart2Polar(X,Y,Z): 5671 ''' convert Cartesian to polar coordinates 5672 ''' 5673 5674 R = np.sqrt(X**2+Y**2+Z**2) 5675 Pl = acosd(Z/R) 5676 Az = atan2d(Y,X) 5677 return R,Az,Pl 5678 5679 def Polar2Cart(R,Az,Pl): 5680 '''Convert polar to Cartesian coordinates 5681 ''' 5682 5683 X = R*sind(Pl)*cosd(Az) 5684 Y = R*sind(Pl)*sind(Az) 5685 Z = R*cosd(Pl) 5686 return Y,-X,Z 5687 5688 def RotPolbyQ(R,Az,Pl,Q): 5689 '''Rotate polar coordinates by quaternion 5690 ''' 5691 X,Y,Z = Polar2Cart(R,Az,Pl) 5692 XYZ = np.vstack((X,Y,Z)).T 5693 nXYZ = prodQVQ(Q,XYZ).T 5694 return(Cart2Polar(nXYZ[0],nXYZ[1],nXYZ[2])) 5669 5695 5670 5696 def prodQQ(QA,QB): -
trunk/GSASIIphsGUI.py
r5460 r5464 9836 9836 Opp = G2spc.Opposite(item[0]) 9837 9837 for key in Opp: 9838 if noDuplicate(Opp[key],atomData) :9838 if noDuplicate(Opp[key],atomData) or atom[ct] == 'Q': 9839 9839 unit = item[3]+np.array(eval(key))*1. 9840 9840 cell = '%d+%d,%d,%d'%(item[2],unit[0],unit[1],unit[2]) -
trunk/GSASIIplot.py
r5463 r5464 9796 9796 GL.glShadeModel(GL.GL_SMOOTH) 9797 9797 9798 def RenderTextureSphere(x,y,z,radius, Qmat,color,shape=[20,10],Fade=None):9798 def RenderTextureSphere(x,y,z,radius,color,shape=[20,10],Fade=None): 9799 9799 SpFade = np.zeros(list(Fade.shape)+[4,],dtype=np.dtype('B')) 9800 9800 SpFade[:,:,:3] = Fade[:,:,nxs]*list(color) … … 9821 9821 GL.glTranslate(x,y,z) 9822 9822 GL.glMultMatrixf(B4mat.T) 9823 GL.glMultMatrixf(Qmat)9824 9823 GLU.gluSphere(q,radius,shape[0],shape[1]) 9825 9824 GL.glPopMatrix() … … 10300 10299 SpnData = G2mth.GetSpnRBData(SpnRB,atom[ci]) 10301 10300 try: 10302 N =SpnData['nSH'][0]10301 SpnData['nSH'][0] 10303 10302 except TypeError: 10304 10303 break … … 10307 10306 radius = SpnData['radius'] 10308 10307 atColor = SpnData['atColor'] 10309 Q = SpnData['Orient'][0] 10310 A,V = G2mth.Q2AVdeg(Q) 10311 QR,R = G2mth.make2Quat(V,np.array([0.,0.,1.0])) 10312 QA = G2mth.AVdeg2Q(A,np.array([0.,0.,1.0])) 10313 Q2 = G2mth.prodQQ(QA,QR) #correct - rotates about V axis 10314 Qmat = G2mth.Q2Mat(Q2) 10315 Q4mat = np.eye(4) 10316 Q4mat[:3,:3] = Qmat 10317 Npsi,Ngam = 120,60 10308 Q = G2mth.invQ(SpnData['Orient'][0]) 10309 Npsi,Ngam = 60,30 #seems acceptable - don't use smaller! 10318 10310 PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol] 10319 10311 PSI = PSI.flatten()*360./Npsi #azimuth 0-360 ncl 10320 10312 GAM = GAM.flatten()*180./Ngam #polar 0-180 incl 10313 Rp,PSIp,GAMp = G2mth.RotPolbyQ(np.ones_like(PSI),PSI,GAM,Q) 10321 10314 for ish,nSH in enumerate(SpnData['nSH']): 10322 10315 if nSH > 0: 10323 10316 SHC = SpnData['SHC'][ish] 10324 P = G2lat.SHarmcal(SytSym,SHC,PSI ,GAM).reshape((Npsi,Ngam))10317 P = G2lat.SHarmcal(SytSym,SHC,PSIp,GAMp).reshape((Npsi,Ngam)) 10325 10318 if np.min(P) < np.max(P): 10326 10319 P = (P-np.min(P))/(np.max(P)-np.min(P)) 10327 RenderTextureSphere(x,y,z,radius[ish][0], Q4mat,atColor[ish],shape=[Npsi,Ngam],Fade=P.T)10320 RenderTextureSphere(x,y,z,radius[ish][0],atColor[ish],shape=[Npsi,Ngam],Fade=P.T) 10328 10321 else: 10329 10322 RenderSphere(x,y,z,radius[ish][0],atColor[ish],fade,shape=[60,30]) -
trunk/atmdata.py
r5433 r5464 256 256 'Va': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}, 257 257 'Q': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}, 258 'Qa': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,},259 'Qb': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,},260 'Qc': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,},261 'Qd': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}258 # 'Qa': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}, 259 # 'Qb': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}, 260 # 'Qc': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,}, 261 # 'Qd': {'Z':0, 'fa':[ 0.0, 0.0, 0.0, 0.0,],'fb':[ 0.0, 0.0, 0.0, 0.0],'fc': 0.0,} 262 262 } 263 263 #electron form factor coefficients to stl=6.0; those as M+0 are 4 term values from SHELX: match the 5 term ones … … 471 471 'Va':[0.50, 0.50, 0.50, 0], 472 472 'Q': [0.50, 0.50, 0.50, 0], 473 'Qa':[0.50, 0.50, 0.50, 0],474 'Qb':[0.50, 0.50, 0.50, 0],475 'Qc':[0.50, 0.50, 0.50, 0],476 'Qd':[0.50, 0.50, 0.50, 0],473 # 'Qa':[0.50, 0.50, 0.50, 0], 474 # 'Qb':[0.50, 0.50, 0.50, 0], 475 # 'Qc':[0.50, 0.50, 0.50, 0], 476 # 'Qd':[0.50, 0.50, 0.50, 0], 477 477 } 478 478 # Bond valence coefficients for X-O, X-F & X-Cl Taken from Brese and O'Keefe, Acta Cryst B, 47, 192-197 (1991). … … 982 982 'Va_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 983 983 'Q_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 984 'Qa_': {'Mass':0.0,'SL':[0.0,0],'SA':0},985 'Qb_': {'Mass':0.0,'SL':[0.0,0],'SA':0},986 'Qc_': {'Mass':0.0,'SL':[0.0,0],'SA':0},987 'Qd_': {'Mass':0.0,'SL':[0.0,0],'SA':0},984 # 'Qa_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 985 # 'Qb_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 986 # 'Qc_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 987 # 'Qd_': {'Mass':0.0,'SL':[0.0,0],'SA':0}, 988 988 } 989 989 MagFF = {
Note: See TracChangeset
for help on using the changeset viewer.