Changeset 3140 for trunk/exports/G2export_csv.py
- Timestamp:
- Oct 25, 2017 2:56:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2export_csv.py
r3136 r3140 303 303 tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]] 304 304 if phasDict.get('Super',False): 305 WriteList(self,("h","k","l","m", tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #"))305 WriteList(self,("h","k","l","m","d-sp",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #")) 306 306 if 'T' in phasDict['Type']: 307 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}"307 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}" 308 308 else: 309 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}"309 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}" 310 310 refList = phasDict['RefList'] 311 311 for refItem in refList: … … 313 313 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:17] 314 314 FWHM = G2pwd.getgamFW(gam,sig) 315 self.Write(fmt.format(h,k,l,m, pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i))315 self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i)) 316 316 else: #convert to deg 317 317 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:14] … … 319 319 g = gam/100. #-> deg 320 320 FWHM = G2pwd.getgamFW(g,s) 321 self.Write(fmt.format(h,k,l,m, pos,Fobs,Fcalc,phase,mult,s,g,FWHM,i))321 self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,i)) 322 322 else: 323 WriteList(self,("h","k","l", tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #"))323 WriteList(self,("h","k","l","d-sp",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #")) 324 324 if 'T' in phasDict['Type']: 325 fmt = "{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}"325 fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}" 326 326 else: 327 fmt = "{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}"327 fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}" 328 328 refList = phasDict['RefList'] 329 329 for refItem in refList: … … 331 331 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:16] 332 332 FWHM = G2pwd.getgamFW(gam,sig) 333 self.Write(fmt.format(h,k,l, pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,Prfo,i))333 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,Prfo,i)) 334 334 else: #convert to deg 335 335 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:13] … … 337 337 s = np.sqrt(max(sig,0.0001))/100. 338 338 FWHM = G2pwd.getgamFW(g,s) 339 self.Write(fmt.format(h,k,l, pos,Fobs,Fcalc,phase,mult,s,g,FWHM,Prfo,i))340 self.CloseFile() 341 print(hist+' reflections written to file '+self.fullpath)339 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,Prfo,i)) 340 self.CloseFile() 341 print(hist+' reflections written to file '+self.fullpath) 342 342 343 343 class ExportSingleCSV(G2IO.ExportBaseclass): … … 371 371 tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]] 372 372 if phasDict.get('Super',False): 373 WriteList(self,("h","k","l","m", tname,"F_obs","F_calc","phase","mult","phase #"))374 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"373 WriteList(self,("h","k","l","m",'d-sp',tname,"F_obs","F_calc","phase","mult","phase #")) 374 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}" 375 375 refList = phasDict['RefList'] 376 376 for refItem in refList: 377 377 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13] 378 self.Write(fmt.format(h,k,l,m, pos,Fobs,Fcalc,phase,mult,i))378 self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,i)) 379 379 else: 380 WriteList(self,("h","k","l", tname,"F_obs","F_calc","phase","mult","phase #"))381 fmt = "{:.0f},{:.0f},{:.0f},{:. 3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"380 WriteList(self,("h","k","l",'d-sp',tname,"F_obs","F_calc","phase","mult","phase #")) 381 fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}" 382 382 refList = phasDict['RefList'] 383 383 for refItem in refList: 384 384 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12] 385 self.Write(fmt.format(h,k,l, pos,Fobs,Fcalc,phase,mult,i))385 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,i)) 386 386 self.CloseFile() 387 387 print(hist+' written to file '+self.fullname)
Note: See TracChangeset
for help on using the changeset viewer.