Changeset 354 for trunk/GSASIIpwd.py
 Timestamp:
 Aug 25, 2011 10:11:29 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIpwd.py
r353 r354 558 558 Df,dFdp,dFds,dFdg,dFdsh = pyd.pydpsvfcj(len(xdata),xdatapos,pos,sig,gam,shl) #might have to make these numpy arrays? 559 559 sumDf = np.sum(Df) 560 return Df /sumDf,dFdp,dFds,dFdg,dFdsh560 return Df,dFdp,dFds,dFdg,dFdsh 561 561 562 562 … … 679 679 dMdpk = np.zeros(shape=(6,len(xdata))) 680 680 dMdipk = getdFCJVoigt3(pos,sig,gam,shl,xdata[iBeg:iFin]) 681 for i in range( 5):682 dMdpk[i][iBeg:iFin] = 100.*dx*intens*dMdipk[i]683 dMdpk[0][iBeg:iFin] =dMdipk[0]681 for i in range(1,5): 682 dMdpk[i][iBeg:iFin] += 100.*dx*intens*dMdipk[i] 683 dMdpk[0][iBeg:iFin] += 100.*dx*dMdipk[0] 684 684 dervDict = {'int':dMdpk[0],'pos':dMdpk[1],'sig':dMdpk[2],'gam':dMdpk[3],'shl':dMdpk[4]} 685 685 if Ka2: … … 689 689 iFin = min(lenX,iFin+kdelt) 690 690 if iBegiFin: 691 dMdipk = getdFCJVoigt3(pos2,sig,gam,shl,xdata[iBeg:iFin])692 for i in range( 5):693 dMdpk[i][iBeg:iFin] += 100.*dx*intens*kRatio*dMdipk [i]694 dMdpk[0][iBeg:iFin] += kRatio*dMdipk[0]695 dMdpk[5][iBeg:iFin] += dMdipk[0]691 dMdipk2 = getdFCJVoigt3(pos2,sig,gam,shl,xdata[iBeg:iFin]) 692 for i in range(1,5): 693 dMdpk[i][iBeg:iFin] += 100.*dx*intens*kRatio*dMdipk2[i] 694 dMdpk[0][iBeg:iFin] += 100.*dx*kRatio*dMdipk2[0] 695 dMdpk[5][iBeg:iFin] += 100.*dx*dMdipk2[0] 696 696 dervDict = {'int':dMdpk[0],'pos':dMdpk[1],'sig':dMdpk[2],'gam':dMdpk[3],'shl':dMdpk[4],'L1/L2':dMdpk[5]*intens} 697 697 for parmName in ['pos','int','sig','gam']: … … 1064 1064 global parmDict2 1065 1065 parmDict2 = { 1066 'pos0':5.7,'int0':10 .0,'sig0':0.5,'gam0':1.0,1067 'U': 1.,'V':1.,'W':0.1,'X':0.0,'Y':2.,'SH/L':0.004,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, 1068 1068 'Back0':5.,'Back1':0.02,'Back2':.004, 1069 1069 'Lam1':1.540500,'Lam2':1.544300,'I(L2)/I(L1)':0.5, … … 1092 1092 if NeedTestData: TestData() 1093 1093 varyList = [name,] 1094 xdata = np.linspace(5.6,5.8, 800)1094 xdata = np.linspace(5.6,5.8,400) 1095 1095 hplot = plotter.add('derivatives test for '+name).gca() 1096 1096 hplot.plot(xdata,getPeakProfileDerv(parmDict2,xdata,varyList,bakType)[0]) … … 1107 1107 plotter = plot.PlotNotebook() 1108 1108 # test0() 1109 test2('I(L2)/I(L1)',.0001) 1109 for name in ['int0','pos0','sig0','gam0','U','V','W','X','Y','SH/L','I(L2)/I(L1)']: 1110 test2(name,.001) 1110 1111 print "OK" 1111 1112 plotter.StartEventLoop()
Note: See TracChangeset
for help on using the changeset viewer.