Changeset 3808 for trunk/GSASIImath.py


Ignore:
Timestamp:
Feb 3, 2019 7:35:59 AM (3 years ago)
Author:
vondreele
Message:

latest attempt at incommensurate mag str fctr & some cleanup of dead ends

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3777 r3808  
    13491349        MmodA = Am[:,:,:,nxs]*np.sin(twopi*tauM[nxs,:,nxs,:]) #atoms X waves X 3 X ngl
    13501350        MmodB = Bm[:,:,:,nxs]*np.cos(twopi*tauM[nxs,:,nxs,:]) #ditto
    1351         Mmod = np.sum(MmodA+MmodB,axis=1)                #atoms X 3 X ngl; sum waves
    1352         Mmod = np.swapaxes(Mmod,1,2)
     1351        Mmod = np.array([MmodB,MmodA])
     1352        Mmod = np.sum(Mmod,axis=2)                #atoms X 3 X ngl; sum waves
     1353        Mmod = np.swapaxes(Mmod,1,-1)       #ReIm,mxyz,Ntau,Natm
    13531354    else:
    13541355        Mmod = 1.0
    13551356    return ngl,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt
    13561357       
    1357 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt):
     1358def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
    13581359    '''
    13591360    H: array nRefBlk x ops X hklt
     
    13631364    Xmod: array atoms X 3 X ngl
    13641365    Umod: array atoms x 3x3 x ngl
    1365     Mmod: array atoms X 3 X ngl         #TODO: add mag moment modulation math
    13661366    glTau,glWt: arrays Gauss-Lorentzian pos & wts
    13671367    '''
     
    14131413    return np.array([cosHA,sinHA])             # 2 x refBlk x SGops x atoms
    14141414   
    1415 def makeWavesDerv(ngl,waveTypes,FSSdata,XSSdata,USSdata,MSSdata,Mast):
     1415def makeWavesDerv(ngl,waveTypes,FSSdata,XSSdata,USSdata,Mast):
    14161416    '''
    14171417    Only for Fourier waves for fraction, position & adp (probably not used for magnetism)
     
    14291429    Au = Mast*np.array(G2lat.U6toUij(USSdata[:6])).T   #atoms x waves x sin Uij mods
    14301430    Bu = Mast*np.array(G2lat.U6toUij(USSdata[6:])).T   #...cos Uij mods
    1431     Am = np.array(MSSdata[:3]).T   #...cos pos mods x waves x atoms
    1432     Bm = np.array(MSSdata[3:]).T   #...cos pos mods
    1433     nWaves = [Af.shape[1],Ax.shape[1],Au.shape[1],Am.shape[1]]
     1431    nWaves = [Af.shape[1],Ax.shape[1],Au.shape[1]]
    14341432    StauX = np.zeros((Ax.shape[0],Ax.shape[1],3,ngl))    #atoms x waves x 3 x ngl
    14351433    CtauX = np.zeros((Ax.shape[0],Ax.shape[1],3,ngl))
     
    14701468        UmodA = 0.
    14711469        UmodB = 0.
    1472     if nWaves[3]:
    1473         tauM = np.arange(1.,nWaves[2]+1)[:,nxs]*glTau     #Uwaves x ngl
    1474         StauM = np.ones_like(Am)[:,:,:,nxs]*np.sin(twopi*tauM)[nxs,:,nxs,:]   #also dMmodA/dAm
    1475         CtauM = np.ones_like(Bm)[:,:,:,nxs]*np.cos(twopi*tauM)[nxs,:,nxs,:]   #also dMmodB/dBm
    1476         MmodA = Am[:,:,:,nxs]*StauM #atoms x waves x 3x3 x ngl
    1477         MmodB = Bm[:,:,:,nxs]*CtauM #ditto
    1478     else:
    1479         StauM = 1.0
    1480         CtauM = 1.0
    1481         MmodA = 0.
    1482         MmodB = 0.
    1483     return waveShapes,[StauF,CtauF],[StauX,CtauX,ZtauXt,ZtauXx],[StauU,CtauU],UmodA+UmodB,[StauM,CtauM],MmodA+MmodB
     1470    return waveShapes,[StauF,CtauF],[StauX,CtauX,ZtauXt,ZtauXx],[StauU,CtauU],UmodA+UmodB
    14841471   
    14851472def ModulationDerv(H,HP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt):
Note: See TracChangeset for help on using the changeset viewer.