Changeset 3832


Ignore:
Timestamp:
Mar 1, 2019 12:38:16 PM (4 years ago)
Author:
vondreele
Message:

fix reflection list & 3D HKL plots for modulated structures

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r3824 r3832  
    44554455        '''
    44564456        phaseName = G2frame.RefList
     4457        Super = 0
     4458        SuperVec = []
    44574459        if phaseName not in ['Unknown',]:
    44584460            pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases')
    44594461            phaseId =  G2gd.GetGPXtreeItemId(G2frame,pId,phaseName)
    44604462            General = G2frame.GPXtree.GetItemPyData(phaseId)['General']
    4461             Super = General.get('Super',0)
    4462             SuperVec = General.get('SuperVec',[])
    4463         else:
    4464             Super = 0
    4465             SuperVec = []       
     4463            if General.get('Modulated',False):
     4464                Super = 1
     4465                SuperVec = General['SuperVec']
    44664466        if 'list' in str(type(data)):   #single crystal data is 2 dict in list
    44674467            refList = data[1]['RefList']
     
    44874487        for a phase.       
    44884488        '''
     4489        Super = 0
    44894490        if phaseName not in ['Unknown',]:
    44904491            pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases')
     
    44934494                return None
    44944495            General = G2frame.GPXtree.GetItemPyData(phaseId)['General']
    4495             Super = General.get('Super',0)
    4496         else:
    4497             Super = 0
     4496            if General.get('Modulated',False):
     4497                Super = 1
    44984498        rowLabels = []
    44994499        if HKLF:
  • trunk/GSASIIstrMath.py

    r3830 r3832  
    16071607            HM = np.inner(Bmat,HP.T)                             #put into cartesian space
    16081608            HM = HM/np.sqrt(np.sum(HM**2,axis=0))               #Gdata = MAGS & HM = UVEC in magstrfc.for both OK
    1609 #            eDotK = np.sum(HM[:,:,nxs,nxs]*Kdata[:,nxs,:,:],axis=0)
     1609           
     1610            eDotK = np.sum(HM[:,:,nxs,nxs]*Kdata[:,nxs,:,:],axis=0)           
     1611            Q = HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]-Kdata[:,nxs,:,:] #Mxyz,Nref,Nop,Natm
     1612            fam0 = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*SMag[nxs,nxs,:,:]  #Mxyz,Nref,Nop,Natm
     1613            fbm0 = Q*TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*SMag[nxs,nxs,:,:]
     1614           
    16101615            eDotKM = np.sum(HM[:,:,nxs,nxs,nxs]*KMdata[:,nxs,:,:,:],axis=0)
    1611 #            Q = HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]-Kdata[:,nxs,:,:] #Mxyz,Nref,Nop,Natm
    1612             QM = HM[:,:,nxs,nxs,nxs]*eDotKM[nxs,:,:,:,:]-KMdata[:,nxs,:,:,:] #Mxyz,Nref,Nop,Natm
     1616            QM = HM[:,:,nxs,nxs,nxs]*eDotKM[nxs,:,:,:,:]-KMdata[:,nxs,:,:,:] #Mxyz,Nref,ntau,Nop,Natm
     1617            sinQM = np.sin(twopi*QM)*SMMag[nxs,nxs,:,:,:]    #Mxyz,Nref,Ntau,Nop,Natm
     1618            cosQM = np.cos(twopi*QM)*SMMag[nxs,nxs,:,:,:]
    16131619
    1614 #            fam = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*SMag[nxs,nxs,:,:]  #Mxyz,Nref,Nop,Natm
    1615 #            fbm = Q*TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*SMag[nxs,nxs,:,:]
     1620            fam = TMcorr[:,nxs,:]*cosm    #Nref,Nops,Natm
     1621            fbm = TMcorr[:,nxs,:]*sinm
    16161622           
    1617             fam = QM*TMcorr[nxs,:,nxs,nxs,:]*cosm[nxs,:,nxs,:,:]*SMMag[nxs,nxs,:,:,:]/2.    #Mxyz,Nref,Ntau,Nops,Natm
    1618             fbm = QM*TMcorr[nxs,:,nxs,nxs,:]*sinm[nxs,:,nxs,:,:]*SMMag[nxs,nxs,:,:,:]/2.
     1623            famg = fam[nxs,:,nxs,:,:]*cosQM-fbm[nxs,:,nxs,:,:]*sinQM
     1624            fbmg = fbm[nxs,:,nxs,:,:]*cosQM+fam[nxs,:,nxs,:,:]*sinQM
     1625                       
     1626            fas = np.sum(np.sum(famg,axis=-1)**2,axis=-1)      #xyz,Nref; sum ops & atoms
     1627            fbs = np.sum(np.sum(fbmg,axis=-1)**2,axis=-1)
    16191628           
    1620             fams = np.sum(fam**2,axis=2)/ngl
    1621             fbms = np.sum(fbm**2,axis=2)/ngl
    1622            
    1623             fas = np.sum(np.sum(fams,axis=-1),axis=-1)      #xyz,Nref; sum ops & atoms
    1624             fbs = np.sum(np.sum(fbms,axis=-1),axis=-1)
    1625            
    1626             refl.T[10] = np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2    #square of sums
     1629            refl.T[10] = 0.25*np.sum(np.sum(fas,axis=0)+np.sum(fbs,axis=0),axis=-1)/ngl    #square of sums
    16271630#            refl.T[11] = mphase[:,0,0]  #ignore f' & f"
    16281631           
Note: See TracChangeset for help on using the changeset viewer.