Changeset 2129 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Jan 21, 2016 10:25:48 AM (9 years ago)
Author:
vondreele
Message:

revisions to FWHM calculations - some math errors fixed
implement merge fully - Laue groups still need work
triclinic, monoclinic & orthorhombic OK, others not

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIpwd.py

    r2049 r2129  
    457457def getWidthsCW(pos,sig,gam,shl):
    458458    '''Compute the peak widths used for computing the range of a peak
    459     for constant wavelength data.
    460     On low-angle side, 10 FWHM are used, on high-angle side 15 are used
     459    for constant wavelength data. On low-angle side, 10 FWHM are used,
     460    on high-angle side 15 are used, low angle side extended by axial divergence
    461461    (for peaks above 90 deg, these are reversed.)
    462462    '''
    463     widths = [np.sqrt(sig)/100.,gam/200.]
    464     fwhm = 2.355*widths[0]+2.*widths[1]
     463    widths = [np.sqrt(sig)/100.,gam/100.]
     464    fwhm = 2.355*widths[0]+widths[1]
    465465    fmin = 10.*(fwhm+shl*abs(npcosd(pos)))
    466466    fmax = 15.0*fwhm
     
    470470   
    471471def getWidthsTOF(pos,alp,bet,sig,gam):
    472     'needs a doc string'
     472    '''Compute the peak widths used for computing the range of a peak
     473    for constant wavelength data. 10 FWHM are used on both sides each
     474    extended by exponential coeff.
     475    '''
    473476    lnf = 3.3      # =log(0.001/2)
    474477    widths = [np.sqrt(sig),gam]
     
    494497   
    495498def getgamFW(g,s):
    496     'needs a doc string'
     499    '''Compute total FWHM from Thompson, Cox & Hastings (1987), J. Appl. Cryst. 20, 79-83
     500   
     501    :param g: float Lorentzian FWHM
     502    :param s: float Gaussian FWHM
     503   
     504    :returns float: total FWHM of pseudoVoigt
     505    '''
    497506    gamFW = lambda s,g: np.exp(np.log(s**5+2.69269*s**4*g+2.42843*s**3*g**2+4.47163*s**2*g**3+0.07842*s*g**4+g**5)/5.)
    498     return gamFW(g,s)
     507    return gamFW(s,g)
    499508               
    500509def getFCJVoigt(pos,intens,sig,gam,shl,xdata):   
     
    901910                else:
    902911                    sig = G2mth.getCWsig(parmDict,tth)
    903                 sig = max(sig,0.001)          #avoid neg sigma
     912                sig = max(sig,0.001)          #avoid neg sigma^2
    904913                gamName = 'gam'+str(iPeak)
    905914                if gamName in varyList:
Note: See TracChangeset for help on using the changeset viewer.