Changeset 3778


Ignore:
Timestamp:
Jan 10, 2019 2:10:58 PM (3 years ago)
Author:
vondreele
Message:

correct calculation of FWHM for TOF data & fix the alp values in the exported peaks table
a fix for incommensurate mag str fctr calcs

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3777 r3778  
    40084008                                gam = peak[10]
    40094009                                esddsp = G2lat.Pos2dsp(Inst,esds['pos'])
    4010                                 FWHM = G2pwd.getgamFW(gam,sig)      #to get delta-TOF from Gam(peak)
     4010                                FWHM = G2pwd.getgamFW(gam,sig) +(peak[4]+peak[6])*np.log(2.)/(peak[4]*peak[6])     #to get delta-TOF from Gam(peak)
    40114011                                file.write("%10.2f %10.5f %10.5f %12.2f %10.3f %10.3f %10.3f %10.3f %10.3f\n" % \
    4012                                     (peak[0],dsp,esddsp,peak[2],np.sqrt(max(0.0001,peak[4])),peak[6],peak[8],peak[10],FWHM))
     4012                                    (peak[0],dsp,esddsp,peak[2],peak[4],peak[6],peak[8],peak[10],FWHM))
    40134013                            else:               #CW
    40144014                                #get esds from sigDict for each peak & put in output - esds for sig & gam from UVWXY?
  • trunk/GSASIIpwd.py

    r3774 r3778  
    653653   
    654654def getFWHM(pos,Inst):
    655     '''Compute total FWHM from Thompson, Cox & Hastings (1987), J. Appl. Cryst. 20, 79-83
     655    '''Compute total FWHM from Thompson, Cox & Hastings (1987) , J. Appl. Cryst. 20, 79-83
    656656    via getgamFW(g,s).
    657657   
     
    666666    gam = lambda Th,X,Y,Z: Z+X/cosd(Th)+Y*tand(Th)
    667667    gamTOF = lambda dsp,X,Y,Z: Z+X*dsp+Y*dsp**2
     668    alpTOF = lambda dsp,alp: alp/dsp
     669    betTOF = lambda dsp,bet0,bet1,betq: bet0+bet1/dsp**4+betq/dsp**2
    668670    if 'C' in Inst['Type'][0]:
    669671        s = sig(pos/2.,Inst['U'][1],Inst['V'][1],Inst['W'][1])
     
    672674    else:
    673675        dsp = pos/Inst['difC'][0]
     676        alp = alpTOF(dsp,Inst['alpha'][0])
     677        bet = betTOF(dsp,Inst['beta-0'][0],Inst['beta-1'][0],Inst['beta-q'][0])
    674678        s = sigTOF(dsp,Inst['sig-0'][1],Inst['sig-1'][1],Inst['sig-2'][1],Inst['sig-q'][1])
    675679        g = gamTOF(dsp,Inst['X'][1],Inst['Y'][1],Inst['Z'][1])
    676         return getgamFW(g,s)
     680        return getgamFW(g,s)+np.log(2.0)*(alp+bet)/(alp*bet)
    677681   
    678682def getgamFW(g,s):
  • trunk/GSASIIstrMath.py

    r3777 r3778  
    14891489        UniqP = np.inner(HP.T,SGMT)
    14901490        Phi = np.inner(H.T,SSGT)
    1491         if SGInv:   #if centro - expand HKL sets
     1491        if SGInv and not SGData['SGFixed']:   #if centro - expand HKL sets
    14921492            Uniq = np.hstack((Uniq,-Uniq))
    14931493            Phi = np.hstack((Phi,-Phi))
     
    15201520            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    15211521            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Fdata*Mdata*MF/(2*Nops)     #Nref,Natm
    1522             if SGData['SGInv'] and not SGData['SGFixed']:
    1523                 mphase = np.hstack((phase,-phase))
    1524             else:
    1525                 mphase = phase
    1526             mphase = np.array([mphase+twopi*np.inner(cen,HP.T)[:,nxs,nxs] for cen in SGData['SGCen']])
     1522            mphase = np.array([phase+twopi*np.inner(cen,HP.T)[:,nxs,nxs] for cen in SGData['SGCen']])
    15271523            mphase = np.concatenate(mphase,axis=1)              #Nref,full Nop,Natm
    15281524            sinm = np.sin(mphase)                               #ditto - match magstrfc.for
Note: See TracChangeset for help on using the changeset viewer.