Changeset 2067
- Timestamp:
- Nov 23, 2015 4:03:43 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r2064 r2067 47 47 twopi = 2.0*np.pi 48 48 twopisq = 2.0*np.pi**2 49 nxs = np.newaxis 49 50 50 51 ################################################################################ … … 926 927 #### Modulation math 927 928 ################################################################################ 928 929 def Modulation(waveTypes,H,HP,FSSdata,XSSdata,USSdata,Mast):929 930 def makeWaves(waveTypes,FSSdata,XSSdata,USSdata,Mast): 930 931 ''' 931 932 waveTypes: array nAtoms: 'Fourier','ZigZag' or 'Block' 932 H: array nRefBlk x ops X hklt933 HP: array nRefBlk x ops X hklt proj to hkl934 933 FSSdata: array 2 x atoms x waves (sin,cos terms) 935 934 XSSdata: array 2x3 x atoms X waves (sin,cos terms) … … 937 936 Mast: array orthogonalization matrix for Uij 938 937 ''' 939 940 nxs = np.newaxis941 938 glTau,glWt = pwd.pygauleg(0.,1.,32) #get Gauss-Legendre intervals & weights 942 939 Ax = np.array(XSSdata[:3]).T #atoms x waves x sin pos mods … … 946 943 Au = Mast*np.array(G2lat.U6toUij(USSdata[:6])).T #atoms x waves x sin Uij mods as betaij 947 944 Bu = Mast*np.array(G2lat.U6toUij(USSdata[6:])).T #...cos Uij mods as betaij 948 949 GSASIIpath.IPyBreak() 945 nWaves = [Af.shape[1],Ax.shape[1],Au.shape[1]] 946 if nWaves[0]: 947 tauF = np.arange(1.,nWaves[0]+1-nf)[:,nxs]*glTau #Fwaves x 32 948 FmodA = Af[:,:,nxs]*np.sin(twopi*tauF[nxs,:,:]) #atoms X Fwaves X 32 949 FmodB = Bf[:,:,nxs]*np.cos(twopi*tauF[nxs,:,:]) 950 Fmod = np.sum(FmodA+FmodB,axis=1) #atoms X 32; sum waves 951 else: 952 Fmod = 1.0 950 953 XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 951 if 'Fourier' in waveTypes: 952 nf = 0 954 XmodA = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 955 XmodB = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 956 for iatm in range(Ax.shape[0]): 953 957 nx = 0 954 FmodZ = np.zeros((Af.shape[0],Af.shape[1],32)) 955 if 'Crenel' in waveTypes: #do we need 'Crenel'?? 956 nC = np.where('Crenel' in waveTypes) 957 nf = 1 958 #FmodZ = 0 replace 959 else: #1st wave is 'ZigZag' or 'Block'; rest can be 'Fourier' 960 nx = 1 961 if 'ZigZag' in waveTypes: 958 if 'ZigZag' in waveTypes[iatm]: 959 nt = 1 960 Tmm = Ax[iatm][0][:2] 961 XYZmax = np.array([Ax[iatm][0][2],Bx[iatm][0][0],Bx[iatm][0][1]]) 962 962 DT = Tmm[1]-Tmm[0] 963 963 slopeUp = 2.*XYZmax/DT 964 964 slopeDn = 2.*XYZmax/(1.-DT) 965 XmodZ = np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax+slopeUp*((t-Tmm[0])%1.),XYZmax-slopeDn*((t-Tmm[1])%1.)) for t in tau]) 966 elif 'Block' in waveTypes: 967 XmodZ = np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax,XYZmax) for t in tau]) 968 if Af.shape[1]: 969 tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau #Fwaves x 32 970 FmodA = Af[:,nf:,nxs]*np.sin(twopi*tauF[nxs,:,:]) #atoms X Fwaves X 32 971 FmodB = Bf[:,nf:,nxs]*np.cos(twopi*tauF[nxs,:,:]) 972 Fmod = np.sum(FmodA+FmodB+FmodC,axis=1) #atoms X 32; sum waves 973 else: 974 Fmod = 1.0 975 tauX = np.arange(1.,Ax.shape[1]+1-nx)[:,nxs]*glTau #Xwaves x 32 976 XmodA = Ax[:,nx:,:,nxs]*np.sin(twopi*tauX[nxs,:,nxs,:]) #atoms X waves X 3 X 32 977 XmodB = Bx[:,nx:,:,nxs]*np.cos(twopi*tauX[nxs,:,nxs,:]) #ditto 965 XmodZ[iatm][0] = np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax+slopeUp*((t-Tmm[0])%1.),XYZmax-slopeDn*((t-Tmm[1])%1.)) for t in glTau]).T 966 elif 'Block' in waveTypes[iatm]: 967 nt = 1 968 Tmm = Ax[iatm][0][:2] 969 XYZmax = np.array([Ax[iatm][0][2],Bx[iatm][0][0],Bx[iatm][0][1]]) 970 XmodZ[iatm][0] = np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax,XYZmax) for t in glTau]).T 971 tauX = np.arange(1.,nWaves[1]+1-nx)[:,nxs]*glTau #Xwaves x 32 972 XmodA[iatm] = Ax[iatm,nx:,:,nxs]*np.sin(twopi*tauX[nxs,:,nxs,:]) #atoms X waves X 3 X 32 973 XmodB[iatm] = Bx[iatm,nx:,:,nxs]*np.cos(twopi*tauX[nxs,:,nxs,:]) #ditto 978 974 Xmod = np.sum(XmodA+XmodB+XmodZ,axis=1) #atoms X 3 X 32; sum waves 979 Xmod = np.swapaxes(Xmod,1,2) #agrees with J2K ParSup & shape is right980 if Au.shape[1]:981 tauU = np.arange(1., Au.shape[1]+1)[:,nxs]*glTau #Uwaves x 32975 Xmod = np.swapaxes(Xmod,1,2) 976 if nWaves[2]: 977 tauU = np.arange(1.,nWaves[2]+1)[:,nxs]*glTau #Uwaves x 32 982 978 UmodA = Au[:,:,:,:,nxs]*np.sin(twopi*tauU[nxs,:,nxs,nxs,:]) #atoms x waves x 3x3 x 32 983 979 UmodB = Bu[:,:,:,:,nxs]*np.cos(twopi*tauU[nxs,:,nxs,nxs,:]) #ditto 984 980 Umod = np.swapaxes(np.sum(UmodA+UmodB,axis=1),1,3) #atoms x 3x3 x 32; sum waves 985 HbH = np.exp(-np.sum(HP[:,:,nxs,nxs]*np.inner(HP[:,:],Umod),axis=-1)) # refBlk x ops x atoms x 32 add Overhauser corr.? 981 else: 982 Umod = 1.0 983 return nWaves,Fmod,Xmod,Umod,glTau,glWt 984 985 def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt): 986 ''' 987 H: array nRefBlk x ops X hklt 988 HP: array nRefBlk x ops X hklt proj to hkl 989 Fmod: array 2 x atoms x waves (sin,cos terms) 990 Xmod: array atoms X 3 X 32 991 Umod: array atoms x 3x3 x 32 992 glTau,glWt: arrays Gauss-Lorentzian pos & wts 993 ''' 994 995 nxs = np.newaxis 996 if nWaves[2]: 997 if len(HP.shape) > 2: 998 HbH = np.exp(-np.sum(HP[:,:,nxs,nxs,:]*np.inner(HP,Umod),axis=-1)) # refBlk x ops x atoms x 32 add Overhauser corr.? 999 else: 1000 HbH = np.exp(-np.sum(HP[:,nxs,nxs,:]*np.inner(HP,Umod),axis=-1)) # refBlk x ops x atoms x 32 add Overhauser corr.? 986 1001 else: 987 1002 HbH = 1.0 988 D = H[:,:,3:]*glTau[nxs,nxs,:] #m*e*tau; refBlk x ops X 32989 1003 HdotX = np.inner(HP,Xmod) #refBlk x ops x atoms X 32 990 HdotXD = twopi*(HdotX+D[:,:,nxs,:]) 1004 if len(H.shape) > 2: 1005 D = H[:,:,3:]*glTau[nxs,nxs,:] #m*e*tau; refBlk x ops X 32 1006 HdotXD = twopi*(HdotX+D[:,:,nxs,:]) 1007 else: 1008 D = H[:,3:]*glTau[nxs,:] #m*e*tau; refBlk x ops X 32 1009 HdotXD = twopi*(HdotX+D[:,nxs,:]) 991 1010 cosHA = np.sum(Fmod*HbH*np.cos(HdotXD)*glWt,axis=-1) #real part; refBlk X ops x atoms; sum for G-L integration 992 1011 sinHA = np.sum(Fmod*HbH*np.sin(HdotXD)*glWt,axis=-1) #imag part; ditto 993 1012 return np.array([cosHA,sinHA]) # 2 x refBlk x SGops x atoms 994 1013 995 def ModulationDerv(waveTypes,H,HP,Hij,FSSdata,XSSdata,USSdata,Mast): 996 ''' 997 H: array ops X hklt proj to hkl 998 HP: array nRefBlk x ops X hklt proj to hkl 1014 def makeWavesDerv(waveTypes,FSSdata,XSSdata,USSdata,Mast): 1015 ''' 999 1016 FSSdata: array 2 x atoms x waves (sin,cos terms) 1000 Hij: array 2pi^2[a*^2h^2 b*^2k^2 c*^2l^2 a*b*hk a*c*hl b*c*kl] of projected hklm to hkl space1001 1017 XSSdata: array 2x3 x atoms X waves (sin,cos terms) 1002 1018 USSdata: array 2x6 x atoms X waves (sin,cos terms) 1003 1019 Mast: array orthogonalization matrix for Uij 1004 1020 ''' 1005 1006 nxs = np.newaxis1007 numeric = True1008 cosHA,sinHA = Modulation(waveTypes,np.array([H,]),np.array([HP,]),FSSdata,XSSdata,USSdata,Mast)1009 Mf = [H.shape[0],]+list(FSSdata.T.shape) #=[ops,atoms,waves,2] (sin+cos frac mods)1010 dGdMfC = np.zeros(Mf)1011 dGdMfS = np.zeros(Mf)1012 Mx = [H.shape[0],]+list(XSSdata.T.shape) #=[ops,atoms,waves,6] (sin+cos pos mods)1013 dGdMxC = np.zeros(Mx)1014 dGdMxS = np.zeros(Mx)1015 Mu = [H.shape[0],]+list(USSdata.T.shape) #=[ops,atoms,waves,12] (sin+cos Uij mods)1016 dGdMuC = np.zeros(Mu)1017 dGdMuS = np.zeros(Mu)1018 1021 glTau,glWt = pwd.pygauleg(0.,1.,32) #get Gauss-Legendre intervals & weights 1022 waveShapes = [FSSdata.T.shape,XSSdata.T.shape,USSdata.T.shape] 1019 1023 Af = np.array(FSSdata[0]).T #sin frac mods x waves x atoms 1020 1024 Bf = np.array(FSSdata[1]).T #cos frac mods... … … 1023 1027 Au = Mast*np.array(G2lat.U6toUij(USSdata[:6])).T #atoms x waves x sin Uij mods 1024 1028 Bu = Mast*np.array(G2lat.U6toUij(USSdata[6:])).T #...cos Uij mods 1025 1026 if 'Fourier' in waveTypes: 1027 nf = 0 1028 nx = 0 1029 XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 1030 FmodZ = np.zeros((Af.shape[0],Af.shape[1],32)) 1031 if 'Crenel' in waveTypes: 1032 nC = np.where('Crenel' in waveTypes) 1033 nf = 1 1034 #FmodZ = 0 replace 1035 else: 1036 nx = 1 1037 if 'Sawtooth' in waveTypes: 1038 nS = np.where('Sawtooth' in waveTypes) 1039 #XmodZ = 0 replace 1040 tauX = np.arange(1.,Ax.shape[1]+1-nx)[:,nxs]*glTau #Xwaves x 32 1029 nWaves = [Af.shape[1],Ax.shape[1],Au.shape[1]] 1030 nf = 0 1031 nx = 0 1032 # if 'Fourier' in waveTypes: 1033 # nf = 0 1034 # nx = 0 1035 # XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 1036 # FmodZ = np.zeros((Af.shape[0],Af.shape[1],32)) 1037 # if 'Crenel' in waveTypes: 1038 # nC = np.where('Crenel' in waveTypes) 1039 # nf = 1 1040 # #FmodZ = 0 replace 1041 # else: 1042 # nx = 1 1043 # if 'Sawtooth' in waveTypes: 1044 # nS = np.where('Sawtooth' in waveTypes) 1045 # #XmodZ = 0 replace 1046 tauX = np.arange(1.,nWaves[1]+1-nx)[:,nxs]*glTau #Xwaves x 32 1041 1047 StauX = np.ones_like(Ax)[:,nx:,:,nxs]*np.sin(twopi*tauX)[nxs,:,nxs,:] #atoms X waves X 3(xyz) X 32 1042 1048 CtauX = np.ones_like(Bx)[:,nx:,:,nxs]*np.cos(twopi*tauX)[nxs,:,nxs,:] #ditto 1043 XmodA = Ax[:,nx:,:,nxs]*StauX #atoms X waves X pos X 32 1044 XmodB = Bx[:,nx:,:,nxs]*CtauX #ditto 1045 Xmod = np.sum(XmodA+XmodB+XmodZ,axis=1) #atoms X pos X 32; sum waves 1046 Xmod = np.swapaxes(Xmod,1,2) 1047 D = twopi*H[:,3][:,nxs]*glTau[nxs,:] #m*e*tau; ops X 32 1048 HdotX = twopi*np.inner(HP,Xmod) #ops x atoms X 32 1049 HdotXD = HdotX+D[:,nxs,:] 1050 if Af.shape[1]: 1051 tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau #Fwaves x 32 1049 if nWaves[0]: 1050 tauF = np.arange(1.,nWaves[0]+1-nf)[:,nxs]*glTau #Fwaves x 32 1052 1051 StauF = np.ones_like(Af)[:,nf:,nxs]*np.sin(twopi*tauF)[nxs,:,:] #also dFmod/dAf 1053 1052 CtauF = np.ones_like(Bf)[:,nf:,nxs]*np.cos(twopi*tauF)[nxs,:,:] #also dFmod/dBf 1054 FmodA = Af[:,nf:,nxs]*StauF #atoms X Fwaves X 321055 FmodB = Bf[:,nf:,nxs]*CtauF1056 Fmod = np.sum(FmodA+FmodB+FmodC,axis=1) #atoms X 32; sum waves1057 1053 else: 1058 Fmod = np.ones_like(HdotX) 1059 if Au.shape[1]: 1060 tauU = np.arange(1.,Au.shape[1]+1)[:,nxs]*glTau #Uwaves x 32 1054 StauF = 1.0 1055 CtauF = 1.0 1056 if nWaves[2]: 1057 tauU = np.arange(1.,nWaves[2]+1)[:,nxs]*glTau #Uwaves x 32 1061 1058 StauU = np.ones_like(Au)[:,:,:,:,nxs]*np.sin(twopi*tauU)[nxs,:,nxs,nxs,:] #also dUmodA/dAu 1062 1059 CtauU = np.ones_like(Bu)[:,:,:,:,nxs]*np.cos(twopi*tauU)[nxs,:,nxs,nxs,:] #also dUmodB/dBu 1063 1060 UmodA = Au[:,:,:,:,nxs]*StauU #atoms x waves x 3x3 x 32 1064 1061 UmodB = Bu[:,:,:,:,nxs]*CtauU #ditto 1065 Umod = np.swapaxes((UmodA+UmodB),2,4) #atoms x waves x 32 x 3x3 (symmetric so I can do this!)1066 HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP,Umod),axis=-1) #ops x atoms x waves x 321067 HbH = np.exp(-np.sum(HuH,axis=-2)) # ops x atoms x 32; sum waves - OK vs Modulation version1068 1062 #derivs need to be ops x atoms x waves x 6uij; ops x atoms x waves x 32 x 6uij before sum 1069 1063 StauU = np.rollaxis(np.rollaxis(np.swapaxes(StauU,2,4),-1),-1) 1070 1064 CtauU = np.rollaxis(np.rollaxis(np.swapaxes(CtauU,2,4),-1),-1) 1071 dUdAu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(StauU),0,4)[nxs,:,:,:,:] #ops x atoms x waves x 32 x 6sinUij 1072 dUdBu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(CtauU),0,4)[nxs,:,:,:,:] #ops x atoms x waves x 32 x 6cosUij 1073 part1 = -np.exp(-HuH)*Fmod[:,:,nxs,:] #ops x atoms x waves x 32 1065 else: 1066 StauU = 1.0 1067 CtauU = 1.0 1068 UmodA = 0. 1069 UmodB = 0. 1070 return waveShapes,[StauF,CtauF],[StauX,CtauX],[StauU,CtauU],UmodA+UmodB 1071 1072 def ModulationDerv(H,HP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt): 1073 ''' 1074 H: array ops X hklt proj to hkl 1075 HP: array nRefBlk x ops X hklt proj to hkl 1076 Hij: array 2pi^2[a*^2h^2 b*^2k^2 c*^2l^2 a*b*hk a*c*hl b*c*kl] of projected hklm to hkl space 1077 ''' 1078 1079 Mf = [H.shape[0],]+list(waveShapes[0]) #=[ops,atoms,waves,2] (sin+cos frac mods) 1080 dGdMfC = np.zeros(Mf) 1081 dGdMfS = np.zeros(Mf) 1082 Mx = [H.shape[0],]+list(waveShapes[1]) #=[ops,atoms,waves,6] (sin+cos pos mods) 1083 dGdMxC = np.zeros(Mx) 1084 dGdMxS = np.zeros(Mx) 1085 Mu = [H.shape[0],]+list(waveShapes[2]) #=[ops,atoms,waves,12] (sin+cos Uij mods) 1086 dGdMuC = np.zeros(Mu) 1087 dGdMuS = np.zeros(Mu) 1088 1089 D = twopi*H[:,3][:,nxs]*glTau[nxs,:] #m*e*tau; ops X 32 1090 HdotX = twopi*np.inner(HP,Xmod) #ops x atoms X 32 1091 HdotXD = HdotX+D[:,nxs,:] 1092 if nWaves[2]: 1093 Umod = np.swapaxes((UmodAB),2,4) #atoms x waves x 32 x 3x3 (symmetric so I can do this!) 1094 HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP,Umod),axis=-1) #ops x atoms x waves x 32 1095 HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP,Umod),axis=-1) #ops x atoms x waves x 32 1096 HbH = np.exp(-np.sum(HuH,axis=-2)) # ops x atoms x 32; sum waves - OK vs Modulation version 1097 part1 = -np.exp(-HuH)*Fmod #ops x atoms x waves x 32 1098 dUdAu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(SCtauU[0]),0,4)[nxs,:,:,:,:] #ops x atoms x waves x 32 x 6sinUij 1099 dUdBu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(SCtauU[1]),0,4)[nxs,:,:,:,:] #ops x atoms x waves x 32 x 6cosUij 1074 1100 dGdMuCa = np.sum(part1[:,:,:,:,nxs]*dUdAu*np.cos(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2) #ops x atoms x waves x 6uij; G-L sum 1075 1101 dGdMuCb = np.sum(part1[:,:,:,:,nxs]*dUdBu*np.cos(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2) … … 1081 1107 else: 1082 1108 HbH = np.ones_like(HdotX) 1083 dHdXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(S tauX,-1,-2)[nxs,:,:,:,:] #ops x atoms x sine waves x 32 x xyz1084 dHdXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes( CtauX,-1,-2)[nxs,:,:,:,:] #ditto - cos waves1109 dHdXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(SCtauX[0],-1,-2)[nxs,:,:,:,:] #ops x atoms x sine waves x 32 x xyz 1110 dHdXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(SCtauX[1],-1,-2)[nxs,:,:,:,:] #ditto - cos waves 1085 1111 dGdMxCa = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2) 1086 1112 dGdMxCb = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2) … … 1091 1117 dGdMxS = np.concatenate((dGdMxSa,dGdMxSb),axis=-1) 1092 1118 # ops x atoms x waves x 2xyz - imaginary part - good 1093 return np.array([cosHA,sinHA]),[dGdMfC,dGdMfS],[dGdMxC,dGdMxS],[dGdMuC,dGdMuS]1119 return [dGdMfC,dGdMfS],[dGdMxC,dGdMxS],[dGdMuC,dGdMuS] 1094 1120 1095 1121 def posFourier(tau,psin,pcos,smul): -
trunk/GSASIIstrMain.py
r2066 r2067 590 590 MyPrint(line) 591 591 else: 592 MyPrint(' ( 1) %s'%(SGtable[0])) 592 MyPrint(' ( 1) %s'%(SGtable[0])) #triclinic case 593 593 Cell = DisAglData['Cell'] 594 594 -
trunk/GSASIIstrMath.py
r2061 r2067 617 617 waveTypes = [] 618 618 keys = {'Fsin:':FSSdata[0],'Fcos:':FSSdata[1],'Fzero:':FSSdata[0],'Fwid:':FSSdata[1], 619 'T zero:':XSSdata[0],'Xslope:':XSSdata[1],'Yslope:':XSSdata[2],'Zslope:':XSSdata[3],619 'Tmin:':XSSdata[0],'Tmax:':XSSdata[1],'Xmax:':XSSdata[2],'Ymax:':XSSdata[3],'Zmax:':XSSdata[4], 620 620 'Xsin:':XSSdata[0],'Ysin:':XSSdata[1],'Zsin:':XSSdata[2],'Xcos:':XSSdata[3],'Ycos:':XSSdata[4],'Zcos:':XSSdata[5], 621 621 'U11sin:':USSdata[0],'U22sin:':USSdata[1],'U33sin:':USSdata[2],'U12sin:':USSdata[3],'U13sin:':USSdata[4],'U23sin:':USSdata[5], … … 994 994 Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict) 995 995 waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict) 996 # Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata) 997 # GSASIIpath.IPyBreak() 998 # if SGInv: 999 # TauT = np.hstack((TauT,-TauT)) 1000 # eps = np.concatenate((eps,-eps)) 996 nWaves,Fmod,Xmod,Umod,glTau,glWt = G2mth.makeWaves(waveTypes,FSSdata,XSSdata,USSdata,Mast) 1001 997 modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']]) 1002 998 FF = np.zeros(len(Tdata)) … … 1076 1072 fa = np.array([np.reshape(((FF+FP).T-Bab).T,cosp.shape)*cosp*Tcorr,-Flack*FPP*sinp*Tcorr]) 1077 1073 fb = np.array([Flack*FPP*cosp*Tcorr,np.reshape(((FF+FP).T-Bab).T,sinp.shape)*sinp*Tcorr]) 1078 GfpuA = G2mth.Modulation( waveTypes,Uniq,UniqP,FSSdata,XSSdata,USSdata,Mast) #2 x refBlk x sym X atoms1074 GfpuA = G2mth.Modulation(Uniq,UniqP,nWaves,Fmod,Xmod,Umod,glTau,glWt) #2 x refBlk x sym X atoms 1079 1075 fag = fa*GfpuA[0]-fb*GfpuA[1] #real; 2 x refBlk x sym x atoms 1080 1076 fbg = fb*GfpuA[0]+fa*GfpuA[1] … … 1125 1121 mSize = len(Mdata) #no. atoms 1126 1122 waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict) 1127 # Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata) 1128 # if SGInv: 1129 # TauT = np.hstack((TauT,-TauT)) 1123 nWaves,Fmod,Xmod,Umod,glTau,glWt = G2mth.makeWaves(waveTypes,FSSdata,XSSdata,USSdata,Mast) 1124 waveShapes,SCtauF,SCtauX,SCtauU,UmodAB = G2mth.makeWavesDerv(waveTypes,FSSdata,XSSdata,USSdata,Mast) 1130 1125 modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']]) 1131 1126 FF = np.zeros(len(Tdata)) … … 1214 1209 fot = (FF+FP-Bab)*Tcorr #ops x atoms 1215 1210 fotp = FPP*Tcorr #ops x atoms 1216 GfpuA,dGdf,dGdx,dGdu = G2mth.ModulationDerv(waveTypes,Uniq,UniqP,Hij,FSSdata,XSSdata,USSdata,Mast) 1211 GfpuA = G2mth.Modulation(Uniq,UniqP,nWaves,Fmod,Xmod,Umod,glTau,glWt) #2 x sym X atoms 1212 dGdf,dGdx,dGdu = G2mth.ModulationDerv(Uniq,UniqP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt) 1217 1213 # GfpuA is 2 x ops x atoms 1218 1214 # derivs are: ops x atoms x waves x 2,6,or 12 parms as [real,imag] parts
Note: See TracChangeset
for help on using the changeset viewer.