Changeset 1836
- Timestamp:
- May 5, 2015 9:22:56 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrls.py
r1832 r1836 2085 2085 if multiple: 2086 2086 if useCancel: 2087 dlg = G2 G.G2MultiChoiceDialog(2087 dlg = G2MultiChoiceDialog( 2088 2088 ParentFrame,title, header, ChoiceList) 2089 2089 else: 2090 dlg = G2 G.G2MultiChoiceDialog(2090 dlg = G2MultiChoiceDialog( 2091 2091 ParentFrame,title, header, ChoiceList, 2092 2092 style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CENTRE) -
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)) -
trunk/exports/G2export_examples.py
r1791 r1836 189 189 self.OpenFile() 190 190 hist = self.histnam[0] # there should only be one histogram, in any case take the 1st 191 self.Write('\nHistogram '+hist) 191 192 histblk = self.Histograms[hist] 192 193 for phasenam in histblk['Reflection Lists']: … … 195 196 self.Write('\nPhase '+str(phasenam)) 196 197 if phasDict.get('Super',False): 197 self.Write( 87*'=')198 self.Write(96*'=') 198 199 hklfmt = "{:.0f},{:.0f},{:.0f},{:.0f}" 199 hfmt = "{:>10s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s} "200 hfmt = "{:>10s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s} {:>8s}" 200 201 if 'T' in phasDict['Type']: 201 fmt = "{:>10s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f} "202 else: 203 fmt = "{:>10s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.5f} {:8.5f} {:8.5f} "204 self.Write(hfmt.format("h,k,l,m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM" ))205 self.Write( 87*'=')202 fmt = "{:>10s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f} {:8.4f}" 203 else: 204 fmt = "{:>10s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.5f} {:8.5f} {:8.5f} {:8.4f}" 205 self.Write(hfmt.format("h,k,l,m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo")) 206 self.Write(96*'=') 206 207 refList = phasDict['RefList'] 207 208 for refItem in refList: 208 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:12]209 FWHM = G2pwd.getgamFW(gam,sig)210 209 if 'T' in phasDict['Type']: 211 self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM)) 210 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,x,x,x,prfo = refItem[:17] 211 FWHM = G2pwd.getgamFW(gam,sig) 212 self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,prfo)) 212 213 else: 214 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:14] 215 FWHM = G2pwd.getgamFW(gam,sig) 213 216 self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult, \ 214 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100. ))217 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,prfo)) 215 218 else: 216 self.Write( 85*'=')219 self.Write(94*'=') 217 220 hklfmt = "{:.0f},{:.0f},{:.0f}" 218 hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s} "221 hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s} {:>8s}" 219 222 if 'T' in phasDict['Type']: 220 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f} "221 else: 222 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.5f} {:8.5f} {:8.5f} "223 self.Write(hfmt.format("h,k,l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM" ))224 self.Write( 85*'=')223 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f} {:8.4f}" 224 else: 225 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.5f} {:8.5f} {:8.5f} {:8.4f}" 226 self.Write(hfmt.format("h,k,l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo")) 227 self.Write(94*'=') 225 228 refList = phasDict['RefList'] 226 229 for refItem in refList: 227 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:11]228 FWHM = G2pwd.getgamFW(gam,sig)229 230 if 'T' in phasDict['Type']: 230 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM)) 231 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,x,x,x,prfo = refItem[:16] 232 FWHM = G2pwd.getgamFW(gam,sig) 233 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,prfo)) 231 234 else: 235 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:13] 236 FWHM = G2pwd.getgamFW(gam,sig) 232 237 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult, \ 233 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100. ))238 np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,prfo)) 234 239 self.CloseFile() 235 240 print(str(hist)+'reflections written to file '+str(self.fullpath))
Note: See TracChangeset
for help on using the changeset viewer.