Changeset 4999 for trunk/GSASIImath.py


Ignore:
Timestamp:
Jul 22, 2021 2:09:36 PM (3 months ago)
Author:
vondreele
Message:

change incommensurate magneti str. fctr. equations
avoid search for modulation vector when no peaks were fitted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4997 r4999  
    17151715    if nWaves[3]:
    17161716        tauM = np.arange(1.,nWaves[3]+1-nx)[:,nxs]*mglTau  #Mwaves x ngl
    1717         MmodA = Am[:,:,:,nxs]*np.sin(twopi*tauM[nxs,:,nxs,:]) #atoms X waves X 3 X ngl
     1717        MmodA = Am[:,:,:,nxs]*np.sin(twopi*tauM[nxs,:,nxs,:]) #atoms X waves X 3 X tau
    17181718        MmodB = Bm[:,:,:,nxs]*np.cos(twopi*tauM[nxs,:,nxs,:]) #ditto
    17191719        Mmod = np.sum(MmodA+MmodB,axis=1)
     
    17441744        Sinv = np.vstack((Sinv,Sinv))
    17451745        SGT = np.vstack((SGT,SGT+np.array([0.,0.,0.,.5])))%1.
    1746     mst = Sinv[:,3,:3]
    17471746    epsinv = Sinv[:,3,3]
     1747    mst = np.inner(Sinv[:,:3,:3],modQ)-epsinv[:,nxs]*modQ   #van Smaalen Eq. 3.3
    17481748    phi = np.inner(XYZ,modQ).T
    17491749    TA = np.sum(mst[nxs,:,:]*(XYZ-SGT[:,:3][nxs,:,:]),axis=-1).T
    1750     phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]-SGT[:,3][nxs,:,nxs]+phi[nxs,:,:])
     1750    phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]+phi[nxs,:,:])+SGT[:,3][nxs,:,nxs]
    17511751    psin = np.sin(twopi*phase)
    17521752    pcos = np.cos(twopi*phase)
     
    17591759    MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1)
    17601760    MmodBI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBI[:,:,:,nxs,:],axis=-1)
    1761     return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; cos & sin parts; sum matches drawn atom moments
     1761    return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; cos & sin parts
    17621762       
    17631763def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
Note: See TracChangeset for help on using the changeset viewer.