Changeset 1465 for trunk/GSASIIstrMath.py
 Timestamp:
 Aug 18, 2014 10:06:22 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIstrMath.py
r1464 r1465 799 799 800 800 def SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varyList): 801 ''' Single crystal extinction function; puts correction in ref[11] and returns 802 corrections needed for derivatives 801 ''' Single crystal extinction function; returns extinction & derivative 803 802 ''' 804 803 extCor = 1.0 … … 1074 1073 'Needs a doc string' 1075 1074 coef = np.array([0.5,0.25,0.10416667,0.036458333,0.0109375,2.8497409E3]) 1076 pi2 = np.sqrt( np.pi/2.)1075 pi2 = np.sqrt(2./np.pi) 1077 1076 if 'T' in calcControls[hfx+'histType']: 1078 1077 sth2 = sind(parmDict[hfx+'2theta']/2.)**2 1079 wave = refl[1 2]1078 wave = refl[14] 1080 1079 else: #'C'W 1081 1080 sth2 = sind(refl[5]/2.)**2 … … 1100 1099 def GetPwdrExtDerv(refl,pfx,phfx,hfx,calcControls,parmDict): 1101 1100 'Needs a doc string' 1102 coef = np.array([0.5,0.25,0.10416667,0.036458333,0.0109375,2.8497409E3]) 1103 pi2 = np.sqrt(np.pi/2.) 1104 if 'T' in calcControls[hfx+'histType']: 1105 sth2 = sind(parmDict[hfx+'2theta']/2.)**2 1106 wave = refl[12] 1107 else: #'C'W 1108 sth2 = sind(refl[5]/2.)**2 1109 wave = parmDict.get(hfx+'Lam',parmDict.get(hfx+'Lam1',1.0)) 1110 c2th = 1.2.0*sth2 1111 flv2 = refl[9]*(wave/parmDict[pfx+'Vol'])**2 1112 return 0. 1113 # 1114 # STH2 = STHETA**2 1115 # C2TH = 12.0*STH2 1116 # FLV2 = FCSQ*(LAM/VOL(IPHAS))**2 1117 # IF ( HTYPE(2:2).EQ.'X' ) FLV2 = 0.079411*FLV2*(1.0+C2TH**2)/2.0 1118 # XFAC = FLV2*EXTPOWD(IHST,IPHAS) 1119 # IF ( XFAC.LE.1.0 ) THEN 1120 # EXB = 1.0 1121 # DBDE = 500.0*FLV2 1122 # ELSE 1123 # EXB = 1.0/SQRT(1.0+XFAC) 1124 # DBDE = 0.5*FLV2*EXB**3 1125 # END IF 1126 # IF ( XFAC.LE.0.0 ) THEN 1127 # EXL = 1.0 1128 # DLDE = 0.0 1129 # ELSE IF ( XFAC.LE.1.0 ) THEN 1130 # EXL = 1.0 1131 # DLDE = 0.0 1132 # DO I=1,6 1133 # XN =XFAC**I 1134 # EXL = EXL+COEF(I)*XN 1135 # DLDE = DLDE+FLOAT(I)*FLV2*COEF(I)*XN/XFAC 1136 # END DO 1137 # ELSE 1138 # XFAC2 = 1.0/SQRT(XFAC) 1139 # EXL = PI2*(1.00.125/XFAC)*XFAC2 1140 # DLDE = 0.5*FLV2*PI2*XFAC2*(1.0/XFAC+0.375/XFAC**2) 1141 # END IF 1142 # EXTCOR = EXB*STH2+EXL*(1.0STH2) 1143 # DFDEX = DBDE*STH2+DLDE*(1.0STH2) 1101 delt = 0.001 1102 parmDict[phfx+'Extinction'] += delt 1103 plus = GetPwdrExt(refl,pfx,phfx,hfx,calcControls,parmDict) 1104 parmDict[phfx+'Extinction'] = 2.*delt 1105 minus = GetPwdrExt(refl,pfx,phfx,hfx,calcControls,parmDict) 1106 parmDict[phfx+'Extinction'] += delt 1107 return (plusminus)/(2.*delt) 1144 1108 1145 1109 def GetIntensityCorr(refl,uniq,G,g,pfx,phfx,hfx,SGData,calcControls,parmDict): … … 1186 1150 dIdPO[iPO] /= POcorr 1187 1151 dFdAb = GetAbsorbDerv(refl,hfx,calcControls,parmDict)*refl[14]/refl[16] #wave/abs corr 1188 dFdEx = GetPwdrExtDerv(refl,pfx,phfx,hfx,calcControls,parmDict) 1152 dFdEx = GetPwdrExtDerv(refl,pfx,phfx,hfx,calcControls,parmDict)/refl[17] #/ext corr 1189 1153 return dIdsh,dIdsp,dIdPola,dIdPO,dFdODF,dFdSA,dFdAb,dFdEx 1190 1154 … … 1885 1849 hfx+'betaq':[1./refl[4]**2,'bet'],hfx+'sig0':[1.0,'sig'],hfx+'sig1':[refl[4]**2,'sig'], 1886 1850 hfx+'sig2':[refl[4]**4,'sig'],hfx+'sigq':[1./refl[4]**2,'sig'], 1887 hfx+'Absorption':[dFdAb,'int'], hfx+'Extinction':[dFdEx,'int'],}1851 hfx+'Absorption':[dFdAb,'int'],phfx+'Extinction':[dFdEx,'int'],} 1888 1852 for name in names: 1889 1853 item = names[name]
Note: See TracChangeset
for help on using the changeset viewer.