Changeset 3870 for trunk/GSASIIstrMath.py
- Timestamp:
- Apr 3, 2019 10:59:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMath.py
r3867 r3870 1598 1598 TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Fdata*Mdata*MF/(2*Nops) #Nref,Natm 1599 1599 1600 HM = np.inner(Bmat,HP.T) #put into cartesian space1601 HM = HM/np.sqrt(np.sum(HM**2,axis=0)) #& normalize1602 1600 # HM = np.inner(Bmat,HP.T) #put into cartesian space 1601 # HM = HM/np.sqrt(np.sum(HM**2,axis=0)) #& normalize 1602 # 1603 1603 # fam = TMcorr[:,nxs,nxs,:,nxs]*Tmag[nxs,:,:,:,:]*cosm[:,nxs,:,:,nxs] #Nref,Ntau,Nops,Natm,Mxyz 1604 1604 # fbm = TMcorr[:,nxs,nxs,:,nxs]*Tmag[nxs,:,:,:,:]*sinm[:,nxs,:,:,nxs] … … 1620 1620 # fbs = np.sum(fbmq,axis=-1)**2-np.sum(HM.T*fbmq,axis=-1)**2 1621 1621 #from #3812 1622 D = twopi*H.T[:,3:]*glTau[nxs,:]1623 mphase = phase[:,:,nxs,:]+D[:,nxs,:,nxs]1624 mphase = np.array([mphase+twopi*np.inner(cen,HP.T)[:,nxs,nxs,nxs] for cen in SGData['SGCen']])1625 mphase = np.concatenate(mphase,axis=1) #remove extra axis; Nref,Nop,Ntau,Natm1626 sinm = np.swapaxes(np.sin(mphase),1,2) #--> Nref,Nop,Natm,Ntau1627 cosm = np.swapaxes(np.cos(mphase),1,2) #ditto1622 # D = twopi*H.T[:,3:]*glTau[nxs,:] 1623 # mphase = phase[:,:,nxs,:]+D[:,nxs,:,nxs] 1624 # mphase = np.array([mphase+twopi*np.inner(cen,HP.T)[:,nxs,nxs,nxs] for cen in SGData['SGCen']]) 1625 # mphase = np.concatenate(mphase,axis=1) #remove extra axis; Nref,Nop,Ntau,Natm 1626 # sinm = np.swapaxes(np.sin(mphase),1,2) #--> Nref,Nop,Natm,Ntau 1627 # cosm = np.swapaxes(np.cos(mphase),1,2) #ditto 1628 1628 1629 1629 HM = np.inner(Bmat,HP.T) #put into cartesian space … … 1632 1632 Q = HM.T[:,nxs,nxs,nxs,:]*eDotK[:,:,:,:,nxs]-Kmag[nxs,:,:,:,:] #Nref,Ntau,Nop,Natm,Mxyz 1633 1633 1634 fam = (Q*TMcorr[:,nxs,nxs,:,nxs]*cosm[:, :,:,:,nxs]*Smag[nxs,:,:,:,nxs]) #Nref,Ntau,Nop,Natm,Mxyz1635 fbm = (Q*TMcorr[:,nxs,nxs,:,nxs]*sinm[:, :,:,:,nxs]*Smag[nxs,:,:,:,nxs])1634 fam = (Q*TMcorr[:,nxs,nxs,:,nxs]*cosm[:,nxs,:,:,nxs]*Smag[nxs,:,:,:,nxs]) #Nref,Ntau,Nop,Natm,Mxyz 1635 fbm = (Q*TMcorr[:,nxs,nxs,:,nxs]*sinm[:,nxs,:,:,nxs]*Smag[nxs,:,:,:,nxs]) 1636 1636 1637 fams = np.sum(np.sum(fam,axis=2),axis=2) #Nref,ntau,Mxyz; sum ops & atoms 1638 fbms = np.sum(np.sum(fbm,axis=2),axis=2) #ditto 1637 fams = np.sqrt(np.sum(fam**2,axis=-1)) 1638 fbms = np.sqrt(np.sum(fbm**2,axis=-1)) 1639 1640 fas = np.sum(np.sum(fams,axis=2),axis=2) #Nref,ntau,Mxyz; sum ops & atoms 1641 fbs = np.sum(np.sum(fbms,axis=2),axis=2) #ditto 1639 1642 1640 fas = np.sum(fams/ngl,axis=-1) 1641 fbs = np.sum(fbms/ngl,axis=-1) 1642 1643 refl.T[10] = np.sum(fas,axis=-1)**2+np.sum(fbs,axis=-1)**2 1643 refl.T[10] = np.sum(fas/ngl,axis=-1)**2+np.sum(fbs/ngl,axis=-1)**2 1644 1644 refl.T[11] = atan2d(fbs[:,0],fas[:,0]) 1645 1645
Note: See TracChangeset
for help on using the changeset viewer.