Changeset 1766
- Timestamp:
- Mar 27, 2015 2:46:30 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r1598 r1766 47 47 rdsq2d = lambda x,p: round(1.0/np.sqrt(x),p) 48 48 rpd = np.pi/180. 49 RSQ2PI = 1./np.sqrt(2.*np.pi) 50 SQ2 = np.sqrt(2.) 51 RSQPI = 1./np.sqrt(np.pi) 49 52 50 53 def sec2HMS(sec): … … 1039 1042 1040 1043 BD = 1.0-BC**2 1041 if BD > 0.:1044 if BD > 1.e-6: 1042 1045 C = rpd/math.sqrt(BD) 1043 1046 else: … … 1061 1064 dBBdF = BC1*SComeg-BC3*SSomeg*SCchi 1062 1065 1063 if BD > 0.:1066 if BD > 1.e-6: 1064 1067 dGMdA = [(BA*dBBdO-BB*dBAdO)/BD,(BA*dBBdC-BB*dBAdC)/BD,(BA*dBBdF-BB*dBAdF)/BD] 1065 1068 else: … … 1110 1113 'needs doc string' 1111 1114 import pytexture as ptx 1112 RSQ2PI = 0.39894228040141113 SQ2 = 1.4142135623731114 1115 if SGLaue in ['m3','m3m']: 1115 1116 Kcl = 0.0 … … 1138 1139 'needs doc string' 1139 1140 import pytexture as ptx 1140 RSQPI = 0.56418958354781141 SQ2 = 1.4142135623731142 1141 psrs,dpdps = ptx.pyplmpsi(L,M,1,psi) 1143 psrs *= RSQ PI1144 dpdps *= RSQ PI1145 if M == 0:1146 psrs /= SQ21147 dpdps /= SQ21142 psrs *= RSQ2PI 1143 dpdps *= RSQ2PI 1144 if M: 1145 psrs *= SQ2 1146 dpdps *= SQ2 1148 1147 if SamSym in ['mmm',]: 1149 1148 dum = cosd(M*gam) … … 1164 1163 """ 1165 1164 import pytexture as ptx 1166 RSQ2PI = 0.39894228040141167 SQ2 = 1.4142135623731168 1165 Ksl,x = ptx.pyplmpsi(L,0,1,psi) 1169 1166 Ksl *= RSQ2PI … … 1194 1191 'needs doc string' 1195 1192 import pytexture as ptx 1196 RSQPI = 0.56418958354781197 SQ2 = 1.4142135623731198 1193 1199 1194 if Start: … … 1219 1214 import pytexture as ptx 1220 1215 1221 FORPI = 12.56637061435921222 RSQPI = 0.56418958354781223 SQ2 = 1.4142135623731224 1225 1216 if Start: 1226 1217 ptx.pyqlmninit() … … 1260 1251 ''' 1261 1252 import pytexture as ptx 1262 RSQPI = 0.56418958354781263 SQ2 = 1.4142135623731264 1253 PolVal = np.ones_like(psi) 1265 1254 for term in ODFln: … … 1268 1257 psrs,dum = ptx.pyplmpsi(l,m,len(psi),psi) 1269 1258 if SamSym in ['-1','2/m']: 1270 if m != 0:1259 if m: 1271 1260 Ksl = RSQPI*psrs*(cosd(m*gam)+sind(m*gam)) 1272 1261 else: 1273 1262 Ksl = RSQPI*psrs/SQ2 1274 1263 else: 1275 if m != 0:1264 if m: 1276 1265 Ksl = RSQPI*psrs*cosd(m*gam) 1277 1266 else: … … 1284 1273 import pytexture as ptx 1285 1274 1286 FORPI = 12.56637061435921287 RSQPI = 0.56418958354781288 SQ2 = 1.4142135623731289 1290 1275 invPolVal = np.ones_like(beta) 1291 1276 for term in ODFln: -
trunk/GSASIIstrMath.py
r1762 r1766 1279 1279 if 'Debye' in calcControls[hfx+'instType']: 1280 1280 if 'T' in calcControls[hfx+'histType']: 1281 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption']*refl[14+im], parmDict[hfx+'2-theta'],0,0)1281 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption']*refl[14+im],abs(parmDict[hfx+'2-theta']),0,0) 1282 1282 else: 1283 1283 return G2pwd.Absorb('Cylinder',parmDict[hfx+'Absorption'],refl[5+im],0,0) … … 1289 1289 if 'Debye' in calcControls[hfx+'instType']: 1290 1290 if 'T' in calcControls[hfx+'histType']: 1291 return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption']*refl[14+im], parmDict[hfx+'2-theta'],0,0)1291 return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption']*refl[14+im],abs(parmDict[hfx+'2-theta']),0,0) 1292 1292 else: 1293 1293 return G2pwd.AbsorbDerv('Cylinder',parmDict[hfx+'Absorption'],refl[5+im],0,0) … … 1300 1300 pi2 = np.sqrt(2./np.pi) 1301 1301 if 'T' in calcControls[hfx+'histType']: 1302 sth2 = sind( parmDict[hfx+'2-theta']/2.)**21302 sth2 = sind(abs(parmDict[hfx+'2-theta'])/2.)**2 1303 1303 wave = refl[14+im] 1304 1304 else: #'C'W … … 1327 1327 pi2 = np.sqrt(2./np.pi) 1328 1328 if 'T' in calcControls[hfx+'histType']: 1329 sth2 = sind( parmDict[hfx+'2-theta']/2.)**21329 sth2 = sind(abs(parmDict[hfx+'2-theta'])/2.)**2 1330 1330 wave = refl[14+im] 1331 1331 else: #'C'W … … 1981 1981 Uniq = np.inner(refl[:3],SGMT) 1982 1982 refl[5+im] = GetReflPos(refl,im,0.0,A,pfx,hfx,calcControls,parmDict) #corrected reflection position 1983 Lorenz = sind( parmDict[hfx+'2-theta']/2)*refl[4+im]**4 #TOF Lorentz correction1983 Lorenz = sind(abs(parmDict[hfx+'2-theta'])/2)*refl[4+im]**4 #TOF Lorentz correction 1984 1984 # refl[5+im] += GetHStrainShift(refl,im,SGData,phfx,hfx,calcControls,parmDict) #apply hydrostatic strain shift 1985 1985 refl[6+im:8+im] = GetReflSigGamTOF(refl,im,G,GB,phfx,calcControls,parmDict) #peak sig & gam -
trunk/imports/G2pwd_fxye.py
r1713 r1766 384 384 elif 'Omega' in S.split('=')[0] or 'Theta' in S.split('=')[0]: #HIPD weirdness 385 385 try: 386 self.Sample['Omega'] = float(S.split('=')[1])386 self.Sample['Omega'] = 90.-float(S.split('=')[1]) 387 387 except: 388 388 pass 389 389 elif 'Chi' in S.split('=')[0]: 390 390 try: 391 self.Sample['Chi'] = float(S.split('=')[1])391 self.Sample['Chi'] = -float(S.split('=')[1]) 392 392 except: 393 393 pass
Note: See TracChangeset
for help on using the changeset viewer.