Changeset 3191
- Timestamp:
- Dec 13, 2017 8:26:51 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIElem.py
r3164 r3191 197 197 if El not in atmdata.XrayFF and El not in atmdata.MagFF: 198 198 if ElS not in atmdata.XrayFF: 199 print('Atom type '+El+' not found, using UNK') 200 return # not sure what this element should be! 199 print('Atom type '+El+' not found, using H') 200 ElS = 'H' 201 # return # not sure what this element should be! 201 202 print('Atom type '+El+' not found, using '+ElS) 202 203 El = ElS -
trunk/GSASIIdataGUI.py
r3187 r3191 803 803 else: 804 804 if singlereader: 805 msg += '\n'+rd.warnings 805 806 print(u'The '+ rd.formatName+u' reader was not able to read file '+filename+msg) 806 807 try: -
trunk/GSASIIpwdGUI.py
r3175 r3191 2815 2815 ObjId = cellList.index(Obj.GetId()) 2816 2816 valObj = valDict[Obj.GetId()] 2817 if ObjId/ 2 < 3:2817 if ObjId//2 < 3: 2818 2818 move = Obj.GetValue()*0.01 2819 2819 else: … … 2821 2821 Obj.SetValue(0) 2822 2822 value = float(valObj.GetValue())+move 2823 SetCellValue(valObj,ObjId/ 2,value)2823 SetCellValue(valObj,ObjId//2,value) 2824 2824 OnHklShow(event) 2825 2825 … … 2849 2849 value = max(1.0,float(Obj.GetValue())) 2850 2850 except ValueError: 2851 if ObjId/ 2 < 3: #bad cell edge - reset2852 value = controls[6+ObjId/ 2]2851 if ObjId//2 < 3: #bad cell edge - reset 2852 value = controls[6+ObjId//2] 2853 2853 else: #bad angle 2854 2854 value = 90. -
trunk/GSASIIspc.py
r3186 r3191 2980 2980 'C m c 21','C c m 21','C c c 2','C m 2 m','C 2 m m', 2981 2981 'C m 2 a','C 2 m b','C c 2 m','C 2 c m','C c 2 a','C 2 c b', 2982 'C m c m','C m c a','C c m b',2982 'C m c m','C c m m','C m c a','C c m b', 2983 2983 'C m m m','C c c m','C m m a','C m m b','C c c a','C c c b',), 2984 'Ammm':('A 21 2 2','A 2 2 2','A 2 m m', 2985 'A 21 m a','A 21 a m','A 2 a a','A m 2 m','A m m 2', 2986 'A b m 2','A c 2 m','A m a 2','A m 2 a','A b a 2','A c 2 a', 2987 'A m m a','A m a m','A b m a','A c a m', 2988 'A m m m','A m a a','A b m m','A c m m','A c a a','A b a a',), 2989 'Bmmm':('B 2 21 2','B 2 2 2','B m 2 m', 2990 'B m 21 b','B b 21 m','B b 2 b','B m m 2','B 2 m m', 2991 'B 2 c m','B m a 2','B 2 m b','B b m 2','B 2 c b','B b a 2', 2992 'B b m m','B m m b','B b c m','B m a b', 2993 'B m m m','B b m b','B m a m','B m c m','B b a b','B b c b',), 2984 2994 'Immm':('I 2 2 2','I 21 21 21', 2985 2995 'I m m 2','I m 2 m','I 2 m m', -
trunk/imports/G2phase_CIF.py
r3186 r3191 55 55 while self.Phase['ranId'] in usedRanIdList: 56 56 self.Phase['ranId'] = ran.randint(0,sys.maxsize) 57 self.MPhase = G2obj.SetNewPhase(Name='new phase') # create a new empty phase dict 58 # make sure the ranId is really unique! 59 while self.MPhase['ranId'] in usedRanIdList: 60 self.MPhase['ranId'] = ran.randint(0,sys.maxsize) 57 61 returnstat = False 58 62 cellitems = ( … … 74 78 try: 75 79 cf = G2obj.ReadCIF(filename) 76 except :77 msg = 'Unreadable cif file'80 except cif.StarError as msg: 81 msg = 'Unreadable cif file\n'+str(msg) 78 82 self.errors = msg 79 83 self.warnings += msg … … 109 113 choice[-1] += '1 atom' 110 114 else: 111 choice[-1] += ('%d' % n d) + ' atoms'115 choice[-1] += ('%d' % na) + ' atoms' 112 116 choice[-1] += ', cell: ' 113 117 fmt = "%.2f," … … 131 135 E = True 132 136 Super = False 133 if blk.get("_space_group_ssg_name",''): 137 moddim = int(blk.get("_cell_modulation_dimension",'0')) 138 if moddim: 134 139 Super = True 140 if moddim > 1: 141 msg = 'more than 3+1 super symmetry is not allowed in GSAS-II' 142 self.errors = msg 143 self.warnings += msg 144 return False 145 if blk.get('_cell_subsystems_number'): 146 msg = 'Composite super structures not allowed in GSAS-II' 147 self.errors = msg 148 self.warnings += msg 149 return False 150 sspgrp = blk.get("_space_group_ssg_name",'') 151 if 'X' in sspgrp: 152 self.warnings += '\nAd hoc incommensurate space group '+sspgrp+' is not allowed in GSAS-II' 153 self.errors = 'Ad hoc incommensurate space groups not allowed in GSAS-II' 154 return False 135 155 magnetic = False 136 156 self.Phase['General']['Type'] = 'nuclear' … … 139 159 SpGrp = blk.get("_space_group_name_H-M_alt",'') 140 160 if not SpGrp: 141 SpGrp = blk.get("_parent_space_group.name_H-M",'') 161 MSpGrp = blk.get("_space_group.magn_name_BNS",'') 162 SpGrp = MSpGrp.replace("'",'') 163 if '_' in SpGrp: SpGrp = SpGrp.split('_')[1] 142 164 if SpGrp: #TODO need to decide if read nuclear phase or magnetic phase 143 165 magnetic = True 144 self. Phase['General']['Type'] = 'magnetic'145 self. Phase['General']['AtomPtrs'] = [3,1,10,12]166 self.MPhase['General']['Type'] = 'magnetic' 167 self.MPhase['General']['AtomPtrs'] = [3,1,10,12] 146 168 if Super: 147 sspgrp = blk.get("_space_group_ssg_name",'').split('(') 169 sspgrp = blk.get("_space_group_ssg_name",'') 170 sspgrp = sspgrp.split('(') 148 171 SpGrp = sspgrp[0] 149 172 SuperSg = '('+sspgrp[1].replace('\\','') … … 152 175 SpGrp = SpGrp.replace('_','') 153 176 # try normalizing the space group, to see if we can pick the space group out of a table 177 if Super: 178 SpGrp = G2spc.StandardizeSpcName(SpGrp) 179 if not SpGrp: 180 msg = 'GSAS-II failed to find space group symbol; not a valid cif file' 181 self.errors = msg 182 self.warnings += msg 183 return False 184 if not SpGrp: 185 msg = 'GSAS-II failed to find space group symbol; not a valid cif file' 186 self.errors = msg 187 self.warnings += msg 188 return False 154 189 E,SGData = G2spc.SpcGroup(SpGrp) 155 190 if E and SpGrp: … … 165 200 else: 166 201 self.warnings += 'ERROR in space group symbol '+SpGrp 167 if 'X' in SpGrp:168 self.warnings += '\nAd hoc incommensurate space groups not allowed in GSAS-II'169 202 self.warnings += '\nThe space group has been set to "P 1". ' 170 203 self.warnings += "Change this in phase's General tab." … … 173 206 SGData = G2obj.P1SGData # P 1 174 207 self.Phase['General']['SGData'] = SGData 208 if magnetic: 209 self.MPhase['General']['SGData'] = SGData 175 210 if Super: 176 211 E,SSGData = G2spc.SSpcGroup(SGData,SuperSg) … … 188 223 Volume = G2lat.calc_V(G2lat.cell2A(cell)) 189 224 self.Phase['General']['Cell'] = [False,]+cell+[Volume,] 225 if magnetic: 226 self.MPhase['General']['Cell'] = [False,]+cell+[Volume,] 190 227 if Super: 191 if int(blk.get('_cell_modulation_dimension','')) > 1:192 msg = 'more than 3+1 super symmetry is not allowed in GSAS-II'193 self.errors = msg194 self.warnings += msg195 return False196 228 waveloop = blk.GetLoop('_cell_wave_vector_seq_id') 197 229 waveDict = dict(waveloop.items()) … … 224 256 displSloop = None 225 257 displFloop = None 226 disp Sdict = {}227 disp Fdict = {}258 displSdict = {} 259 displFdict = {} 228 260 UijFloop = None 229 261 UijFdict = {} … … 244 276 UijFdict = dict(UijFloop.items()) 245 277 self.Phase['Atoms'] = [] 278 if magnetic: 279 self.MPhase['Atoms'] = [] 246 280 G2AtomDict = { '_atom_site_type_symbol' : 1, 247 281 '_atom_site_label' : 0, … … 320 354 Spos = np.zeros((4,6)) 321 355 nim = -1 322 for i,item in enumerate(displFdict['_atom_site_displace_fourier_atom_site_label']): 323 if item == atomlist[0]: 324 waveType = 'Fourier' 325 ix = ['x','y','z'].index(displFdict['_atom_site_displace_fourier_axis'][i]) 326 im = int(displFdict['_atom_site_displace_fourier_wave_vector_seq_id'][i]) 327 if im != nim: 328 nim = im 329 val = displFdict['_atom_site_displace_fourier_param_sin'][i] 330 Spos[im-1][ix] = cif.get_number_with_esd(val)[0] 331 val = displFdict['_atom_site_displace_fourier_param_cos'][i] 332 Spos[im-1][ix+3] = cif.get_number_with_esd(val)[0] 356 waveType = 'Fourier' 357 if displFdict: 358 for i,item in enumerate(displFdict['_atom_site_displace_fourier_atom_site_label']): 359 if item == atomlist[0]: 360 waveType = 'Fourier' 361 ix = ['x','y','z'].index(displFdict['_atom_site_displace_fourier_axis'][i]) 362 im = int(displFdict['_atom_site_displace_fourier_wave_vector_seq_id'][i]) 363 if im != nim: 364 nim = im 365 val = displFdict['_atom_site_displace_fourier_param_sin'][i] 366 Spos[im-1][ix] = cif.get_number_with_esd(val)[0] 367 val = displFdict['_atom_site_displace_fourier_param_cos'][i] 368 Spos[im-1][ix+3] = cif.get_number_with_esd(val)[0] 333 369 if nim >= 0: 334 370 Spos = [[spos,False] for spos in Spos[:nim]]
Note: See TracChangeset
for help on using the changeset viewer.