Changeset 3168
- Timestamp:
- Nov 30, 2017 3:00:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CifFile/StarFile.py
r3137 r3168 931 931 if len(one_pack)!=1: 932 932 raise ValueError("Bad packet key %s = %s: returned %d packets" % (keyname,keyvalue,len(one_pack))) 933 print("Keyed packet: %s" % one_pack[0])933 # print("Keyed packet: %s" % one_pack[0]) 934 934 return one_pack[0] 935 935 … … 2192 2192 # print("Full URL is: " + my_uri) 2193 2193 filestream = urlopen(my_uri) 2194 text = filestream.read().decode('utf8') 2194 # text = filestream.read().decode('utf8') 2195 text = filestream.read().decode('latin1') 2195 2196 filestream.close() 2196 2197 else: … … 2198 2199 text = filestream.read() 2199 2200 if not isinstance(text,unicode): 2200 text = text.decode('utf8') #CIF is always ascii/utf8 2201 # text = text.decode('utf8') #CIF is always ascii/utf8 2202 text = text.decode('latin1') #CIF is always ascii/utf8 2201 2203 my_uri = "" 2202 2204 if not text: # empty file, return empty block -
trunk/GSASIIphsGUI.py
r3148 r3168 2253 2253 if r < 0 and c < 0: 2254 2254 for row in range(Atoms.GetNumberRows()): 2255 Atoms.SelectRow(row,True) 2255 Atoms.SelectRow(row,True) 2256 wx.CallAfter(Paint) 2257 return 2256 2258 if r < 0: #double click on col label! Change all atoms! 2257 2259 noSkip = True … … 4471 4473 cx,ct,cs,cia = generalData['AtomPtrs'] 4472 4474 atomData = data['Atoms'] 4473 D4Map = generalData ['4DmapData']4475 D4Map = generalData.get('4DmapData',{'rho':[]}) 4474 4476 if waveData.GetSizer(): 4475 4477 waveData.GetSizer().Clear(True) … … 5193 5195 str(int(Cell[0]))+','+str(int(Cell[1]))+','+str(int(Cell[2])) 5194 5196 atom[cs-1] = G2spc.StringOpsProd(atomOp,newOp,SGData) 5195 if cmx: 5197 if cmx: #magnetic moment 5196 5198 opNum = G2spc.GetOpNum(OprNum,SGData) 5197 5199 mom = np.inner(np.array(atom[cmx:cmx+3]),Bmat) 5198 # print OprNum,newOp,opNum,SpnFlp5200 # print (OprNum,newOp,opNum,nl.det(M),SpnFlp) 5199 5201 atom[cmx:cmx+3] = np.inner(np.inner(mom,M),Amat)*nl.det(M)*SpnFlp[opNum-1] 5200 5202 if atom[cui] == 'A': … … 6375 6377 if dlg.ShowModal() == wx.ID_OK: 6376 6378 for sel in dlg.GetSelections(): 6377 data['Histograms'][keyList[sel]].update(copy Dict)6379 data['Histograms'][keyList[sel]].update(copy.deepcopy(copyDict)) 6378 6380 finally: 6379 6381 dlg.Destroy() … … 6432 6434 data['Histograms'][item][name][2][itm][1] = copy.deepcopy(copyDict[name][itm]) 6433 6435 elif name == 'Twins': 6434 data['Histograms'][item]['Twins'][0][1][1] = copy Dict['Twins']6436 data['Histograms'][item]['Twins'][0][1][1] = copy.deepcopy(copyDict['Twins']) 6435 6437 else: 6436 6438 try: … … 6466 6468 G2G.G2MessageBox(G2frame,'No histograms to copy to') 6467 6469 return 6468 copyDict = {}6469 6470 if 'HKLF' in sourceDict['Histogram']: 6470 6471 copyNames = ['Scale','Extinction','Babinet','Flack','Twins','Fix FXU'] -
trunk/GSASIIspc.py
r3136 r3168 698 698 SGData['SGSpin'][:2] = [1,1] 699 699 700 def MagSGSym(SGData): 700 def MagSGSym(SGData): #needs to use SGPtGrp not SGLaue! 701 701 SGLaue = SGData['SGLaue'] 702 702 SpnFlp = SGData['SGSpin'] 703 703 GenSym = SGData['GenSym'] 704 SGPtGrp = SGData['SGPtGrp'] 704 705 if not len(SpnFlp): 705 SGLaue['MagPtGp'] = SG Laue706 SGLaue['MagPtGp'] = SGPtGrp 706 707 return SGData['SpGrp'] 707 708 magSym = SGData['SpGrp'].split() 708 709 if SGLaue in ['-1',]: 709 SGData['MagPtGp'] = SG Laue710 SGData['MagPtGp'] = SGPtGrp 710 711 if SpnFlp[0] == -1: 711 712 magSym[1] += "'" … … 714 715 if SpnFlp[1] < 0: 715 716 magSym[0] += '(P)' 716 elif SG Laue in ['mmm',]:717 elif SGPtGrp in ['mmm','mm2','m2m','2mm','222']: 717 718 SGData['MagPtGp'] = '' 718 719 for i in [0,1,2]: 719 SGData['MagPtGp'] += 'm'720 SGData['MagPtGp'] += SGPtGrp[i] 720 721 if SpnFlp[i] < 0: 721 722 magSym[i+1] += "'" … … 3446 3447 'P n a m':['(00g)','(00g)0s0','(a00)','(a00)00s','(0b0)','(0b0)00s'], 3447 3448 'P m n b':['(00g)','(00g)s00','(a00)','(a00)00s','(0b0)','(0b0)s00'], 3448 'P c m n':['(00g)','(00g)0s0','( a00)','(a00)0s0','(0b0)','(0b0)s00'],3449 'P c m n':['(00g)','(00g)0s0','(00g)ss0','(a00)','(a00)0s0','(0b0)','(0b0)s00'], 3449 3450 #63 3450 3451 'C m c m':['(00g)','(00g)s00','(10g)','(10g)s00','(a00)','(a00)00s','(a00)0ss','(a00)0s0','(0b0)','(0b0)00s','(0b0)s0s','(0b0)s00',], -
trunk/imports/G2phase_CIF.py
r3163 r3168 113 113 sg = cf[blknm].get("_symmetry_space_group_name_H-M",'') 114 114 if not sg: sg = cf[blknm].get("_space_group_name_H-M_alt",'') 115 sg = sg.replace('_','') 115 116 if sg: choice[-1] += ', (' + sg.strip() + ')' 116 selblk = G2IO.PhaseSelector( 117 choice, 118 ParentFrame=ParentFrame, 119 title= 'Select a phase from one the CIF data_ blocks below', 120 size=(600,100) 121 ) 117 selblk = G2IO.PhaseSelector(choice,ParentFrame=ParentFrame, 118 title= 'Select a phase from one the CIF data_ blocks below',size=(600,100)) 122 119 self.errors = 'Error during reading of selected block' 123 120 if selblk is None: … … 128 125 E = True 129 126 Super = False 127 if blk.get("_space_group_ssg_name",''): 128 Super = True 130 129 magnetic = False 131 130 self.Phase['General']['Type'] = 'nuclear' … … 138 137 self.Phase['General']['Type'] = 'magnetic' 139 138 self.Phase['General']['AtomPtrs'] = [3,1,10,12] 140 if not SpGrp:139 if Super: 141 140 sspgrp = blk.get("_space_group_ssg_name",'').split('(') 142 141 SpGrp = sspgrp[0] … … 144 143 Super = True 145 144 SuperVec = [[0,0,.1],False,4] 145 SpGrp = SpGrp.replace('_','') 146 146 # try normalizing the space group, to see if we can pick the space group out of a table 147 147 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp) … … 170 170 Volume = G2lat.calc_V(G2lat.cell2A(cell)) 171 171 self.Phase['General']['Cell'] = [False,]+cell+[Volume,] 172 if Super: 173 print(blk.get('_cell_modulation_dimension','')) 174 if int(blk.get('_cell_modulation_dimension','')) > 1: 175 msg = 'more than 3+1 super symmetry is not allowed in GSAS-II' 176 self.errors = msg 177 self.warnings += msg 178 return False 179 waveloop = blk.GetLoop('_cell_wave_vector_seq_id') 180 waveDict = dict(waveloop.items()) 181 SuperVec = [[float(waveDict['_cell_wave_vector_x'][0]), 182 float(waveDict['_cell_wave_vector_y'][0]), 183 float(waveDict['_cell_wave_vector_z'][0])],False,4] 172 184 # read in atoms 173 185 self.errors = 'Error during reading of atoms' … … 235 247 for aitem in atomloop: 236 248 if magnetic: 237 atomlist = ['','','',0.,0.,0.,1.0,0.,0.,0.,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.,0.] 238 else: 239 atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.,0.] 240 atomlist[-1] = ran.randint(0,sys.maxsize) # add a random Id 241 while atomlist[-1] in ranIdlookup: 242 atomlist[-1] = ran.randint(0,sys.maxsize) # make it unique 249 atomlist = ['','','',0.,0.,0.,1.0,0.,0.,0.,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.] 250 else: 251 atomlist = ['','','',0.,0.,0.,1.0,'',0.,'I',0.01,0.,0.,0.,0.,0.,0.] 243 252 for val,key in zip(aitem,atomkeys): 244 253 col = G2AtomDict.get(key,-1) … … 295 304 atomlist[7],atomlist[8] = G2spc.SytSym(atomlist[3:6],SGData)[:2] 296 305 atomlist[1] = G2elem.FixValence(atomlist[1]) 306 atomlist.append(ran.randint(0,sys.maxsize)) # add a random Id 297 307 self.Phase['Atoms'].append(atomlist) 298 308 ranIdlookup[atomlist[0]] = atomlist[-1] … … 306 316 Spos = np.zeros((4,6)) 307 317 nim = -1 308 for i,item in enumerate(displFdict['_atom_site_displace_ Fourier_atom_site_label']):318 for i,item in enumerate(displFdict['_atom_site_displace_fourier_atom_site_label']): 309 319 if item == atomlist[0]: 310 320 waveType = 'Fourier' 311 ix = ['x','y','z'].index(displFdict['_atom_site_displace_ Fourier_axis'][i])312 im = int(displFdict['_atom_site_displace_ Fourier_wave_vector_seq_id'][i])321 ix = ['x','y','z'].index(displFdict['_atom_site_displace_fourier_axis'][i]) 322 im = int(displFdict['_atom_site_displace_fourier_wave_vector_seq_id'][i]) 313 323 if im != nim: 314 324 nim = im 315 val = displFdict['_atom_site_displace_ Fourier_param_sin'][i]325 val = displFdict['_atom_site_displace_fourier_param_sin'][i] 316 326 Spos[im-1][ix] = cif.get_number_with_esd(val)[0] 317 val = displFdict['_atom_site_displace_ Fourier_param_cos'][i]327 val = displFdict['_atom_site_displace_fourier_param_cos'][i] 318 328 Spos[im-1][ix+3] = cif.get_number_with_esd(val)[0] 319 329 if nim >= 0: … … 324 334 nim = -1 325 335 Sadp = np.zeros((4,12)) 326 for i,item in enumerate(UijFdict['_atom_site_U_ Fourier_atom_site_label']):336 for i,item in enumerate(UijFdict['_atom_site_U_fourier_atom_site_label']): 327 337 if item == atomlist[0]: 328 ix = ['U11','U22','U33','U12','U13','U23'].index(UijFdict['_atom_site_U_ Fourier_tens_elem'][i])329 im = int(UijFdict['_atom_site_U_ Fourier_wave_vector_seq_id'][i])338 ix = ['U11','U22','U33','U12','U13','U23'].index(UijFdict['_atom_site_U_fourier_tens_elem'][i]) 339 im = int(UijFdict['_atom_site_U_fourier_wave_vector_seq_id'][i]) 330 340 if im != nim: 331 341 nim = im 332 val = UijFdict['_atom_site_U_ Fourier_param_sin'][i]342 val = UijFdict['_atom_site_U_fourier_param_sin'][i] 333 343 Sadp[im-1][ix] = cif.get_number_with_esd(val)[0] 334 val = UijFdict['_atom_site_U_ Fourier_param_cos'][i]344 val = UijFdict['_atom_site_U_fourier_param_cos'][i] 335 345 Sadp[im-1][ix+6] = cif.get_number_with_esd(val)[0] 336 346 if nim >= 0:
Note: See TracChangeset
for help on using the changeset viewer.