Changeset 1773 for trunk/exports


Ignore:
Timestamp:
Apr 2, 2015 10:56:59 AM (7 years ago)
Author:
vondreele
Message:

provide sig,gam & FWHM in export of PWDR reflection set as csv & txt files
add penalty fxn stuff for sph. harm. preferred orientation correction
allow editing of ODF coeff.
fix reading of fcf files

Location:
trunk/exports
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_csv.py

    r1762 r1773  
    2424import GSASIIobj as G2obj
    2525import GSASIImath as G2mth
     26import GSASIIpwd as G2pwd
    2627
    2728def WriteList(obj,headerItems):
     
    248249            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
    249250            if phasDict.get('Super',False):
    250                 WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","phase #"))
    251                 fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     251                WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","phase #"))
     252                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:d}"
    252253                refList = phasDict['RefList']
    253254                for refItem in refList:
    254255                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
    255                     self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
     256                    FWHM = G2pwd.getgamFW(gam,sig)
     257                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i))               
    256258            else:
    257                 WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","phase #"))
    258                 fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     259                WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","phase #"))
     260                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:d}"
    259261                refList = phasDict['RefList']
    260262                for refItem in refList:
    261263                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
    262                     self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
     264                    FWHM = G2pwd.getgamFW(gam,sig)
     265                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i))
    263266        self.CloseFile()
    264267        print(str(hist)+'reflections written to file '+str(self.fullpath))
  • trunk/exports/G2export_examples.py

    r1762 r1773  
    2828#import GSASIIstrIO as G2stIO
    2929import GSASIImath as G2mth
     30import GSASIIpwd as G2pwd
    3031#import GSASIIlattice as G2lat
    3132#import GSASIIspc as G2spc
     
    192193            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
    193194            self.Write('\nPhase '+str(phasenam))
    194             self.Write(80*'=')
    195195            if phasDict.get('Super',False):
     196                self.Write(87*'=')
    196197                hklfmt = "{:.0f},{:.0f},{:.0f},{:.0f}"
    197                 hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s}"
    198                 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f}"
    199                 self.Write(hfmt.format("h,k,l,m",tname,"F_obs","F_calc","phase","mult"))
    200                 self.Write(80*'=')
     198                hfmt = "{:>10s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s}"
     199                fmt = "{:>10s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f}"
     200                self.Write(hfmt.format("h,k,l,m",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM"))
     201                self.Write(87*'=')
    201202                refList = phasDict['RefList']
    202203                for refItem in refList:
    203204                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:12]
    204                     self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult))
     205                    FWHM = G2pwd.getgamFW(gam,sig)
     206                    self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM))
    205207            else:
     208                self.Write(85*'=')
    206209                hklfmt = "{:.0f},{:.0f},{:.0f}"
    207                 hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s}"
    208                 fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f}"
    209                 self.Write(hfmt.format("h,k,l",tname,"F_obs","F_calc","phase","mult"))
    210                 self.Write(80*'=')
     210                hfmt = "{:>8s} {:>8s} {:>12s} {:>12s} {:>7s} {:>6s} {:>8s} {:>8s} {:>8s}"
     211                fmt = "{:>8s} {:8.3f} {:12.3f} {:12.3f} {:7.2f} {:6.0f} {:8.3f} {:8.3f} {:8.3f}"
     212                self.Write(hfmt.format("h,k,l",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM"))
     213                self.Write(85*'=')
    211214                refList = phasDict['RefList']
    212215                for refItem in refList:
    213216                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase = refItem[:11]
    214                     self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult))
     217                    FWHM = G2pwd.getgamFW(gam,sig)
     218                    self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM))
    215219        self.CloseFile()
    216220        print(str(hist)+'reflections written to file '+str(self.fullpath))                       
Note: See TracChangeset for help on using the changeset viewer.