Changeset 1339 for trunk/GSASIIsasd.py


Ignore:
Timestamp:
May 9, 2014 2:56:31 PM (7 years ago)
Author:
vondreele
Message:

make single pattern plot the default
begin slit smearing implementation - doesn't work just yet
some tweaking of pattern plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIsasd.py

    r1337 r1339  
    10011001    return (G*P/Rg**P)*np.exp(scsp.gammaln(P/2))
    10021002   
    1003 def SmearData(Ic,Q,slitLength):
    1004     return Ic   #for now
     1003def SmearData(Ic,Q,slitLen):
     1004    Qtemp = np.concatenate([Q,20*Q])
     1005    Ictemp = np.concatenate([Ic,np.zeros_like(Ic)])
     1006    print Ictemp
     1007    Icsm = np.zeros_like(Qtemp)
     1008    Np = Q.shape[0]
     1009    Qsm = 2*slitLen*(np.interp(np.arange(2*Np)/2.,np.arange(Np),Q)-Q[0])/(Q[-1]-Q[0])
     1010    Sp = np.searchsorted(Qsm,slitLen)
     1011    for i in range(Np):
     1012        Ism = np.interp(np.sqrt(Q[i]**2+Qsm**2),Qtemp,Ictemp)
     1013        print Ism
     1014        raise Exception
     1015        Icsm[i] = np.sum(Ism[:Sp])
     1016    Icsm /= slitLen
     1017    return Icsm   #for now
    10051018   
    10061019###############################################################################
     
    12101223                    parmDict[cid+'PkSig'],parmDict[cid+'PkGam'],Q)
    12111224        Ic += parmDict['Back']  #/parmDict['Scale']
     1225        slitLen = Sample['SlitLen']
     1226        if slitLen:
     1227            Ic = SmearData(Ic,Q,slitLen)
    12121228        return Ic
    12131229       
     
    13591375            Dist.append([])
    13601376    Ic[Ibeg:Ifin] += Back[0]
     1377    slitLen = Sample['SlitLen']
     1378    if slitLen:
     1379        Ic[Ibeg:Ifin] = SmearData(Ic,Q,slitLen)[Ibeg:Ifin]
    13611380    sasdData['Size Calc'] = [Rbins,Dist]
    13621381   
Note: See TracChangeset for help on using the changeset viewer.