Changeset 1166


Ignore:
Timestamp:
Dec 15, 2013 3:20:41 PM (8 years ago)
Author:
vondreele
Message:

image calibration now finished - all images work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r1165 r1166  
    247247        x = radii[0]*cosd(a)
    248248        y = radii[1]*sind(a)
    249         X = (cphi*x+sphi*y+cent[0])*scalex      #convert mm to pixels
    250         Y = (-sphi*x+cphi*y+cent[1])*scaley
     249        X = (cphi*x-sphi*y+cent[0])*scalex      #convert mm to pixels
     250        Y = (sphi*x+cphi*y+cent[1])*scaley
    251251        X,Y,I,J = ImageLocalMax(image,pix,X,Y)
    252252        if I and J and I/J > reject:
     
    289289        zdis = (fplus-fminus)/2.
    290290    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))
    294294        eps = (v-f)/(delt-v)
    295295        radii[0] = -eps*(delt-f)/np.sqrt(eps**2-1.)                     #-minor axis
    296296        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
    298301#NB: zdis is || to major axis & phi is rotation of minor axis
    299302#thus shift from beam to ellipse center is [Z*sin(phi),-Z*cos(phi)]
Note: See TracChangeset for help on using the changeset viewer.