Changeset 4115


Ignore:
Timestamp:
Aug 26, 2019 10:41:10 AM (4 years ago)
Author:
vondreele
Message:

fix math error in making esd on d-spacing in exported single peak fit lists
add esd on intensity to these lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4110 r4115  
    41544154                            file.write('#wavelength = %10.6f\n'%(wave))
    41554155                        if 'T' in Type:
    4156                             file.write('#%9s %10s %10s %12s %10s %10s %10s %10s %10s\n'%('pos','dsp','esd','int','alp','bet','sig','gam','FWHM'))                                   
     4156                            file.write('#%9s %10s %10s %12s %10s %10s %10s %10s %10s %10s\n'%('pos','dsp','esd','int','esd','alp','bet','sig','gam','FWHM'))                                   
    41574157                        else:
    4158                             file.write('#%9s %10s %10s %12s %10s %10s %10s\n'%('pos','dsp','esd','int','sig','gam','FWHM'))
     4158                            file.write('#%9s %10s %10s %12s %10s %10s %10s %10s\n'%('pos','dsp','esd','int','esd','sig','gam','FWHM'))
    41594159                        for ip,peak in enumerate(peaks):
    41604160                            dsp = G2lat.Pos2dsp(Inst,peak[0])
     
    41654165                                sig = np.sqrt(peak[8])
    41664166                                gam = peak[10]
    4167                                 esddsp = G2lat.Pos2dsp(Inst,esds['pos'])
     4167                                esddsp = abs(G2lat.Pos2dsp(Inst,peak[0]-esds['pos'])-G2lat.Pos2dsp(Inst,peak[0]+esds['pos']))/2.
    41684168                                FWHM = G2pwd.getgamFW(gam,sig) +(peak[4]+peak[6])*np.log(2.)/(peak[4]*peak[6])     #to get delta-TOF from Gam(peak)
    4169                                 file.write("%10.2f %10.5f %10.5f %12.2f %10.3f %10.3f %10.3f %10.3f %10.3f\n" % \
    4170                                     (peak[0],dsp,esddsp,peak[2],peak[4],peak[6],peak[8],peak[10],FWHM))
     4169                                file.write("%10.2f %10.5f %10.5f %12.2f%10.2f %10.3f %10.3f %10.3f %10.3f %10.3f\n" % \
     4170                                    (peak[0],dsp,esddsp,peak[2],esds['int'],peak[4],peak[6],peak[8],peak[10],FWHM))
    41714171                            else:               #CW
    41724172                                #get esds from sigDict for each peak & put in output - esds for sig & gam from UVWXY?
     
    41764176                                sig = np.sqrt(peak[4]) #var -> sig
    41774177                                gam = peak[6]
    4178                                 esddsp = 0.5*esds['pos']*dsp/nptand(peak[0]/2.)
     4178                                esddsp = abs(G2lat.Pos2dsp(Inst,peak[0]-esds['pos'])-G2lat.Pos2dsp(Inst,peak[0]+esds['pos']))/2.
    41794179                                FWHM = G2pwd.getgamFW(gam,sig)      #to get delta-2-theta in deg. from Gam(peak)
    4180                                 file.write("%10.4f %10.5f %10.5f %12.2f %10.5f %10.5f %10.5f \n" % \
    4181                                     (peak[0],dsp,esddsp,peak[2],np.sqrt(max(0.0001,peak[4]))/100.,peak[6]/100.,FWHM/100.)) #convert to deg
     4180                                file.write("%10.4f %10.5f %10.5f %12.2f %10.2f %10.5f %10.5f %10.5f \n" % \
     4181                                    (peak[0],dsp,esddsp,peak[2],esds['int'],np.sqrt(max(0.0001,peak[4]))/100.,peak[6]/100.,FWHM/100.)) #convert to deg
    41824182                    item, cookie = self.GPXtree.GetNextChild(self.root, cookie)                           
    41834183                file.close()
Note: See TracChangeset for help on using the changeset viewer.