Changeset 973


Ignore:
Timestamp:
Jun 28, 2013 2:28:13 PM (8 years ago)
Author:
vondreele
Message:
 
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r971 r973  
    25732573   
    25742574    def calcMDcorr(MDval,MDaxis,Uniq,G):
    2575         sumMD = len(Uniq)
    2576         if MDval != 1.0:
    2577             VA = MDaxis/np.sqrt(np.inner(MDaxis,np.inner(G,MDaxis)))
    2578             DB = np.sqrt(np.dot(Uniq[0],np.inner(G,Uniq[0])))
    2579             for H in Uniq:
    2580                 cosP2 = np.dot(VA,np.inner(G,H/DB))
    2581                 A = 1.0/np.sqrt(cosP2*MDval**2+(1.-cosP2)/MDval)
    2582                 sumMD += A**3
    2583         return sumMD/len(Uniq)
     2575        ''' Calls fortran routine'''
     2576        MDcorr = pyd.pymdcalc(MDval,MDaxis,len(Uniq),Uniq.flatten(),G)
     2577        return MDcorr
    25842578       
    2585     def mcsasfCalc(ifInv,Tdata,Mdata,Xdata,mul,FFs,Uniq,Phi):
    2586         ''' Code here needs to be in fortran'''
     2579    def mcsaMDSFcalc(ifInv,Tdata,Mdata,Xdata,MDval,MDaxis,G,mul,FFs,Uniq,Phi):
     2580        ''' Calls fortran routine'''
     2581        Icalc = pyd.pymcsamdsfcalc(ifInv,len(Tdata),Tdata,Mdata,Xdata.flatten(),
     2582            MDval,MDaxis,G,mul,len(FFs),FFs,len(Uniq),Uniq.flatten(),Phi)
     2583        return Icalc
     2584
     2585    def mcsaSFcalc(ifInv,Tdata,Mdata,Xdata,mul,FFs,Uniq,Phi):
     2586        ''' Calls fortran routine'''
    25872587        Icalc = pyd.pymcsasfcalc(ifInv,len(Tdata),Tdata,Mdata,Xdata.flatten(),
    25882588            mul,len(FFs),FFs,len(Uniq),Uniq.flatten(),Phi)
     
    26072607        for refl in refList:
    26082608            t0 = time.time()
    2609             refl[5] = mcsasfCalc(ifInv,Tdata,Mdata,Xdata,refl[3],refl[7],refl[8],refl[9])
    2610             refl[5] *= calcMDcorr(MDval,MDaxis,Uniq,Gmat)
     2609            refl[5] = mcsaMDSFcalc(ifInv,Tdata,Mdata,Xdata,MDval,MDaxis,Gmat,
     2610                refl[3],refl[7],refl[8],refl[9])
     2611#            refl[5] = mcsaSFcalc(ifInv,Tdata,Mdata,Xdata,refl[3],refl[7],refl[8],refl[9])
     2612#            refl[5] *= calcMDcorr(MDval,MDaxis,refl[8],Gmat)
    26112613            tsum += (time.time()-t0)
    26122614            sumFcsq += refl[5]
  • trunk/GSASIIspc.py

    r963 r973  
    384384    :returns: iabsnt,mulp,Uniq,phi
    385385
    386      *   iabsnt = True is reflection is forbidden by symmetry
     386     *   iabsnt = True if reflection is forbidden by symmetry
    387387     *   mulp = reflection multiplicity including Friedel pairs
    388388     *   Uniq = numpy array of equivalent hkl in descending order of h,k,l
Note: See TracChangeset for help on using the changeset viewer.