Changeset 4016


Ignore:
Timestamp:
Jun 6, 2019 12:13:45 AM (3 years ago)
Author:
vondreele
Message:

fix problem if magcells True but no list of them (in Unit Cells List)
some cleanup in incommensurate mag str. fctr.; comment some dead code

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4014 r4016  
    13641364    fxn of ngl tau points
    13651365    '''
    1366     Bm = np.array(MSSdata[:3]).T   #atoms x waves x sin pos mods
    1367     Am = np.array(MSSdata[3:]).T  #...cos pos mods
     1366    Am = np.array(MSSdata[:3]).T   #atoms x waves x sin pos mods
     1367    Bm = np.array(MSSdata[3:]).T  #...cos pos mods
    13681368    nWaves = Am.shape[1]
    13691369    tau = np.arange(ngl)/ngl
     
    13901390    psin = np.sin(twopi*phase)
    13911391    pcos = np.cos(twopi*phase)
    1392     MmodA = np.sum(Am[nxs,nxs,:,:,:]*pcos[:,:,:,nxs,nxs],axis=3)
    1393     MmodB = np.sum(Bm[nxs,nxs,:,:,:]*psin[:,:,:,nxs,nxs],axis=3)
     1392    MmodB = np.sum(Bm[nxs,nxs,:,:,:]*pcos[:,:,:,nxs,nxs],axis=3)
     1393    MmodA = np.sum(Am[nxs,nxs,:,:,:]*psin[:,:,:,nxs,nxs],axis=3)
    13941394    if SGData['SGGray']:
    13951395        MmodA = -np.sum(SGMT[nxs,:,nxs,:,:]*MmodA[:,:,:,nxs,:],axis=-1)*detSM[nxs,:,nxs,nxs]
     
    13991399        MmodB = np.sum(SGMT[nxs,:,nxs,:,:]*MmodB[:,:,:,nxs,:],axis=-1)*SGData['MagMom'][nxs,:,nxs,nxs]
    14001400    Mmod = MmodA+MmodB
    1401     return Mmod,MmodA,MmodB    #Ntau,Nops,Natm,,Mxyz; sum,Re & Im parts
     1401    return Mmod,MmodA,MmodB    #Ntau,Nops,Natm,,Mxyz; sum,sin & cos parts
    14021402       
    14031403def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
  • trunk/GSASIIpwdGUI.py

    r3999 r4016  
    43854385                    gridDisplay.SetReadOnly(r,c,isReadOnly=True)
    43864386        mainSizer.Add(gridDisplay,0,WACV)
    4387     if magcells:
     4387    if magcells and len(controls) > 16:
    43884388        itemList = [phase.get('gid',ip+1) for ip,phase in enumerate(magcells)]
    43894389        phaseDict = dict(zip(itemList,magcells))
  • trunk/GSASIIstrMath.py

    r3906 r4016  
    15121512        Tmag,TmagA,TmagB = G2mth.MagMod(ngl,mXYZ,modQ,MSSdata,SGData,SSGData)   #Ntau,Nops,Natm,Mxyz-Tmag matches drawing moments
    15131513       
    1514         if not SGData['SGGray']:
     1514        if not SGData['SGGray']:    #for fixed Mx,My,Mz
    15151515            Mmod += Gdata.T[:,nxs,:]
    15161516            GSdata = np.inner(Gdata.T,np.swapaxes(SGMT,1,2))  #apply sym. ops.--> Natm,Nops,Nxyz
     
    15201520            GSdata = SGData['MagMom'][nxs,:,nxs]*GSdata   #flip vectors according to spin flip * det(opM)
    15211521            GSdata = np.swapaxes(GSdata,0,1)    #Nop,Natm,Mxyz
    1522             Tmag += Gdata.T[nxs,nxs,:,:]
    1523            
    1524         TmagC = np.inner(Tmag,uAmat.T)   #make cartesian; Ntau,Nops,Natm,,Mxyz
    1525         Smag = np.sqrt(np.sum(TmagC**2,axis=-1))
    1526         Kmag = TmagC/Smag[:,:,:,nxs]
     1522#            Tmag += Gdata.T[nxs,nxs,:,:]
     1523#           
     1524#        TmagC = np.inner(Tmag,uAmat.T)   #make cartesian; Ntau,Nops,Natm,,Mxyz
     1525#        Smag = np.sqrt(np.sum(TmagC**2,axis=-1))
     1526#        Kmag = TmagC/Smag[:,:,:,nxs]
    15271527
    15281528    FF = np.zeros(len(Tdata))
     
    16051605            fas0 = 0.
    16061606            fbs0 = 0.
    1607             if not SGData['SGGray']:                     
     1607            if not SGData['SGGray']:     #correct -fixed Mx,My,Mz contribution             
    16081608                fam0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*cosm[:,:,:,nxs]    #Nref,Nops,Natm,Mxyz
    16091609                fbm0 = TMcorr[:,nxs,:,nxs]*GSdata[nxs,:,:,:]*sinm[:,:,:,nxs]   
     
    16161616#for modulated moments --> m != 0 reflections
    16171617            M = np.array(np.abs(H[3]),dtype=np.int)-1
    1618             fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*cosm[i,nxs,:,:,nxs]-np.sign(H[3])[i]*TmagB*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
    1619             fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagA*sinm[i,nxs,:,:,nxs]+np.sign(H[3])[i]*TmagB*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
     1618       
     1619            fam = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*cosm[i,nxs,:,:,nxs]-    \
     1620                np.sign(H[3,i])*TmagA*sinm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
     1621            fbm = TMcorr[:,nxs,nxs,:,nxs]*np.array([np.where(M[i]>=0,(TmagB*sinm[i,nxs,:,:,nxs]+    \
     1622                np.sign(H[3,i])*TmagA*cosm[i,nxs,:,:,nxs]),0.) for i in range(mRef)])
    16201623                       
    16211624            famq = np.sum(np.sum(fam/2.,axis=-2),axis=-2)      #Nref,Mxyz; sum ops & atoms
Note: See TracChangeset for help on using the changeset viewer.