Changeset 1836 for trunk/exports/G2export_examples.py
- Timestamp:
- May 5, 2015 9:22:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.