Changeset 2546 for trunk/GSASIIpwd.py
 Timestamp:
 Nov 22, 2016 1:08:48 PM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIpwd.py
r2522 r2546 20 20 21 21 import numpy as np 22 import scipy as sp23 22 import numpy.linalg as nl 24 23 import numpy.ma as ma … … 34 33 import GSASIIspc as G2spc 35 34 import GSASIIElem as G2elem 36 import GSASIIgrid as G2gd37 import GSASIIIO as G2IO38 35 import GSASIImath as G2mth 39 36 import pypowder as pyd … … 180 177 181 178 Sth2 = npsind(Tth/2.0)**2 182 Cth2 = 1.Sth2183 179 if 'Cylinder' in Geometry: #Lobanov & Alte da Veiga for 2theta = 0; beam fully illuminates sample 184 180 if 'array' in str(type(MuR)): … … 308 304 #Apply angle dependent corrections 309 305 Tth = xydata['IofQ'][1][0] 310 dt = (Tth[1]Tth[0])311 306 MuR = Abs*data['Diam']/20.0 312 307 xydata['IofQ'][1][1] /= Absorb(data['Geometry'],MuR,Tth) … … 318 313 #convert to Q 319 314 if 'C' in inst['Type'][0]: 320 hc = 12.397639321 315 wave = G2mth.getWave(inst) 322 keV = hc/wave323 316 minQ = npT2q(Tth[0],wave) 324 317 maxQ = npT2q(Tth[1],wave) … … 559 552 extended by exponential coeff. 560 553 ''' 561 lnf = 3.3 # =log(0.001/2)562 554 widths = [np.sqrt(sig),gam] 563 555 fwhm = 2.355*widths[0]+2.*widths[1] … … 887 879 Df,dFdp,dFds,dFdg,dFdsh = pyd.pydpsvfcj(len(xdata),xdatapos,pos,sig,gam,shl) 888 880 # Df,dFdp,dFds,dFdg,dFdsh = pyd.pydpsvfcjo(len(xdata),xdatapos,pos,sig,gam,shl) 889 sumDf = np.sum(Df)890 881 return Df,dFdp,dFds,dFdg,dFdsh 891 882 … … 901 892 902 893 Df,dFdp,dFds,dFdg = pyd.pydpsvoigt(len(xdata),xdatapos,sig,gam) 903 sumDf = np.sum(Df)904 894 return Df,dFdp,dFds,dFdg 905 895 … … 913 903 'needs a doc string' 914 904 Df,dFdp,dFda,dFdb,dFds,dFdg = pyd.pydepsvoigt(len(xdata),xdatapos,alp,bet,sig,gam) 915 sumDf = np.sum(Df)916 905 return Df,dFdp,dFda,dFdb,dFds,dFdg 917 906 … … 1688 1677 if controls: 1689 1678 Ftol = controls['min dM/M'] 1690 derivType = controls['deriv type']1691 1679 else: 1692 1680 Ftol = 0.0001 1693 derivType = 'analytic'1694 1681 if oneCycle: 1695 1682 Ftol = 1.0 … … 1825 1812 Parms = [] 1826 1813 #cell parms 1827 cell = Layers['Cell']1828 1814 if Layers['Laue'] in ['3','3m','4/m','4/mmm','6/m','6/mmm']: 1829 1815 Parms.append('cellA') … … 1836 1822 Parms.append('cellG') 1837 1823 #Transition parms 1838 Trans = Layers['Transitions']1839 1824 for iY in range(len(Layers['Layers'])): 1840 1825 for iX in range(len(Layers['Layers'])): … … 2044 2029 SFdat = [] 2045 2030 for atType in atTypes: 2046 if atType == 'H':2047 blen = .37412048 else:2049 blen = Layers['AtInfo'][atType]['Isotopes']['Nat. Abund.']['SL'][0]2050 2031 Adat = atmdata.XrayFF[atType] 2051 2032 SF = np.zeros(9) … … 2206 2187 SetStackingTrans(Layers,Nlayers) 2207 2188 # result as Sadp 2208 mirror = laueId in [1,2,3,7,8,9,10]2209 2189 Nspec = 20001 2210 2190 spec = np.zeros(Nspec,dtype='double') … … 2237 2217 'needs a doc string' 2238 2218 # global NeedTestData 2239 NeedTestData = False2240 2219 global bakType 2241 2220 bakType = 'chebyschev' … … 2275 2254 def test0(): 2276 2255 if NeedTestData: TestData() 2277 msg = 'test '2278 2256 gplot = plotter.add('FCJVoigt, 11BM').gca() 2279 2257 gplot.plot(xdata,getBackground('',parmDict0,bakType,'PXC',xdata)[0]) … … 2287 2265 time0 = time.time() 2288 2266 for i in range(100): 2289 y =getPeakProfile(parmDict1,xdata,varyList,bakType)2267 getPeakProfile(parmDict1,xdata,varyList,bakType) 2290 2268 print '100+6*Ka12 peaks=1200 peaks',time.time()time0 2291 2269
Note: See TracChangeset
for help on using the changeset viewer.