Ignore:
Timestamp:
Jul 16, 2021 9:21:10 AM (5 months ago)
Author:
vondreele
Message:

move imports to top of G2ctrlGUi code so debugger can find it
fix FillUnitCell? bug when incommensurate mag.
latest revision of incomm. mag. str. factor stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r4995 r4997  
    15321532            mXYZ = np.hstack((mXYZ,mXYZ))
    15331533
    1534         MmodA,MmodB = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
     1534        MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
    15351535       
    15361536        if not SGData['SGGray']:    #for fixed Mx,My,Mz
     
    16121612            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    16131613            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2*Nops)     #Nref,Natm
    1614             HM = np.inner(Bmat,HP.T)                    #put into cartesian space X||H,Z||H*L;
    1615             Hlen = np.sqrt(np.sum(HM**2,axis=0))
    1616             eM = (HM/Hlen).T    # normalize  HP  Nref,hkl=Unit vectors || Q
     1614            HM = np.inner(Bmat,HP.T)                #put into cartesian space X||H,Z||H*L;
     1615            eM = (HM*refl.T[5]).T                   # normalize HP by d*    Nref,hkl=Unit vectors || Q
    16171616
    16181617            if not SGData['SGGray']:     #correct -fixed Mx,My,Mz contribution             
     
    16201619                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]
    16211620#  calc mag. structure factors; Nref,Ntau,Nops,Natm,Mxyz                           
    1622             fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*cosm[i,nxs,:,:,nxs]+   
    1623                 H[3,i]*MmodB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
     1621            fams = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(
     1622                (MmodAR+H[3,i]*MmodBR)*cosm[i,nxs,:,:,nxs]+   
     1623                (-MmodAI+H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs],
     1624                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16241625                       
    1625             fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(MmodA*sinm[i,nxs,:,:,nxs]+   
    1626                 H[3,i]*MmodB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    1627 
     1626            fbms = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(H[3,i]!=0,(
     1627                (MmodAR+H[3,i]*MmodBR)*sinm[i,nxs,:,:,nxs]+   
     1628                (-MmodAI+H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs])*SGData['SpnFlp'][nxs,:,nxs,nxs],
     1629                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
     1630           
    16281631            if not SGData['SGGray']:
    16291632                fams += fam0[:,nxs,:,:,:]
     
    16341637            fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16351638# #put into cartesian space
    1636             facm = np.inner(fasm,uAmat.T)
     1639            facm = np.inner(fasm,uAmat.T)       #.T better than not
    16371640            fbcm = np.inner(fbsm,uAmat.T)
    16381641#form e.F dot product
Note: See TracChangeset for help on using the changeset viewer.