Changeset 1170 for trunk/GSASIIimage.py
- Timestamp:
- Dec 17, 2013 12:06:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r1169 r1170 373 373 tilt = data['tilt'] 374 374 dist = data['distance']/cosd(tilt) 375 x0 = data['distance']*tand(tilt) 375 376 phi = data['rotation'] 376 377 dep = data['DetDepth'] … … 379 380 dx = np.array(x-cent[0],dtype=np.float32) 380 381 dy = np.array(y-cent[1],dtype=np.float32) 382 D = ((dx-x0)**2+dy**2+data['distance']**2) #sample to pixel distance 381 383 X = np.array(([dx,dy,np.zeros_like(dx)]),dtype=np.float32).T 382 384 X = np.dot(X,makeMat(phi,2)) 383 385 Z = np.dot(X,makeMat(tilt,0)).T[2] 384 386 tth = npatand(np.sqrt(dx**2+dy**2-Z**2)/(dist-Z)) 385 dxy = peneCorr(tth,dep) 387 dxy = peneCorr(tth,dep) #depth corr not correct for tilted detector 386 388 DX = dist-Z+dxy 387 389 DY = np.sqrt(dx**2+dy**2-Z**2) 388 D = (DX**2+DY**2)/data['distance']**2 #for geometric correction = 1/cos(2theta)^2 if tilt=0. 389 tth = npatan2d(DY,DX) #depth corr not correct for tilted detector 390 tth = npatan2d(DY,DX) 390 391 dsp = wave/(2.*npsind(tth/2.)) 391 392 azm = (npatan2d(dy,dx)+azmthoff+720.)%360. 392 return tth,azm,D,dsp 393 G = D/data['distance']**2 #for geometric correction = 1/cos(2theta)^2 if tilt=0. 394 return tth,azm,G,dsp 393 395 394 396 def GetTth(x,y,data): … … 754 756 tamp = ma.getmask(ma.masked_less((tax-X)**2+(tay-Y)**2,(diam/2.)**2)) 755 757 tam = ma.mask_or(tam,tamp) 756 TA = np.array(GetTthAzmD(tax,tay,data)) #includes geom. corr. 758 TA = np.array(GetTthAzmD(tax,tay,data)) #includes geom. corr. as dist**2/d0**2 757 759 TA[1] = np.where(TA[1]<0,TA[1]+360,TA[1]) 758 760 return np.array(TA),tam #2-theta, azimuth & geom. corr. arrays & position mask … … 764 766 arcs = masks['Arcs'] 765 767 TA = np.dstack((ma.getdata(TA[1]),ma.getdata(TA[0]),ma.getdata(TA[2]))) #azimuth, 2-theta, dist 766 tax,tay,tad = np.dsplit(TA,3) #azimuth, 2-theta, dist 768 tax,tay,tad = np.dsplit(TA,3) #azimuth, 2-theta, dist**2/d0**2 767 769 for tth,thick in rings: 768 770 tam = ma.mask_or(tam.flatten(),ma.getmask(ma.masked_inside(tay.flatten(),max(0.01,tth-thick/2.),tth+thick/2.))) … … 777 779 taz = ma.compressed(ma.array(taz.flatten(),mask=tam)) 778 780 tad = ma.compressed(ma.array(tad.flatten(),mask=tam)) 779 return tax,tay,taz #*tad**2 wrong - why?781 return tax,tay,taz*tad 780 782 781 783 def ImageIntegrate(image,data,masks,blkSize=128,dlg=None):
Note: See TracChangeset
for help on using the changeset viewer.