Changeset 3465
- Timestamp:
- Jul 10, 2018 11:41:00 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r3462 r3465 1443 1443 data['Histograms'][hist]['Mustrain'][4:6] = [NShkl*[0.01,],NShkl*[False,]] 1444 1444 data['Histograms'][hist]['HStrain'] = [NDij*[0.0,],NDij*[False,]] 1445 data['Drawing']['Atoms'] = []1445 if data['Drawing']: data['Drawing']['Atoms'] = [] 1446 1446 wx.CallAfter(UpdateGeneral) 1447 1447 -
trunk/GSASIIspc.py
r3450 r3465 1042 1042 ip = len(op) 1043 1043 if '/' in op: 1044 if CIF:1044 try: #mcif format 1045 1045 nP = op.count('+') 1046 1046 opMT = op.split('+') … … 1048 1048 if nP == 2: 1049 1049 opMT[0] = '+'.join(opMT[0:2]) 1050 e lse:1050 except NameError: #normal cif format 1051 1051 ip = op.index('/') 1052 1052 T.append(eval(op[:ip+2])) -
trunk/exports/G2export_CIF.py
r3464 r3465 278 278 s += PutInCol(at[cs+1],3) 279 279 WriteCIFitem(fp, s) 280 if naniso == 0: return281 # now loop over aniso atoms282 WriteCIFitem(fp, '\nloop_' + '\n _atom_site_aniso_label' +283 '\n _atom_site_aniso_U_11' + '\n _atom_site_aniso_U_22' +284 '\n _atom_site_aniso_U_33' + '\n _atom_site_aniso_U_12' +285 '\n _atom_site_aniso_U_13' + '\n _atom_site_aniso_U_23')286 for i,at in enumerate(Atoms):287 fval = parmDict.get(fpfx+str(i),at[cfrac])288 if fval == 0.0: continue # ignore any atoms that have a occupancy set to 0 (exact)289 if at[cia] == 'I': continue290 s = PutInCol(labellist[i],6) # label291 for j in (2,3,4,5,6,7):292 sigdig = -0.0009293 var = pfx+varnames[cia+j]+":"+str(i)294 val = parmDict.get(var,at[cia+j])295 sig = sigDict.get(var,sigdig)296 s += PutInCol(G2mth.ValEsd(val,sig),11)297 WriteCIFitem(fp, s)280 if naniso: 281 # now loop over aniso atoms 282 WriteCIFitem(fp, '\nloop_' + '\n _atom_site_aniso_label' + 283 '\n _atom_site_aniso_U_11' + '\n _atom_site_aniso_U_22' + 284 '\n _atom_site_aniso_U_33' + '\n _atom_site_aniso_U_12' + 285 '\n _atom_site_aniso_U_13' + '\n _atom_site_aniso_U_23') 286 for i,at in enumerate(Atoms): 287 fval = parmDict.get(fpfx+str(i),at[cfrac]) 288 if fval == 0.0: continue # ignore any atoms that have a occupancy set to 0 (exact) 289 if at[cia] == 'I': continue 290 s = PutInCol(labellist[i],6) # label 291 for j in (2,3,4,5,6,7): 292 sigdig = -0.0009 293 var = pfx+varnames[cia+j]+":"+str(i) 294 val = parmDict.get(var,at[cia+j]) 295 sig = sigDict.get(var,sigdig) 296 s += PutInCol(G2mth.ValEsd(val,sig),11) 297 WriteCIFitem(fp, s) 298 298 # now loop over mag atoms (e.g. all of them) 299 299 WriteCIFitem(fp, '\nloop_' + '\n _atom_site_moment.label' + … … 1232 1232 phasedict['General']['SGData']['SGSys']) 1233 1233 1234 spacegroup = phasedict['General']['SGData']['SpGrp'].strip() 1235 # regularize capitalization and remove trailing H/R 1236 spacegroup = spacegroup[0].upper() + spacegroup[1:].lower().rstrip('rh ') 1237 WriteCIFitem(self.fp, '_symmetry_space_group_name_H-M',spacegroup) 1238 1239 # generate symmetry operations including centering and center of symmetry 1240 SymOpList,offsetList,symOpList,G2oprList,G2opcodes = G2spc.AllOps( 1241 phasedict['General']['SGData']) 1242 WriteCIFitem(self.fp, 'loop_\n _space_group_symop_id\n _space_group_symop_operation_xyz') 1243 for i,op in enumerate(SymOpList,start=1): 1244 WriteCIFitem(self.fp, ' {:3d} {:}'.format(i,op.lower())) 1234 if phasedict['General']['Type'] in ['nuclear','macromolecular']: 1235 spacegroup = phasedict['General']['SGData']['SpGrp'].strip() 1236 # regularize capitalization and remove trailing H/R 1237 spacegroup = spacegroup[0].upper() + spacegroup[1:].lower().rstrip('rh ') 1238 WriteCIFitem(self.fp, '_symmetry_space_group_name_H-M',spacegroup) 1239 1240 # generate symmetry operations including centering and center of symmetry 1241 SymOpList,offsetList,symOpList,G2oprList,G2opcodes = G2spc.AllOps( 1242 phasedict['General']['SGData']) 1243 WriteCIFitem(self.fp, 'loop_\n _space_group_symop_id\n _space_group_symop_operation_xyz') 1244 for i,op in enumerate(SymOpList,start=1): 1245 WriteCIFitem(self.fp, ' {:3d} {:}'.format(i,op.lower())) 1246 elif phasedict['General']['Type'] == 'magnetic': 1247 parentSpGrp = phasedict['General']['SGData']['SpGrp'].strip() 1248 parentSpGrp = parentSpGrp[0].upper() + parentSpGrp[1:].lower().rstrip('rh ') 1249 WriteCIFitem(self.fp, '_parent_space_group.name_H-M_alt',parentSpGrp) 1250 spacegroup = phasedict['General']['SGData']['MagSpGrp'].strip() 1251 spacegroup = spacegroup[0].upper() + spacegroup[1:].lower().rstrip('rh ') 1252 WriteCIFitem(self.fp, '_space_group_magn.name_BNS',spacegroup) 1253 # generate symmetry operations including centering and center of symmetry 1254 SymOpList,offsetList,symOpList,G2oprList,G2opcodes = G2spc.AllOps( 1255 phasedict['General']['SGData']) 1256 SpnFlp = phasedict['General']['SGData']['SpnFlp'] 1257 WriteCIFitem(self.fp, 'loop_\n _space_group_symop_magn_operation.id\n _space_group_symop_magn_operation.xyz') 1258 for i,op in enumerate(SymOpList,start=1): 1259 if SpnFlp[i-1] >0: 1260 opr = op.lower()+',+1' 1261 else: 1262 opr = op.lower()+',-1' 1263 WriteCIFitem(self.fp, ' {:3d} {:}'.format(i,opr)) 1245 1264 1246 1265 # loop over histogram(s) used in this phase … … 1280 1299 WriteAtomsMagnetic(self.fp, self.Phases[phasenam], phasenam, 1281 1300 self.parmDict, self.sigDict, self.labellist) 1282 raise Exception("no export for "+str(phasedict['General']['Type'])+" coordinates implemented") 1301 # self.CloseFile() 1302 # raise Exception("no export for "+str(phasedict['General']['Type'])+" coordinates implemented") 1283 1303 # report cell contents 1284 1304 WriteComposition(self.fp, self.Phases[phasenam], phasenam, self.parmDict) -
trunk/imports/G2phase_CIF.py
r3401 r3465 284 284 censpn += list(np.array(spnflp)*S) 285 285 self.MPhase['General']['SSGData'] = SSGData 286 else: 286 else: 287 287 try: 288 sgoploop = blk.GetLoop('_space_group_symop_magn.id') 289 sgcenloop = blk.GetLoop('_space_group_symop_magn_centering.id') 288 sgoploop = blk.GetLoop('_space_group_symop_magn_operation.id') 290 289 opid = sgoploop.GetItemPosition('_space_group_symop_magn_operation.xyz')[1] 291 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_centering.xyz')[1] 292 except KeyError: #old mag cif names 293 sgoploop = blk.GetLoop('_space_group_symop.magn_id') 294 sgcenloop = blk.GetLoop('_space_group_symop.magn_centering_id') 295 opid = sgoploop.GetItemPosition('_space_group_symop.magn_operation_xyz')[1] 296 centid = sgcenloop.GetItemPosition('_space_group_symop.magn_centering_xyz')[1] 290 try: 291 sgcenloop = blk.GetLoop('_space_group_symop_magn_centering.id') 292 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_centering.xyz')[1] 293 except KeyError: 294 sgcenloop = None 295 except KeyError: 296 try: 297 sgoploop = blk.GetLoop('_space_group_symop_magn.id') 298 sgcenloop = blk.GetLoop('_space_group_symop_magn_centering.id') 299 opid = sgoploop.GetItemPosition('_space_group_symop_magn_operation.xyz')[1] 300 centid = sgcenloop.GetItemPosition('_space_group_symop_magn_centering.xyz')[1] 301 except KeyError: #old mag cif names 302 sgoploop = blk.GetLoop('_space_group_symop.magn_id') 303 sgcenloop = blk.GetLoop('_space_group_symop.magn_centering_id') 304 opid = sgoploop.GetItemPosition('_space_group_symop.magn_operation_xyz')[1] 305 centid = sgcenloop.GetItemPosition('_space_group_symop.magn_centering_xyz')[1] 297 306 spnflp = [] 298 307 for op in sgoploop: … … 305 314 return False 306 315 censpn = [] 307 for cent in sgcenloop: 308 M,C,S = G2spc.MagText2MTS(cent[centid]) 309 SGData['SGCen'].append(C) 310 censpn += list(np.array(spnflp)*S) 316 if sgcenloop: 317 for cent in sgcenloop: 318 M,C,S = G2spc.MagText2MTS(cent[centid]) 319 SGData['SGCen'].append(C) 320 censpn += list(np.array(spnflp)*S) 321 else: 322 M,C,S = G2spc.MagText2MTS('x,y,z,+1') 323 SGData['SGCen'].append(C) 324 censpn += list(np.array(spnflp)*S) 311 325 self.MPhase['General']['SGData'] = SGData 312 326 self.MPhase['General']['SGData']['SpnFlp'] = censpn
Note: See TracChangeset
for help on using the changeset viewer.