Changeset 1902


Ignore:
Timestamp:
Jun 22, 2015 11:42:30 AM (8 years ago)
Author:
vondreele
Message:

suppress editing of 1st twin element; it is always the identity matrix and frac is 1-Sum(other twin fr)
make FWHM consistent with measured FWHM for all lists & exports of peak lists.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1875 r1902  
    30873087                                for peak in peaks:
    30883088                                    if len(peak) == 8:  #CW
    3089                                         FWHM = G2pwd.getgamFW(peak[6],peak[4])
     3089                                        FWHM = 2.*G2pwd.getgamFW(peak[6],peak[4])      #to get delta-2-theta in deg. from Gam(peak)
    30903090                                        file.write("%10.5f %12.2f %10.5f %10.5f %10.5f \n" % \
    30913091                                            (peak[0],peak[2],np.sqrt(max(0.0001,peak[4]))/100.,peak[6]/100.,FWHM/100.)) #convert to deg
    30923092                                    else:               #TOF - more cols
    3093                                         FWHM = G2pwd.getgamFW(peak[10],peak[8])
     3093                                        FWHM = 2.*G2pwd.getgamFW(peak[10],peak[8])      #to get delta-TOF from Gam(peak)
    30943094                                        file.write("%10.5f %12.2f %10.3f %10.3f %10.3f %10.3f %10.3f\n" % \
    3095                                             (peak[0],peak[2],peak[4],peak[6],peak[8],peak[10],FWHM))
     3095                                            (peak[0],peak[2],np.sqrt(max(0.0001,peak[4])),peak[6],peak[8],peak[10],FWHM))
    30963096                            item2, cookie2 = self.PatternTree.GetNextChild(item, cookie2)                           
    30973097                    item, cookie = self.PatternTree.GetNextChild(self.root, cookie)                           
     
    31263126                                        file.write('%s \n'%('   h   k   l   m    d-space   2-theta       wid        F**2'))
    31273127                                    for peak in peaks['RefList']:
    3128                                         FWHM = G2pwd.getgamFW(peak[7],peak[6])/50.      #to get delta-2-theta in deg.
     3128                                        FWHM = 2.*G2pwd.getgamFW(peak[7],peak[6])
    31293129                                        if 'T' in peaks.get('Type','PXC'):
    31303130                                            file.write(" %3d %3d %3d %3d %10.5f %10.2f %10.5f %10.3f \n" % \
     
    31323132                                        else:
    31333133                                            file.write(" %3d %3d %3d %3d %10.5f %10.5f %10.5f %10.3f \n" % \
    3134                                                 (int(peak[0]),int(peak[1]),int(peak[2]),int(peak[3]),peak[4],peak[5],FWHM,peak[8]))
     3134                                                (int(peak[0]),int(peak[1]),int(peak[2]),int(peak[3]),peak[4],peak[5],FWHM/100.,peak[8]))
    31353135                            item2, cookie2 = self.PatternTree.GetNextChild(item, cookie2)                           
    31363136                    item, cookie = self.PatternTree.GetNextChild(self.root, cookie)                           
  • trunk/GSASIIddataGUI.py

    r1894 r1902  
    864864                valSizer = wx.BoxSizer(wx.HORIZONTAL)
    865865                valSizer.Add(wx.StaticText(DData,-1,label=' Twin element fraction:'),0,WACV)
    866                 twinval = wx.TextCtrl(DData,-1,'%.3f'%(TwVal),style=wx.TE_PROCESS_ENTER)
    867                 Indx[twinval.GetId()] = it
    868                 twinval.Bind(wx.EVT_TEXT_ENTER,OnTwinVal)
    869                 twinval.Bind(wx.EVT_KILL_FOCUS,OnTwinVal)
    870                 if not it:
     866                twinval = wx.TextCtrl(DData,-1,'%.3f'%(TwVal),style=Style)
     867                if it:
     868                    Indx[twinval.GetId()] = it
     869                    twinval.Bind(wx.EVT_TEXT_ENTER,OnTwinVal)
     870                    twinval.Bind(wx.EVT_KILL_FOCUS,OnTwinVal)
     871                else:
    871872                    twinval.SetBackgroundColour(VERY_LIGHT_GREY)
    872873                valSizer.Add(twinval,0,WACV)
  • trunk/GSASIIstrMath.py

    r1897 r1902  
    10271027                dFdua[iref] = 2.*SA*(dfadua[0]+dfbdua[1])+2.*SB*(dfbdua[0]+dfadua[1])
    10281028                dFdfl[iref] = -SA*dfadfl-SB*dfbdfl
    1029         dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    1030             2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     1029                dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
     1030                    2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    10311031           
    10321032        #loop over atoms - each dict entry is list of derivatives for all the reflections
  • trunk/exports/G2export_examples.py

    r1836 r1902  
    209209                    if 'T' in phasDict['Type']:
    210210                        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)
     211                        FWHM = 2.*G2pwd.getgamFW(gam,sig)
    212212                        self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,prfo))
    213213                    else:
    214214                        h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:14]
    215                         FWHM = G2pwd.getgamFW(gam,sig)
     215                        FWHM = 2.*G2pwd.getgamFW(gam,sig)
    216216                        self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult, \
    217217                            np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,prfo))
     
    230230                    if 'T' in phasDict['Type']:
    231231                        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))
     232                        FWHM = 2.*G2pwd.getgamFW(gam,sig)
     233                        self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,np.sqrt(max(sig,0.0001)),gam,FWHM,prfo))
    234234                    else:
    235235                        h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:13]
    236                         FWHM = G2pwd.getgamFW(gam,sig)
     236                        FWHM = 2.*G2pwd.getgamFW(gam,sig)
    237237                        self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,   \
    238238                            np.sqrt(max(sig,0.0001))/100.,gam/100.,FWHM/100.,prfo))
Note: See TracChangeset for help on using the changeset viewer.