Changeset 3433
 Timestamp:
 Jun 13, 2018 12:58:28 PM (5 years ago)
 Location:
 trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIIO.py
r3430 r3433 31 31 import math 32 32 import numpy as np 33 import numpy.ma as ma 34 33 35 import copy 34 36 import platform … … 564 566 return 565 567 566 objectScanIgnore = [int,bool,float,str,np.float64,np.int 64,np.ndarray,G2obj.G2VarObj]568 objectScanIgnore = [int,bool,float,str,np.float64,np.int32,np.int64,np.ndarray,G2obj.G2VarObj,ma.MaskedArray] 567 569 if '2' in platform.python_version_tuple()[0]: 568 570 objectScanIgnore += [unicode,long,] 
trunk/GSASIIspc.py
r3425 r3433 29 29 npcosd = lambda x: np.cos(x*np.pi/180.) 30 30 nxs = np.newaxis 31 twopi = 2.0*np.pi 31 32 DEBUG = False 32 33 … … 1979 1980 def checkMagextc(HKL,SGData): 1980 1981 Ops = SGData['SGOps'] 1981 Spn = SGData['SpnFlp'][:len(Ops)]1982 1982 OpM = np.array([op[0] for op in Ops]) 1983 1983 OpT = np.array([op[1] for op in Ops]) 1984 if SGData['SGInv']: 1985 OpM = np.vstack((OpM,OpM)) 1986 OpT = np.vstack((OpT,OpT))%1. 1987 Spn = SGData['SpnFlp'][:len(OpM)] 1984 1988 Mag = np.array([nl.det(opm) for opm in OpM])*Spn 1985 HKLS = np.array([HKL,HKL]) #Freidel's Law 1986 DHKL = np.reshape(np.inner(HKLS,OpM)*Mag[nxs,:,nxs],(1,3)) 1987 PHKL = np.reshape(np.inner(HKLS,OpT),(1,)) 1988 for dhkl,phkl in zip(DHKL,PHKL)[1:]: #skip identity 1989 DHKL = np.reshape(np.inner(HKL,OpM),(1,3)) 1990 PHKL = np.reshape(np.cos(twopi*np.inner(HKL,OpT))*Mag,(1,))[:,nxs,nxs]*OpM 1991 Ftest = np.random.rand(3) 1992 Psum = np.zeros(3) 1993 for dhkl,phkl in zip(DHKL,PHKL): 1989 1994 if not np.allclose(dhkl,HKL): 1990 1995 continue 1991 1996 else: 1992 print(dhkl,HKL,phkl) 1993 if phkl%1.: 1994 return False 1995 return True 1997 Psum += np.inner(Ftest,phkl) 1998 if np.allclose(Psum,np.zeros(3)): 1999 return False 2000 else: 2001 if np.inner(HKL,Psum): 2002 return False 2003 return True 1996 2004 1997 2005 def checkSSextc(HKL,SSGData): 
trunk/GSASIIstrMath.py
r3423 r3433 1040 1040 refl.T[9] = np.sum(fams**2,axis=0)+np.sum(fbms**2,axis=0) 1041 1041 refl.T[7] = np.copy(refl.T[9]) 1042 refl.T[10] = 0.0 #atan2d(fbs[0],fas[0]) what is phase for mag refl?1042 refl.T[10] = atan2d(fbms[0],fams[0]) # what is phase for mag refl? 1043 1043 # if 'P' in calcControls[hfx+'histType']: #PXC, PNC & PNT: F^2 = A[0]^2 + A[1]^2 + B[0]^2 + B[1]^2 1044 1044 # refl.T[9] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0) #add fam**2 & fbm**2 here
Note: See TracChangeset
for help on using the changeset viewer.