Changeset 3832
- Timestamp:
- Mar 1, 2019 12:38:16 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIpwdGUI.py
r3824 r3832 4455 4455 ''' 4456 4456 phaseName = G2frame.RefList 4457 Super = 0 4458 SuperVec = [] 4457 4459 if phaseName not in ['Unknown',]: 4458 4460 pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases') 4459 4461 phaseId = G2gd.GetGPXtreeItemId(G2frame,pId,phaseName) 4460 4462 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'] 4466 4466 if 'list' in str(type(data)): #single crystal data is 2 dict in list 4467 4467 refList = data[1]['RefList'] … … 4487 4487 for a phase. 4488 4488 ''' 4489 Super = 0 4489 4490 if phaseName not in ['Unknown',]: 4490 4491 pId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases') … … 4493 4494 return None 4494 4495 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 4498 4498 rowLabels = [] 4499 4499 if HKLF: -
trunk/GSASIIstrMath.py
r3830 r3832 1607 1607 HM = np.inner(Bmat,HP.T) #put into cartesian space 1608 1608 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 1610 1615 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,:,:,:] 1613 1619 1614 # fam = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*SMag[nxs,nxs,:,:] #Mxyz,Nref,Nop,Natm1615 # fbm = Q*TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*SMag[nxs,nxs,:,:] 1620 fam = TMcorr[:,nxs,:]*cosm #Nref,Nops,Natm 1621 fbm = TMcorr[:,nxs,:]*sinm 1616 1622 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) 1619 1628 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 1627 1630 # refl.T[11] = mphase[:,0,0] #ignore f' & f" 1628 1631
Note: See TracChangeset
for help on using the changeset viewer.