Changeset 143 for trunk/GSASIIspc.py
 Timestamp:
 Aug 5, 2010 2:35:29 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIspc.py
r142 r143 117 117 returns a list of strings with the space group details 118 118 ''' 119 XYZ = ('Z ','Y ','X ','XY','ERR','YX',' X ',' Y ',' Z ','+X ','+Y ','+Z ')120 TRA = (' ','ERR','1/6','1/4','1/3','ERR','1/2','ERR','2/3','3/4','5/6','ERR')121 119 POL = (' ','x','y','x y','z','x z','y z','xyz','111') 122 120 Mult = len(SGData['SGCen'])*len(SGData['SGOps'])*(int(SGData['SGInv'])+1) … … 147 145 SGText.append('The location of the origin is arbitrary in '+POL[NPol]) 148 146 SGText.append('\n'+'The equivalent positions are:') 149 if SGData['SGLatt'] in 'A': 150 SGText.append('\n'+' (0,0,0; 0,1/2,1/2)+') 151 elif SGData['SGLatt'] in 'B': 152 SGText.append('\n'+' (0,0,0; 1/2,0,1/2)+') 153 elif SGData['SGLatt'] in 'C': 154 SGText.append('\n'+' (0,0,0; 1/2,1/2,0)+') 155 elif SGData['SGLatt'] in 'I': 156 SGText.append('\n'+' (0,0,0; 1/2,1/2,1/2)+') 157 elif SGData['SGLatt'] in 'F': 158 SGText.append('\n'+' (0,0,0; 0,1/2,1/2; 1/2,0,1/2; 1/2,1/2,0)+') 159 elif SGData['SGLatt'] in 'R': 160 SGText.append('\n'+' (0,0,0; 1/3,2/3,2/3; 2/3,1/3,1/3)+') 147 if SGData['SGLatt'] != 'P': 148 SGText.append('\n('+Latt2text(SGData['SGLatt'])+')+') 161 149 if SGData['SGLaue'] in ['1','2/m','mmm','4/m','4/mmm']: 162 150 Ncol = 2 … … 168 156 SGText.append(line) 169 157 line = '' 170 Fld = '(%2i) ' % (iop+1) 171 for j in range(3): 172 IJ = int(round(2*M[j][0]+3*M[j][1]+4*M[j][2]+4)) % 12 173 IK = int(round(T[j]*12)) % 12 174 if IK > 0 and IJ > 4: IJ += 3 175 Fld += TRA[IK]+XYZ[IJ] 176 if j != 2: Fld += ',' 158 Fld = '(%2i) ' % (iop+1)+MT2text(M,T)+'\t' 177 159 line += Fld 178 160 SGText.append(line) 179 161 return SGText 180 162 163 def MT2text(M,T): 164 #From space group matrix/translation operator returns text version 165 XYZ = ('Z ','Y ','X ','XY','ERR','YX',' X ',' Y ',' Z ','+X ','+Y ','+Z ') 166 TRA = (' ','ERR','1/6','1/4','1/3','ERR','1/2','ERR','2/3','3/4','5/6','ERR') 167 Fld = '' 168 for j in range(3): 169 IJ = int(round(2*M[j][0]+3*M[j][1]+4*M[j][2]+4)) % 12 170 IK = int(round(T[j]*12)) % 12 171 if IK > 0 and IJ > 4: IJ += 3 172 Fld += TRA[IK]+XYZ[IJ] 173 if j != 2: Fld += ',' 174 return Fld 175 176 def Latt2text(Latt): 177 #From lattice type ('P',A', etc.) returns ';' delimited cell centering vectors 178 lattTxt = {'A':'0,0,0; 0,1/2,1/2','B':'0,0,0; 1/2,0,1/2', 179 'C':'0,0,0; 1/2,1/2,0','I':'0,0,0; 1/2,1/2,1/2', 180 'F':'0,0,0; 0,1/2,1/2; 1/2,0,1/2; 1/2,1/2,0', 181 'R':'0,0,0; 1/3,2/3,2/3; 2/3,1/3,1/3','P':'0,0,0'} 182 return lattTxt[Latt] 183 181 184 def SpaceGroup(SgSym): 182 185 ''' … … 490 493 return GetKNsym(str(Isym)),Mult 491 494 495 def U2Uij(U): 496 #returns the UIJ vector U11,U22,U33,U12,U13,U23 from tensor U 497 return [U[0][0],U[1][1],U[2][2],U[0][1],U[0][2],U[1][2]] 498 499 def Uij2U(Uij): 500 #returns the thermal motion tensor U from Uij as numpy array 501 return np.array([[Uij[0],Uij[3],Uij[4]],[Uij[3],Uij[1],Uij[5]],[Uij[4],Uij[5],Uij[2]]]) 502 492 503 '''A list of space groups as ordered and named in the pre2002 International 493 504 Tables Volume A, except that spaces are used following the GSAS convention to
Note: See TracChangeset
for help on using the changeset viewer.