Changeset 4182


Ignore:
Timestamp:
Oct 18, 2019 3:01:27 PM (4 years ago)
Author:
vondreele
Message:

mag. str. fctr. changes

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4176 r4182  
    13781378    Sinv = np.vstack([Sinv for cen in SGData['SGCen']])
    13791379    SGT = np.vstack([SGT+cen for cen in SSGData['SSGCen']])%1.
     1380    if SGData['SGGray']:
     1381        SGMT = np.vstack((SGMT,SGMT))
     1382        Sinv =np.vstack((Sinv,Sinv))
     1383        SGT = np.vstack((SGT,SGT+.5))%1.
    13801384    detSM = nl.det(SGMT)
    13811385    mst = Sinv[:,3,:3]
     
    13901394    MmodA = np.sum(Am[nxs,nxs,:,:,:]*pcos[:,:,:,nxs,nxs],axis=3)    #cos term
    13911395    MmodB = np.sum(Bm[nxs,nxs,:,:,:]*psin[:,:,:,nxs,nxs],axis=3)    #sin term
    1392     if SGData['SGGray']:
    1393         MmodA = -np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*detSM[nxs,:,nxs,nxs]
    1394         MmodB = -np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*detSM[nxs,:,nxs,nxs]
    1395     else:
    1396         MmodA = np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*SGData['MagMom'][nxs,:,nxs,nxs]
    1397         MmodB = np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*SGData['MagMom'][nxs,:,nxs,nxs]
     1396#    if SGData['SGGray']:
     1397#        MmodA = -np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*detSM[nxs,:,nxs,nxs]
     1398#        MmodB = -np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*detSM[nxs,:,nxs,nxs]
     1399#    else:
     1400    MmodA = np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*SGData['MagMom'][nxs,:,nxs,nxs]
     1401    MmodB = np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*SGData['MagMom'][nxs,:,nxs,nxs]
    13981402    return MmodB,MmodA    #Ntau,Nops,Natm,,Mxyz; cos & sin parts; sum matches drawn atom moments
    13991403       
  • trunk/GSASIIstrMath.py

    r4175 r4182  
    14891489    Ncen = len(SGData['SGCen'])
    14901490    Nops = len(SGMT)*(1+SGData['SGInv'])
     1491    if SGData['SGGray']:
     1492        Nops *= 2
    14911493    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    14921494    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
     
    15101512       
    15111513        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
     1514        if SGData['SGGray']:
     1515            mXYZ = np.hstack((mXYZ,mXYZ))
    15121516        MmodA,MmodB = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sim parts sum matches drawing
    15131517        Mmod = MmodA+MmodB
     
    16361640            fass = np.sum(facm**2,axis=-1)-eDotFa**2
    16371641            fbss = np.sum(fbcm**2,axis=-1)-eDotFb**2
    1638 #do integration           
     1642#do integration
     1643           
    16391644            fas = np.sum(glWt*fass,axis=1)/2.
    16401645            fbs = np.sum(glWt*fbss,axis=1)/2.
    16411646           
     1647            if SGData['SGInv']:
     1648                fbs *= 4.
     1649                fas = 0.
     1650           
    16421651            refl.T[10] = fas+fbs   #Sum(fams**2,Mxyz) Re + Im
    1643             refl.T[11] = atan2d(fbs,fas) #- what is phase for mag refl?
     1652            refl.T[11] = atan2d(fbs,fas)
    16441653
    16451654        else:
Note: See TracChangeset for help on using the changeset viewer.