Changeset 3186 for trunk/imports/G2phase_CIF.py
- Timestamp:
- Dec 9, 2017 8:54:59 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2phase_CIF.py
r3172 r3186 152 152 SpGrp = SpGrp.replace('_','') 153 153 # try normalizing the space group, to see if we can pick the space group out of a table 154 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp) 155 if SpGrpNorm: 156 E,SGData = G2spc.SpcGroup(SpGrpNorm) 154 E,SGData = G2spc.SpcGroup(SpGrp) 155 if E and SpGrp: 156 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp) 157 if SpGrpNorm: 158 E,SGData = G2spc.SpcGroup(SpGrpNorm) 157 159 # nope, try the space group "out of the Box" 158 if E and SpGrp:159 E,SGData = G2spc.SpcGroup(SpGrp)160 160 if E: 161 161 if not SpGrp: … … 196 196 waveloop = blk.GetLoop('_cell_wave_vector_seq_id') 197 197 waveDict = dict(waveloop.items()) 198 SuperVec = [[ float(waveDict['_cell_wave_vector_x'][0].replace('?','0')),199 float(waveDict['_cell_wave_vector_y'][0].replace('?','0')),200 float(waveDict['_cell_wave_vector_z'][0].replace('?','0'))],False,4]198 SuperVec = [[cif.get_number_with_esd(waveDict['_cell_wave_vector_x'][0].replace('?','0'))[0], 199 cif.get_number_with_esd(waveDict['_cell_wave_vector_y'][0].replace('?','0'))[0], 200 cif.get_number_with_esd(waveDict['_cell_wave_vector_z'][0].replace('?','0'))[0]],False,4] 201 201 # read in atoms 202 202 self.errors = 'Error during reading of atoms' … … 263 263 ranIdlookup = {} 264 264 for aitem in atomloop: 265 mc = 0 265 266 if magnetic: 266 atomlist = ['','','',0.,0.,0.,1.0,0.,0.,0.,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.] 267 else: 268 atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.] 267 atomlist = ['','','',0.,0.,0.,1.0, 0.,0.,0.,'',0.,'I',0.01, 0.,0.,0.,0.,0.,0.,] 268 mc = 3 269 else: 270 atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01, 0.,0.,0.,0.,0.,0.,] 269 271 for val,key in zip(aitem,atomkeys): 270 272 col = G2AtomDict.get(key,-1) 271 273 if col >= 3: 272 274 atomlist[col] = cif.get_number_with_esd(val)[0] 273 if col >= 11: atomlist[9 ] = 'A' # if any Aniso term is defined, set flag274 elif col is not None :275 if col >= 11: atomlist[9+mc] = 'A' # if any Aniso term is defined, set flag 276 elif col is not None and col != -1: 275 277 atomlist[col] = val 276 278 elif key in ('_atom_site_thermal_displace_type', 277 279 '_atom_site_adp_type'): #Iso or Aniso? 278 280 if val.lower() == 'uani': 279 if magnetic: 280 atomlist[12] = 'A' 281 else: 282 atomlist[9] = 'A' 281 atomlist[9+mc] = 'A' 283 282 elif key == '_atom_site_u_iso_or_equiv': 284 283 uisoval = cif.get_number_with_esd(val)[0] 285 284 if uisoval is not None: 286 if magnetic: 287 atomlist[13] = uisoval 288 else: 289 atomlist[10] = uisoval 285 atomlist[10+mc] = uisoval 290 286 if not atomlist[1] and atomlist[0]: 291 287 typ = atomlist[0].rstrip('0123456789-+') … … 296 292 self.warnings += ' Atom type '+typ+' not recognized; Xe assumed\n' 297 293 if atomlist[0] in anisolabels: # does this atom have aniso values in separate loop? 298 if magnetic: 299 atomlist[12] = 'A' 300 else: 301 atomlist[9] = 'A' 302 for val,key in zip( # load the values 303 anisoloop.GetKeyedPacket('_atom_site_aniso_label',atomlist[0]), 304 anisokeys): 294 atomlist[9+mc] = 'A' 295 for val,key in zip(anisoloop.GetKeyedPacket('_atom_site_aniso_label',atomlist[0]),anisokeys): 305 296 col = G2AtomDict.get(key) 306 if magnetic:307 col += 3308 297 if col: 309 atomlist[col ] = cif.get_number_with_esd(val)[0]298 atomlist[col+mc] = cif.get_number_with_esd(val)[0] 310 299 if magnetic: 311 300 for mitem in magatomloop: … … 317 306 atomlist[mcol] = cif.get_number_with_esd(mval)[0] 318 307 break 319 atomlist[10],atomlist[11] = G2spc.SytSym(atomlist[3:6],SGData)[:2] 320 else: 321 atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2] 308 atomlist[7+mc],atomlist[8+mc] = G2spc.SytSym(atomlist[3:6],SGData)[:2] 322 309 atomlist[1] = G2elem.FixValence(atomlist[1]) 323 310 atomlist.append(ran.randint(0,sys.maxsize)) # add a random Id
Note: See TracChangeset
for help on using the changeset viewer.