Changeset 1836 for trunk/exports/G2export_csv.py
- Timestamp:
- May 5, 2015 9:22:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2export_csv.py
r1791 r1836 239 239 hist = self.histnam[0] # there should only be one histogram, in any case take the 1st 240 240 histblk = self.Histograms[hist] 241 self.Write('"Histogram"') 242 self.Write('"'+hist+'"') 243 self.Write('') 241 244 # table of phases 242 245 self.Write('"Phase name","phase #"') … … 249 252 tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]] 250 253 if phasDict.get('Super',False): 251 WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM"," phase #"))254 WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #")) 252 255 if 'T' in phasDict['Type']: 253 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{: d}"256 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}" 254 257 else: 255 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{: d}"258 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}" 256 259 refList = phasDict['RefList'] 257 260 for refItem in refList: 258 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]259 FWHM = G2pwd.getgamFW(gam,sig)260 261 if 'T' in phasDict['Type']: 262 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:17] 263 FWHM = G2pwd.getgamFW(gam,sig) 261 264 self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i)) 262 265 else: #convert to deg 266 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:14] 267 FWHM = G2pwd.getgamFW(gam,sig) 263 268 self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult, \ 264 269 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,i)) 265 270 else: 266 WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM"," phase #"))271 WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #")) 267 272 if 'T' in phasDict['Type']: 268 fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{: d}"273 fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}" 269 274 else: 270 fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{: d}"275 fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}" 271 276 refList = phasDict['RefList'] 272 277 for refItem in refList: 273 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]274 FWHM = G2pwd.getgamFW(gam,sig)275 278 if 'T' in phasDict['Type']: 276 self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i)) 279 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:16] 280 FWHM = G2pwd.getgamFW(gam,sig) 281 self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,Prfo,i)) 277 282 else: #convert to deg 283 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:13] 284 FWHM = G2pwd.getgamFW(gam,sig) 278 285 self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult, \ 279 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100., i))286 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,Prfo,i)) 280 287 self.CloseFile() 281 288 print(str(hist)+'reflections written to file '+str(self.fullpath))
Note: See TracChangeset
for help on using the changeset viewer.