Changeset 355 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Aug 25, 2011 12:14:25 PM (11 years ago)
Author:
vondreele
Message:

done with peak fitting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r354 r355  
    10641064    global parmDict2
    10651065    parmDict2 = {
    1066         'pos0':5.7,'int0':1000.0,'sig0':0.5,'gam0':1.0,
    1067         'U':2.,'V':-2.,'W':5.,'X':1.0,'Y':2.,'SH/L':0.01,
     1066        'pos0':5.7,'int0':1000.0,'sig0':0.5,'gam0':0.5,
     1067        'U':2.,'V':-2.,'W':5.,'X':0.5,'Y':0.5,'SH/L':0.02,
    10681068        'Back0':5.,'Back1':-0.02,'Back2':.004,
    1069         'Lam1':1.540500,'Lam2':1.544300,'I(L2)/I(L1)':0.5,
     1069#        'Lam1':1.540500,'Lam2':1.544300,'I(L2)/I(L1)':0.5,
    10701070        }
    10711071    global varyList
     
    11001100    hplot.plot(xdata,(y1-y0)/delt,'r+')
    11011101   
    1102    
     1102def test3(name,delt):
     1103    if NeedTestData: TestData()
     1104    names = ['pos','sig','gam','shl']
     1105    idx = names.index(name)
     1106    myDict = {'pos':parmDict2['pos0'],'sig':parmDict2['sig0'],'gam':parmDict2['gam0'],'shl':parmDict2['SH/L']}
     1107    xdata = np.linspace(5.6,5.8,800)
     1108    dx = xdata[1]-xdata[0]
     1109    hplot = plotter.add('derivatives test for '+name).gca()
     1110    hplot.plot(xdata,100.*dx*getdFCJVoigt3(myDict['pos'],myDict['sig'],myDict['gam'],myDict['shl'],xdata)[idx+1])
     1111    y0 = getFCJVoigt3(myDict['pos'],myDict['sig'],myDict['gam'],myDict['shl'],xdata)
     1112    myDict[name] += delt
     1113    y1 = getFCJVoigt3(myDict['pos'],myDict['sig'],myDict['gam'],myDict['shl'],xdata)
     1114    hplot.plot(xdata,(y1-y0)/delt,'r+')
    11031115
    11041116if __name__ == '__main__':
     
    11071119    plotter = plot.PlotNotebook()
    11081120#    test0()
    1109     for name in ['int0','pos0','sig0','gam0','U','V','W','X','Y','SH/L','I(L2)/I(L1)']:
    1110         test2(name,.001)
     1121#    for name in ['int0','pos0','sig0','gam0','U','V','W','X','Y','SH/L','I(L2)/I(L1)']:
     1122    for name,shft in [['int0',0.1],['pos0',0.0001],['sig0',0.01],['gam0',0.00001],
     1123        ['U',0.1],['V',0.01],['W',0.01],['X',0.0001],['Y',0.0001],['SH/L',0.00005]]:
     1124        test2(name,shft)
     1125    for name,shft in [['pos',0.0001],['sig',0.01],['gam',0.0001],['shl',0.00005]]:
     1126        test3(name,shft)
    11111127    print "OK"
    11121128    plotter.StartEventLoop()
Note: See TracChangeset for help on using the changeset viewer.