Changeset 1465
- Timestamp:
- Aug 18, 2014 10:06:22 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r1405 r1465 822 822 return tax,tay,taz,tad,tabs 823 823 824 def ImageIntegrate(image,data,masks,blkSize=128,dlg=None ):824 def ImageIntegrate(image,data,masks,blkSize=128,dlg=None,returnN=False): 825 825 'Needs a doc string' #for q, log(q) bins need data['binType'] 826 826 import histogram2d as h2d … … 896 896 H0 = np.divide(H0,NST) 897 897 H0 = np.nan_to_num(H0) 898 del NST899 898 H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)]) 900 899 if 'log(q)' in data['binType']: … … 922 921 print "Elapsed time:","%8.3fs"%(time.time()-tbeg) 923 922 print 'Integration complete' 924 return H0,H1,H2 923 if returnN: #As requested by Steven Weigand 924 return H0,H1,H2,NST 925 else: 926 return H0,H1,H2 925 927 926 928 def MakeStrStaRing(ring,Image,Controls): -
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.8497409E-3]) 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+'2-theta']/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.8497409E-3]) 1103 pi2 = np.sqrt(np.pi/2.) 1104 if 'T' in calcControls[hfx+'histType']: 1105 sth2 = sind(parmDict[hfx+'2-theta']/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 = 1-2.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.0-0.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.0-STH2) 1143 # DFDEX = DBDE*STH2+DLDE*(1.0-STH2) 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 (plus-minus)/(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+'beta-q':[1./refl[4]**2,'bet'],hfx+'sig-0':[1.0,'sig'],hfx+'sig-1':[refl[4]**2,'sig'], 1886 1850 hfx+'sig-2':[refl[4]**4,'sig'],hfx+'sig-q':[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.