Changeset 1009 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Jul 24, 2013 4:39:06 PM (8 years ago)
Author:
vondreele
Message:

auto peak search for TOF - no duplicates either
small amendment to peak fit tutorial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r998 r1009  
    439439    return widths,fmin,fmax
    440440   
    441 def getFWHM(TTh,Inst):
     441def getFWHM(pos,Inst):
    442442    'needs a doc string'
    443443    sig = lambda Th,U,V,W: 1.17741*math.sqrt(max(0.001,U*tand(Th)**2+V*tand(Th)+W))*math.pi/180.
     444    sigTOF = lambda dsp,S0,S1,Sq:  S0+S1*dsp**2+Sq*dsp
    444445    gam = lambda Th,X,Y: (X/cosd(Th)+Y*tand(Th))*math.pi/180.
    445     s = sig(TTh/2.,Inst['U'][1],Inst['V'][1],Inst['W'][1])*100.
    446     g = gam(TTh/2.,Inst['X'][1],Inst['Y'][1])*100.
     446    gamTOF = lambda dsp,X,Y: X*dsp+Y*dsp**2
     447    if 'C' in Inst['Type'][0]:
     448        s = sig(pos/2.,Inst['U'][1],Inst['V'][1],Inst['W'][1])*100.
     449        g = gam(pos/2.,Inst['X'][1],Inst['Y'][1])*100.
     450    else:
     451        dsp = pos/Inst['difC'][0]
     452        s = sigTOF(dsp,Inst['sig-0'][1],Inst['sig-1'][1],Inst['sig-q'][1])
     453        g = gamTOF(dsp,Inst['X'][1],Inst['Y'][1])
    447454    return getgamFW(g,s)
    448455   
Note: See TracChangeset for help on using the changeset viewer.