Changeset 1178


Ignore:
Timestamp:
Dec 20, 2013 9:57:38 AM (8 years ago)
Author:
vondreele
Message:

penetration correction now for tilted detectors - seems to work (but hard to test for lack of sufficiently extreme example)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r1174 r1178  
    6565    return Inside
    6666   
    67 def peneCorr(tth,dep):
    68     'Needs a doc string'
    69     return dep*(1.-npcosd(tth))         #best one
     67def peneCorr(tth,dep,tilt=0.,azm=0.):
     68    'Needs a doc string'
     69    return dep*(1.-npcosd(abs(tilt*npsind(azm))-tth*npcosd(azm)))
     70#    return dep*(1.-npcosd(tth))         #best one
    7071#    return dep*npsind(tth)             #not as good as 1-cos2Q
    7172       
     
    163164        phi = chi-90.               #get rotation of major axis from tilt axis
    164165        tth = 2.0*npasind(wave/(2.*dsp))
    165         dxy = peneCorr(tth,dep)
     166        phi0 = npatan2d(y-y0,x-x0)
     167        dxy = peneCorr(tth,dep,tilt,phi0)
    166168        ttth = nptand(tth)
    167169        stth = npsind(tth)
     
    180182        zdis = (fplus-fminus)/2.
    181183        Robs = np.sqrt((x-x0)**2+(y-y0)**2)
    182         phi0 = npatan2d(y-y0,x-x0)
    183184        rsqplus = R0**2+R1**2
    184185        rsqminus = R0**2-R1**2
     
    313314    dep = data['DetDepth']
    314315    tth = 2.0*asind(data['wavelength']/(2.*dsp))
    315     dxy = peneCorr(tth,dep)
     316    dxy = peneCorr(tth,dep,tilt)
    316317    dist = data['distance']
    317318    return GetEllipse2(tth,dxy,dist,cent,tilt,phi)
     
    385386    Z = np.dot(X,makeMat(tilt,0)).T[2]
    386387    tth = npatand(np.sqrt(dx**2+dy**2-Z**2)/(dist-Z))
    387     dxy = peneCorr(tth,dep)     #depth corr not correct for tilted detector
     388    dxy = peneCorr(tth,dep,tilt,npatan2d(dy,dx))
    388389    DX = dist-Z+dxy
    389390    DY = np.sqrt(dx**2+dy**2-Z**2)
Note: See TracChangeset for help on using the changeset viewer.