Changeset 1170
 Timestamp:
 Dec 17, 2013 12:06:10 PM (8 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASII.py
r1168 r1170 2141 2141 while item: 2142 2142 name = self.PatternTree.GetItemText(item) 2143 if name not in ['Notebook','Controls','Covariance','Constraints','Restraints','Phases']: 2143 if name not in ['Notebook','Controls','Covariance','Constraints', 2144 'Restraints','Phases','Rigid bodies']: 2144 2145 if 'PWDR' in name: ifPWDR = True 2145 2146 if 'IMG' in name: ifIMG = True 
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(xcent[0],dtype=np.float32) 380 381 dy = np.array(ycent[1],dtype=np.float32) 382 D = ((dxx0)**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**2Z**2)/(distZ)) 385 dxy = peneCorr(tth,dep) 387 dxy = peneCorr(tth,dep) #depth corr not correct for tilted detector 386 388 DX = distZ+dxy 387 389 DY = np.sqrt(dx**2+dy**2Z**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((taxX)**2+(tayY)**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 #2theta, 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, 2theta, dist 766 tax,tay,tad = np.dsplit(TA,3) #azimuth, 2theta, dist 768 tax,tay,tad = np.dsplit(TA,3) #azimuth, 2theta, 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,tththick/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.