Changeset 4144
- Timestamp:
- Sep 11, 2019 2:45:53 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMath.py
r4143 r4144 1102 1102 sinm = np.sin(mphase) #ditto - match magstrfc.for 1103 1103 cosm = np.cos(mphase) #ditto 1104 HM = np.inner(Bmat .T,H) #put into cartesian space1104 HM = np.inner(Bmat,H) #put into cartesian space 1105 1105 HM = HM/np.sqrt(np.sum(HM**2,axis=0)) #Kdata = MAGS & HM = UVEC in magstrfc.for both OK 1106 1106 eDotK = np.sum(HM[:,:,nxs,nxs]*Kdata[:,nxs,:,:],axis=0) … … 1482 1482 phfx = pfx.split(':')[0]+hfx 1483 1483 ast = np.sqrt(np.diag(G)) 1484 #GS = G/np.outer(ast,ast)1485 # uAmat = G2lat.Gmat2AB(GS)[0] 1484 GS = G/np.outer(ast,ast) 1485 uAmat,uBmat = G2lat.Gmat2AB(GS) 1486 1486 Mast = twopisq*np.multiply.outer(ast,ast) 1487 1487 SGInv = SGData['SGInv'] … … 1594 1594 TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2.*Nops) #Nref,Natm 1595 1595 1596 HM = np.inner(Bmat .T,HP.T) #put into cartesian space1596 HM = np.inner(Bmat,HP.T) #put into cartesian space X||H,Z||H*L 1597 1597 eM = HM/np.sqrt(np.sum(HM**2,axis=0)) #& normalize 1598 1598 #for fixed moments --> m=0 reflections … … 1615 1615 fams += fam0[:,nxs,:,:,:] 1616 1616 fbms += fbm0[:,nxs,:,:,:] 1617 1617 # do sum on ops, atms 1st 1618 1618 famqs = np.sum(np.sum(fams,axis=-2),axis=-2) #Nref,Ntau,Mxyz; sum ops & atoms 1619 1619 fbmqs = np.sum(np.sum(fbms,axis=-2),axis=-2) 1620 1620 1621 famcs = np. swapaxes(np.inner(Amat,famqs).T,0,1)#convert to cartesian1622 fbmcs = np. swapaxes(np.inner(Amat,fbmqs).T,0,1) # as Nref,Ntau,Mxyz1621 famcs = np.inner(famqs,Bmat) #convert to cartesian 1622 fbmcs = np.inner(fbmqs,Bmat) # as Nref,Ntau,Mxyz 1623 1623 1624 1624 famcs /= np.sqrt(np.sum(famcs**2,axis=-1))[:,:,nxs] #normalize … … 1631 1631 fbss = np.sum(fbmqs**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,:]*fbmcs,axis=-1)**2) 1632 1632 1633 # do sum on ops atoms last? No! 1634 # famcs = np.inner(fams,Bmat) #convert to cartesian 1635 # fbmcs = np.inner(fbms,Bmat) # as Nref,Ntau,Mxyz 1636 # 1637 # famcs /= np.sqrt(np.sum(famcs**2,axis=-1))[:,:,:,:,nxs] #normalize 1638 # fbmcs /= np.sqrt(np.sum(fbmcs**2,axis=-1))[:,:,:,:,nxs] 1639 # 1640 # famcs = np.nan_to_num(famcs) #nan --> 0.0 1641 # fbmcs = np.nan_to_num(fbmcs) 1642 # 1643 # famqs = np.sum(fams**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,nxs,nxs,:]*famcs,axis=-1)**2) #mag intensity calc F^2-(e.F)^2 1644 # fbmqs = np.sum(fbms**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,nxs,nxs,:]*fbmcs,axis=-1)**2) 1645 # 1646 # fass = np.sum(np.sum(famqs,axis=-1),axis=-1) #Nref,Ntau,Mxyz; sum ops & atoms 1647 # fbss = np.sum(np.sum(fbmqs,axis=-1),axis=-1) 1648 # 1649 #do integration 1633 1650 fas = np.sum(glWt*fass,axis=1) 1634 1651 fbs = np.sum(glWt*fbss,axis=1)
Note: See TracChangeset
for help on using the changeset viewer.