Ignore:
Timestamp:
Jul 6, 2020 1:35:05 PM (3 years ago)
Author:
vondreele
Message:

remove non gpx entries from recent projects
continue work on magnetism

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r4513 r4514  
    14861486    ast = np.sqrt(np.diag(G))
    14871487    GS = G/np.outer(ast,ast)
     1488    gs = nl.inv(GS)
    14881489    uAmat,uBmat = G2lat.Gmat2AB(GS)
    14891490    Mast = twopisq*np.multiply.outer(ast,ast)   
     
    15141515    if parmDict[pfx+'isMag']:       #This part correct for making modulated mag moments on equiv atoms - Mmod matched drawing & Bilbao drawings
    15151516   
    1516 #        mTau = np.linspace(0,1.,ngl,False)   
    15171517        mXYZ = np.array([[XYZ[0] for XYZ in list(G2spc.GenAtom(xyz,SGData,All=True,Move=True))] for xyz in (Xdata+dXdata).T]) #Natn,Nop,xyz
    15181518        if SGData['SGGray']:
     
    15971597        if 'N' in calcControls[hfx+'histType'] and parmDict[pfx+'isMag']:           
    15981598           
     1599            MmodA,MmodB = G2mth.MagMod2(H[3],glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Nref,Ntau,Nops,Natm,Mxyz
    15991600            phasem = twopi*np.inner(mXYZ,HP.T).T    #2pi(Q.r)
    16001601            cosm = np.cos(phasem)                   #Nref,nops,natm
     
    16021603            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    16031604            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2*Nops)     #Nref,Natm
    1604             HM = np.inner(uBmat,HP.T)                            #put into cartesian space X||H,Z||H*L
     1605            HM = np.inner(uAmat,HP.T)                            #put into cartesian space X||H,Z||H*L; uAmat better than uBmat
    16051606            eM = (HM/np.sqrt(np.sum(HM**2,axis=0))).T              # normalize  HP  Nref,hkl=Unit vectors || Q
    16061607
     
    16111612                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]
    16121613                           
    1613             fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*cosm[i,nxs,:,:,nxs]+    \
    1614                 np.sign(H[3,i])*MmodB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
     1614            fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA[i]*cosm[i,nxs,:,:,nxs]+   
     1615                np.sign(H[3,i])*MmodB[i]*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16151616                       
    1616             fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*sinm[i,nxs,:,:,nxs]+    \
    1617                 np.sign(H[3,i])*MmodB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
     1617            fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA[i]*sinm[i,nxs,:,:,nxs]+   
     1618                np.sign(H[3,i])*MmodB[i]*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16181619           
    16191620            if not SGData['SGGray']:
    16201621                fams += fam0[:,nxs,:,:,:]
    16211622                fbms += fbm0[:,nxs,:,:,:]
    1622             # else:
    1623             #     fams /= 2.
    1624             #     fbms /= 2.
    16251623                               
    16261624# # do sum on ops, atms 1st                       
     
    16281626            fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16291627# #put into cartesian space
    1630             facm = np.inner(fasm,uBmat.T)
     1628            facm = np.inner(fasm,uBmat.T)       #uBmat better than uAmat
    16311629            fbcm = np.inner(fbsm,uBmat.T)
    16321630# #form e.F dot product
    16331631            eDotFa = np.sum(eM[:,nxs,:]*facm,axis=-1)    #Nref,Ntau       
    16341632            eDotFb = np.sum(eM[:,nxs,:]*fbcm,axis=-1)
    1635 # #intensity
    1636             fass = np.sum((facm-eM[:,nxs,:]*eDotFa[:,:,nxs])**2,axis=-1)
    1637             fbss = np.sum((fbcm-eM[:,nxs,:]*eDotFb[:,:,nxs])**2,axis=-1)
    1638             # fass = np.sum(facm**2,axis=-1)-eDotFa**2
    1639             # fbss = np.sum(fbcm**2,axis=-1)-eDotFb**2
     1633# #intensity    Halpern & Johnson
     1634            fass = np.sum(facm**2,axis=-1)-eDotFa**2
     1635            fbss = np.sum(fbcm**2,axis=-1)-eDotFb**2
    16401636           
    16411637# #do integration           
Note: See TracChangeset for help on using the changeset viewer.