Changeset 866
- Timestamp:
- Mar 19, 2013 3:12:46 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstruct.py
r864 r866 1728 1728 if Inst[item][2]: 1729 1729 insVary.append(insName) 1730 instDict[pfx+'X'] = max(instDict[pfx+'X'],0.001)1731 instDict[pfx+'Y'] = max(instDict[pfx+'Y'],0.001)1730 # instDict[pfx+'X'] = max(instDict[pfx+'X'],0.001) 1731 # instDict[pfx+'Y'] = max(instDict[pfx+'Y'],0.001) 1732 1732 instDict[pfx+'SH/L'] = max(instDict[pfx+'SH/L'],0.0005) 1733 1733 return dataType,instDict,insVary … … 2787 2787 if calcControls[phfx+'SizeType'] == 'isotropic': 2788 2788 Sgam = 1.8*wave/(np.pi*parmDict[phfx+'Size;i']*costh) 2789 gamDict[phfx+'Size;i'] = - 900.*wave*parmDict[phfx+'Size;mx']/(np.pi*costh)2790 sigDict[phfx+'Size;i'] = - 1800.*Sgam*wave*(1.-parmDict[phfx+'Size;mx'])**2/(np.pi*costh*ateln2)2789 gamDict[phfx+'Size;i'] = -1.8*wave*parmDict[phfx+'Size;mx']/(np.pi*costh) 2790 sigDict[phfx+'Size;i'] = -3.6*Sgam*wave*(1.-parmDict[phfx+'Size;mx'])**2/(np.pi*costh*ateln2) 2791 2791 elif calcControls[phfx+'SizeType'] == 'uniaxial': 2792 2792 H = np.array(refl[:3]) … … 2976 2976 hfx = ':%d:'%(hId) 2977 2977 Limits = calcControls[hfx+'Limits'] 2978 shl = max(parmDict[hfx+'SH/L'],0.00 2)2978 shl = max(parmDict[hfx+'SH/L'],0.0005) 2979 2979 Ka2 = False 2980 2980 kRatio = 0.0 -
trunk/testGSASIIstruct.py
r762 r866 34 34 data = Histogram['Data'] 35 35 xdata = data[0] 36 xB = np.searchsorted(xdata,limits[0]) 37 xF = np.searchsorted(xdata,limits[1]) 36 38 fplot = plotter.add('function test').gca() 37 yc,yb = G2st.getPowderProfile(parmDict,xdata ,varylist,Histogram,Phases,calcControls,pawleyLookup)38 fplot.plot(xdata ,yc+yb,'r')39 yc,yb = G2st.getPowderProfile(parmDict,xdata[xB:xF],varylist,Histogram,Phases,calcControls,pawleyLookup) 40 fplot.plot(xdata[xB:xF],yc+yb,'r') 39 41 40 42 def test2(name,delt): … … 44 46 data = Histogram['Data'] 45 47 xdata = data[0] 48 xB = np.searchsorted(xdata,limits[0]) 49 xF = np.searchsorted(xdata,limits[1]) 46 50 hplot = plotter.add('derivatives test for '+name).gca() 47 ya = G2st.getPowderProfileDerv(parmDict,xdata ,varyList,Histogram,Phases,calcControls,pawleyLookup)[0]48 hplot.plot(xdata ,ya)51 ya = G2st.getPowderProfileDerv(parmDict,xdata[xB:xF],varyList,Histogram,Phases,calcControls,pawleyLookup)[0] 52 hplot.plot(xdata[xB:xF],ya,'b') 49 53 if 'dA' in name: 50 54 name = ''.join(name.split('d')) 51 55 varyList = [name,] 52 56 parmDict[name] -= delt 53 y0,yb = G2st.getPowderProfile(parmDict,xdata ,varyList,Histogram,Phases,calcControls,pawleyLookup)57 y0,yb = G2st.getPowderProfile(parmDict,xdata[xB:xF],varyList,Histogram,Phases,calcControls,pawleyLookup) 54 58 y0 += yb 55 59 parmDict[name] += 2.*delt 56 y1,yb = G2st.getPowderProfile(parmDict,xdata ,varyList,Histogram,Phases,calcControls,pawleyLookup)60 y1,yb = G2st.getPowderProfile(parmDict,xdata[xB:xF],varyList,Histogram,Phases,calcControls,pawleyLookup) 57 61 y1 += yb 58 62 yn = (y1-y0)/(2.*delt) 59 hplot.plot(xdata ,yn,'r+')60 hplot.plot(xdata ,ya-yn)63 hplot.plot(xdata[xB:xF],yn,'r+') 64 hplot.plot(xdata[xB:xF],ya-yn,'g') 61 65 62 66 if __name__ == '__main__': … … 71 75 print name,parmDict[name] 72 76 names = [ 73 ['0:0:Size:mx',0.001], 74 ['0:0:Mustrain:mx',0.001], 75 ['0:0:Size:i',0.001], 76 ['0:0:Mustrain:i',0.1], 77 ['0:0:Size;i',0.01], 78 ['0:0:Mustrain:0',0.001], 79 ['0:0:Mustrain:1',0.001], 77 80 ] 78 81 for [name,delt] in names:
Note: See TracChangeset
for help on using the changeset viewer.