Changeset 1166
- Timestamp:
- Dec 15, 2013 3:20:41 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r1165 r1166 247 247 x = radii[0]*cosd(a) 248 248 y = radii[1]*sind(a) 249 X = (cphi*x +sphi*y+cent[0])*scalex #convert mm to pixels250 Y = ( -sphi*x+cphi*y+cent[1])*scaley249 X = (cphi*x-sphi*y+cent[0])*scalex #convert mm to pixels 250 Y = (sphi*x+cphi*y+cent[1])*scaley 251 251 X,Y,I,J = ImageLocalMax(image,pix,X,Y) 252 252 if I and J and I/J > reject: … … 289 289 zdis = (fplus-fminus)/2. 290 290 else: #hyperbola! 291 f = d* tanb*stth/(cosb+stth)292 v = d*( tanb+tand(tth-tilt))293 delt = d*stth*(1 +stth*cosb)/(sinb*cosb*(stth+cosb))291 f = d*abs(tanb)*stth/(cosb+stth) 292 v = d*(abs(tanb)+tand(tth-abs(tilt))) 293 delt = d*stth*(1.+stth*cosb)/(abs(sinb)*cosb*(stth+cosb)) 294 294 eps = (v-f)/(delt-v) 295 295 radii[0] = -eps*(delt-f)/np.sqrt(eps**2-1.) #-minor axis 296 296 radii[1] = eps*(delt-f)/(eps**2-1.) #major axis 297 zdis = f+radii[1]*eps 297 if tilt > 0: 298 zdis = f+radii[1]*eps 299 else: 300 zdis = -f 298 301 #NB: zdis is || to major axis & phi is rotation of minor axis 299 302 #thus shift from beam to ellipse center is [Z*sin(phi),-Z*cos(phi)]
Note: See TracChangeset
for help on using the changeset viewer.