Changeset 3234 for trunk/GSASIIspc.py
 Timestamp:
 Jan 19, 2018 12:11:54 PM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIspc.py
r3227 r3234 1081 1081 """ 1082 1082 1083 def checkModSym():1084 '''1085 Checks to see if proposed modulation form is allowed for Laue group1086 '''1087 if LaueId in [0,] and LaueModId in [0,]:1088 return True1089 elif LaueId in [1,]:1090 try:1091 if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']):1092 return False1093 if 'I'.index(SGData['SGLatt']) and modsym.count('1/2') not in [0,2]:1094 return False1095 except ValueError:1096 pass1097 if SGData['SGUniq'] == 'a' and LaueModId in [5,6,7,8,9,10,]:1098 return True1099 elif SGData['SGUniq'] == 'b' and LaueModId in [3,4,13,14,15,16,]:1100 return True1101 elif SGData['SGUniq'] == 'c' and LaueModId in [1,2,19,20,21,22,]:1102 return True1103 elif LaueId in [2,] and LaueModId in [i+7 for i in range(18)]:1104 try:1105 if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']):1106 return False1107 if SGData['SGLatt'] in ['I','F',] and modsym.index('1/2'):1108 return False1109 except ValueError:1110 pass1111 return True1112 elif LaueId in [3,4,] and LaueModId in [19,22,]:1113 try:1114 if SGData['SGLatt'] == 'I' and modsym.count('1/2'):1115 return False1116 except ValueError:1117 pass1118 return True1119 elif LaueId in [7,8,9,] and LaueModId in [19,25,]:1120 if (SGData['SGLatt'] == 'R' or SGData['SGPtGrp'] in ['3m1','3m1']) and modsym.count('1/3'):1121 return False1122 return True1123 elif LaueId in [10,11,] and LaueModId in [19,]:1124 return True1125 return False1083 # def checkModSym(): 1084 # ''' 1085 # Checks to see if proposed modulation form is allowed for Laue group 1086 # ''' 1087 # if LaueId in [0,] and LaueModId in [0,]: 1088 # return True 1089 # elif LaueId in [1,]: 1090 # try: 1091 # if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']): 1092 # return False 1093 # if 'I'.index(SGData['SGLatt']) and modsym.count('1/2') not in [0,2]: 1094 # return False 1095 # except ValueError: 1096 # pass 1097 # if SGData['SGUniq'] == 'a' and LaueModId in [5,6,7,8,9,10,]: 1098 # return True 1099 # elif SGData['SGUniq'] == 'b' and LaueModId in [3,4,13,14,15,16,]: 1100 # return True 1101 # elif SGData['SGUniq'] == 'c' and LaueModId in [1,2,19,20,21,22,]: 1102 # return True 1103 # elif LaueId in [2,] and LaueModId in [i+7 for i in range(18)]: 1104 # try: 1105 # if modsym.index('1/2') != ['A','B','C'].index(SGData['SGLatt']): 1106 # return False 1107 # if SGData['SGLatt'] in ['I','F',] and modsym.index('1/2'): 1108 # return False 1109 # except ValueError: 1110 # pass 1111 # return True 1112 # elif LaueId in [3,4,] and LaueModId in [19,22,]: 1113 # try: 1114 # if SGData['SGLatt'] == 'I' and modsym.count('1/2'): 1115 # return False 1116 # except ValueError: 1117 # pass 1118 # return True 1119 # elif LaueId in [7,8,9,] and LaueModId in [19,25,]: 1120 # if (SGData['SGLatt'] == 'R' or SGData['SGPtGrp'] in ['3m1','3m1']) and modsym.count('1/3'): 1121 # return False 1122 # return True 1123 # elif LaueId in [10,11,] and LaueModId in [19,]: 1124 # return True 1125 # return False 1126 1126 1127 1127 def fixMonoOrtho(): … … 1409 1409 return gensym 1410 1410 1411 LaueModList = [1412 'abg','ab0','ab1/2','a0g','a1/2g', '0bg','1/2bg','a00','a01/2','a1/20',1413 'a1/21/2','a01','a10','0b0','0b1/2', '1/2b0','1/2b1/2','0b1','1b0','00g',1414 '01/2g','1/20g','1/21/2g','01g','10g', '1/31/3g']1415 LaueList = ['1','2/m','mmm','4/m','4/mmm','3R','3mR','3','3m1','31m','6/m','6/mmm','m3','m3m']1416 GenSymList = ['','s','0s','s0', '00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q', '0qq',1417 'q','qqs','s0s0','00ss','s00s','t','t00','t0','h','h00','000s','0000s']1411 # LaueModList = [ 1412 # 'abg','ab0','ab1/2','a0g','a1/2g', '0bg','1/2bg','a00','a01/2','a1/20', 1413 # 'a1/21/2','a01','a10','0b0','0b1/2', '1/2b0','1/2b1/2','0b1','1b0','00g', 1414 # '01/2g','1/20g','1/21/2g','01g','10g', '1/31/3g'] 1415 # LaueList = ['1','2/m','mmm','4/m','4/mmm','3R','3mR','3','3m1','31m','6/m','6/mmm','m3','m3m'] 1416 # GenSymList = ['','s','0s','s0', '00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q', '0qq', 1417 # 'q','qqs','s0s0','00ss','s00s','t','t00','t0','h','h00','000s','0000s'] 1418 1418 Fracs = {'1/2':0.5,'1/3':1./3,'1':1.0,'0':0.,'s':.5,'t':1./3,'q':.25,'h':1./6,'a':0.,'b':0.,'g':0.} 1419 LaueId = LaueList.index(SGData['SGLaue'])1419 # LaueId = LaueList.index(SGData['SGLaue']) 1420 1420 if SGData['SGLaue'] in ['m3','m3m']: 1421 1421 return '(3+1) superlattices not defined for cubic space groups',None … … 1426 1426 except ValueError: 1427 1427 return 'Error in superspace symbol '+SSymbol,None 1428 if ''.join(gensym) not in GenSymList:1429 if SGData['SGGray'] and ''.join(gensym[:1]) not in GenSymList:1430 return 'unknown generator symbol '+''.join(gensym),None1431 try:1432 LaueModId = LaueModList.index(''.join(modsym))1433 except ValueError:1434 return 'Unknown modulation symbol '+''.join(modsym),None1435 if not checkModSym():1436 return 'Modulation '+''.join(modsym)+' not consistent with space group '+SGData['SpGrp'],None1428 # if ''.join(gensym) not in GenSymList: 1429 # if SGData['SGGray'] and ''.join(gensym[:1]) not in GenSymList: 1430 # return 'unknown generator symbol '+''.join(gensym),None 1431 # try: 1432 # LaueModId = LaueModList.index(''.join(modsym)) 1433 # except ValueError: 1434 # return 'Unknown modulation symbol '+''.join(modsym),None 1435 # if not checkModSym(): 1436 # return 'Modulation '+''.join(modsym)+' not consistent with space group '+SGData['SpGrp'],None 1437 1437 modQ = [Fracs[mod] for mod in modsym] 1438 1438 SSGKl = SGData['SSGKl'][:] … … 1483 1483 else: 1484 1484 return Result+'\nOperator conflict  incorrect superspace symbol',None 1485 1486 def SSChoice(SGData): 1487 ''' 1488 Gets the unique set of possible super space groups for a given space group 1489 ''' 1490 laueSS = {'1':['(abg)',], 1491 '2/m':['(a0g)','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)'], 1492 'mmm':['(00g)','(1/20g)','(01/2g)','(1/21/2g)','(10g)','(01g)', 1493 '(a00)','(a1/20)','(a01/2)','(a1/21/2)','(a10)','(a01)', 1494 '(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)','(1b0)','(0b1)',], 1495 '4/m':['(00g)','(1/21/2g)'], 1496 '4/mmm':['(00g)','(1/21/2g)'], 1497 '3':['(00g)','(1/31/3g)'], 1498 '3m1':['(00g)'], 1499 '31m':['(00g)','(1/31/3g)'], 1500 '6/m':['(00g)',], 1501 '6/mmm':['(00g)',]} 1502 1503 laueTS = {'1':['',], 1504 '2/m':['','s','s0','0s','ss'], 1505 'mmm':['000','s00','0s0','00s','ss0','s0s','0ss','q00','0q0','00q','0qq','q0q','qq0'], 1506 '4/m':['','q','s','s0',], 1507 '4/mmm':['','q00','s00','ss0','0ss','s0s','qq0','qqs','0q0','s0s0','00ss','s00s'], 1508 '3':['','t'], 1509 '3m1':['','t0','0s','t00','0s0'], 1510 '31m':['','t00','0ss'], 1511 '6/m':['','h','t','s','s0'], 1512 '6/mmm':['h00','t00','s00','ss0','0ss','s0s','s0s0','00ss','s00s']} 1513 laue = SGData['SGLaue'] 1514 SSChoice = [] 1515 for ax in laueSS[laue]: 1516 for sx in laueTS[laue]: 1517 SSChoice.append(ax+sx) 1518 ssChoice = [] 1519 ssHash = [] 1520 for item in SSChoice: 1521 E,SSG = SSpcGroup(SGData,item) 1522 if SSG: 1523 sshash = hash(str(SSGPrint(SGData,SSG)[1])) 1524 if sshash not in ssHash: 1525 ssHash.append(sshash) 1526 ssChoice.append(item) 1527 return ssChoice 1528 1485 1529 1486 1530 def splitSSsym(SSymbol): … … 3114 3158 'CMME':'C m m a','AEMM':'A b m m','BMEM':'B m c m', 3115 3159 'CCCE':'C c c a','AEAA':'A b a a','BBEB':'B b c b'} 3116 ptssdict = {}3117 '''A dictionary of superspace group symbols allowed for each point group3118 (except cubics). Monoclinics are all bunique setting.3119 '''3120 ptssdict = {3121 #1,23122 'P1':['(abg)',],'C1':['(abg)',],3123 #3153124 'P2':['(a0g)','(a1/2g)','(0b0)','(0b0)s','(1/2b0)','(0b1/2)',],3125 'C2':['(a0g)','(0b0)','(0b0)s','(0b1/2)',],3126 'A2':['(a0g)','(0b0)','(0b0)s','(1/2b0)',],3127 'Pm':['(a0g)','(a0g)s','(a1/2g)','(0b0)','(1/2b0)','(0b1/2)','(1/2b1/2)',],3128 'Cm':['(a0g)','(a0g)s','(0b0)','(0b1/2)',],3129 'Am':['(a0g)','(a0g)s','(0b0)','(1/2b0)',],3130 'P2/m':['(a0g)','(a0g)0s','(a1/2g)','(0b0)','(0b0)s0','(1/2b0)','(0b1/2)','(1/2b1/2)',],3131 'C2/m':['(a0g)','(a0g)0s','(0b0)','(0b0)s0','(0b1/2)',],3132 'A2/m':['(a0g)','(a0g)s0','(0b0)','(0b0)0s','(1/2b0)',],3133 #16243134 'P222':['(00g)','(00g)00s','(01/2g)','(1/20g)','(1/21/2g)',3135 '(a00)','(a00)s00','(a01/2)','(a1/20)','(a1/21/2)',3136 '(0b0)','(0b0)0s0','(1/2b0)','(0b1/2)','(1/2b1/2)',],3137 'C222':['(00g)','(00g)00s','(10g)','(10g)00s','(01g)','(01g)00s',3138 '(a00)','(a00)s00','(a01/2)',3139 '(0b0)','(0b0)0s0','(0b1/2)',],3140 'A222':['(a00)','(a00)s00','(a10)','(a10)s00','(a01)','(a01)s00',3141 '(0b0)','(0b0)0s0','(1/2b0)',3142 '(00g)','(00g)00s','(1/20g)',],3143 'B222':['(0b0)','(0b0)0s0','(1b0)','(1b0)0s0','(0b1)','(0b1)0s0',3144 '(00g)','(00g)00s','(01/2g)',3145 '(a00)','(a00)s00','(a1/20)',],3146 'F222':['(00g)','(00g)00s','(10g)','(01g)',3147 '(a00)','(a00)s00','(a10)','(a01)',3148 '(0b0)','(0b0)0s0','(1b0)','(0b1)',],3149 'I222':['(00g)','(00g)00s',3150 '(a00)','(a00)s00',3151 '(0b0)','(0b0)0s0',],3152 #25463153 'Pmm2':['(00g)','(00g)s0s','(00g)0ss','(00g)ss0','(01/2g)','(01/2g)s0s','(1/20g)','(1/20g)0ss','(1/21/2g)','(1/2b1/2)00q',3154 '(a00)','(a00)0s0','(a1/20)','(a01/2)','(a01/2)0s0','(a1/21/2)','(1/21/2g)qq0',3155 '(0b0)','(0b0)s00','(0b1/2)','(0b1/2)s00','(1/2b0)','(1/2b1/2)','(1/2b1/2)q00',],3156 'P2mm':['(a00)','(a00)ss0','(a00)s0s','(a00)0ss','(a01/2)','(a01/2)ss0','(a1/20)','(a1/20)s0s','(a1/21/2)','(1/21/2g)q00',3157 '(0b0)','(0b0)00s','(1/2b0)','(0b1/2)','(0b1/2)00s','(1/2b1/2)','(a1/21/2)0qq',3158 '(00g)','(00g)0s0','(01/2g)','(01/2g)0s0','(1/20g)','(1/21/2g)','(1/21/2g)0q0',],3159 'Pm2m':['(0b0)','(0b0)ss0','(0b0)0ss','(0b0)s0s','(0b1/2)','(0b1/2)ss0','(1/2b0)','(1/2b0)0ss','(1/2b1/2)','(a1/21/2)0q0',3160 '(00g)','(00g)s00','(1/20g)','(01/2g)','(01/2g)s00','(1/21/2g)','(1/2b1/2)q0q',3161 '(a00)','(a00)0s0','(a01/2)','(a01/2)0s0','(a1/20)','(a1/21/2)','(a1/21/2)00q',],3162 'Cmm2':['(00g)','(00g)s0s','(00g)ss0',3163 '(10g)','(10g)s0s','(10g)ss0',3164 '(a00)','(a00)0s0','(a01/2)','(a01/2)0s0',3165 '(0b0)','(0b0)s00','(0b1/2)','(0b1/2)s00',],3166 'C2mm':['(0b0)','(0b0)00s','(0b1/2)',],3167 'Cm2m':['(0b0)','(0b0)0ss','(0b0)s0s','(0b0)ss0','(0b1/2)','(0b1/2)ss0',],3168 'A2mm':['(a00)','(a00)ss0','(a00)0ss','(a10)','(a10)ss0','(a10)0ss',3169 '(0b0)','(0b0)00s','(1/2b0)','(1/2b0)00s',3170 '(00g)','(00g)0s0','(1/20g)','(1/20g)0s0',],3171 'Am2m':['(00g)','(00g)s00','(1/20g)',],3172 'Amm2':['(00g)','(00g)s0s','(00g)ss0','(00g)0ss','(1/20g)','(1/20g)0ss',],3173 'Bm2m':['(0b0)','(0b0)0ss','(0b0)s0s','(0b1)','(0b1)0ss','(0b1)s0s',3174 '(a00)','(a00)00s','(a1/20)','(a1/20)00s',3175 '(00g)','(00g)s00','(01/2g)','(01/2g)s00',],3176 'B2mm':['(a00)','(a00)0ss','(a00)s0s','(a00)ss0','(a1/20)','(a1/20)s0s',],3177 'Bmm2':['(a00)','(a00)0s0','(a1/20)',],3178 'Fmm2':['(00g)','(00g)s0s','(00g)0ss','(00g)ss0','(10g)','(10g)ss0','(10g)s0s','(01g)','(01g)ss0','(01g)0ss',3179 '(a00)','(a00)0s0','(a01)','(a01)0s0',3180 '(0b0)','(0b0)s00','(0b1)','(0b1)s00',],3181 'F2mm':['(a00)','(a00)ss0','(a00)s0s','(a00)0ss','(a10)','(a10)0ss','(a10)ss0','(a01)','(a01)0ss','(a01)s0s',3182 '(0b0)','(0b0)00s','(1b0)','(1b0)00s',3183 '(00g)','(00g)0s0','(10g)','(10g)0s0',],3184 'Fm2m':['(0b0)','(0b0)0ss','(0b0)ss0','(0b0)s0s','(0b1)','(0b1)s0s','(0b1)0ss','(1b0)','(1b0)s0s','(1b0)ss0',3185 '(00g)','(00g)s00','(01g)','(01g)s00',3186 '(a00)','(a00)00s','(a10)','(a10)00s',],3187 'Imm2':['(00g)','(00g)ss0','(00g)s0s','(00g)0ss','(a00)','(a00)0s0','(0b0)','(0b0)s00',],3188 'I2mm':['(a00)','(00g)0ss','(00g)ss0','(00g)s0s','(0b0)','(0b0)00s','(00g)','(00g)0s0',],3189 'Im2m':['(0b0)','(0b0)s0s','(0b0)0ss','(0b0)ss0','(00g)','(00g)s00','(a00)','(a00)00s',],3190 #47743191 'Pmmm':['(00g)','(00g)s00','(00g)0s0','(00g)ss0','(01/2g)','(01/2g)s00','(01/2g)0s0','(01/2g)ss0',3192 '(1/20g)','(1/20g)0s0','(1/20g)s00','(1/20g)ss0','(1/21/2g)',3193 '(a00)','(a00)0s0','(a00)00s','(a00)0ss','(a01/2)','(a01/2)0s0','(a01/2)00s','(a01/2)0ss',3194 '(a1/20)','(a1/20)00s','(a1/20)0ss','(a1/20)0s0','(a1/21/2)',3195 '(0b0)','(0b0)s00','(0b0)00s','(0b0)s0s','(1/2b0)','(1/2b0)00s','(1/2b0)s00','(1/2b0)s0s',3196 '(0b1/2)','(0b1/2)s00','(0b1/2)00s','(0b1/2)s0s','(1/2b1/2)',],3197 'Cmmm':['(00g)','(00g)s00','(00g)ss0','(10g)','(10g)s00','(10g)ss0','(01g)','(01g)0s0','(01g)ss0',3198 '(a00)','(a00)00s','(a00)0ss','(a00)0s0','(a01/2)','(a01/2)0s0',3199 '(0b0)','(0b0)00s','(0b0)s0s','(0b0)s00','(0b1/2)','(0b1/2)s00',],3200 'Ammm':['(a00)','(a00)0s0','(a00)0ss','(a10)','(a10)0s0','(a10)0ss','(a01)','(a01)0s0','(a01)0ss',3201 '(0b0)','(0b0)00s','(0b0)s0s','(0b0)s00','(0b1/2)','(0b1/2)s00',3202 '(00g)','(00g)s00','(00g)ss0','(00g)0s0','(1/20g)','(1/20g)0s0',],3203 'Bmmm':['(0b0)','(0b0)00s','(0b0)s0s','(0b1)','(0b1)00s','(0b1)s0s','(1b0)','(1b0)00s','(1b0)s0s',3204 '(a00)','(a00)0s0','(a00)0ss','(a00)00s','(a1/20)','(a1/20)00s',3205 '(00g)','(00g)s00','(00g)ss0','(00g)0s0','(1/20g)','(1/20g)0s0',],3206 'Fmmm':['(00g)','(00g)s00','(00g)ss0','(10g)','(10g)s00','(10g)0s0','(10g)ss0','(01g)','(01g)s00','(01g)0s0','(01g)ss0',3207 '(a00)','(a00)0s0','(a00)0ss','(a10)','(a10)0s0','(a10)00s','(a10)0ss','(a01)','(a01)0s0','(a01)00s','(a01)0ss',3208 '(0b0)','(0b0)s00','(0b0)s0s','(0b1)','(0b1)s00','(0b1)00s','(0b1)s0s','(1b0)','(1b0)s00','(1b0)00s','(1b0)s0s'],3209 #75823210 'P4':['(00g)','(00g)q','(00g)s','(1/21/2g)','(1/21/2g)q',],3211 'I4':['(00g)','(00g)q','(00g)s',],3212 'P4':['(00g)','(1/21/2g)',],3213 'I4':['(00g)',],3214 #83893215 'P4/m':['(00g)','(00g)s0','(1/21/2g)',],3216 'I4/m':['(00g)','(00g)s0',],3217 #90983218 'P422':['(00g)','(00g)q00','(00g)s00','(1/21/2g)','(1/21/2g)q00',],3219 'I422':['(00g)','(00g)q00','(00g)s00',],3220 #991223221 'P4mm':['(00g)','(00g)ss0','(00g)0ss','(00g)s0s','(1/21/2g)','(1/21/2g)0ss','(1/21/2g)qq0','(1/21/2g)qqs',],3222 'I4mm':['(00g)','(00g)ss0','(00g)0ss','(00g)s0s',],3223 'P42m':['(00g)','(00g)0ss','(1/21/2g)','(1/21/2g)0ss',],3224 'P4m2':['(00g)','(00g)0s0','(1/21/2g)','(1/21/2g)0q0',],3225 'I4m2':['(00g)','(00g)0s0',],3226 'I42m':['(00g)','(00g)0ss',],3227 #1231423228 'P4/mmm':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',3229 '(1/21/2g)','(1/21/2g)s0s0','(1/21/2g)00ss','(1/21/2g)s00s',],3230 'I4/mmm':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],3231 #1431483232 'P 3':['(00g)','(00g)t','(1/31/3g)',],3233 'R3':['(00g)','(00g)t',],3234 'P3':['(00g)','(1/31/3g)',],3235 'R3':['(00g)',],3236 #1491613237 'P312':['(00g)','(00g)t00','(1/31/3g)',],3238 'P321':['(00g)','(00g)t00',],3239 'R32':['(00g)','(00g)t0',],3240 'P3m1':['(00g)','(00g)0s0',],3241 'P31m':['(00g)','(00g)00s','(1/31/3g)','(1/31/3g)00s',],3242 'R3m':['(00g)','(00g)0s',],3243 #1621673244 'P31m':['(00g)','(00g)00s','(1/31/3g)','(1/31/3g)00s',],3245 'P3m1':['(00g)','(00g)0s0',],3246 'R3m':['(00g)','(00g)0s',],3247 #1681763248 'P6':['(00g)','(00g)h','(00g)t','(00g)s',],3249 'P6':['(00g)',],3250 'P6/m':['(00g)','(00g)s0',],3251 #1771943252 'P622':['(00g)','(00g)h00','(00g)t00','(00g)s00',],3253 'P6mm':['(00g)','(00g)ss0','(00g)0ss','(00g)s0s',],3254 'P6m2':['(00g)','(00g)0s0',],3255 'P62m':['(00g)','(00g)00s',],3256 'P6/mmm':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],3257 }3258 3259 3160 3260 3161 #'A few nonstandard space groups for test use'
Note: See TracChangeset
for help on using the changeset viewer.