Ignore:
Timestamp:
Nov 18, 2007 4:15:52 PM (15 years ago)
Author:
srkline
Message:

Three changes:

(1) in WorkfileUtils? - DetCorr?() now includes the correction to the detector efficiency at large angles as was described in John's memo of 3/20/2007. A small correction, increasing the measured intensity by at most a few percent at the largest scattering angles.

(2) Tweaks to the ascii output for Grasp, still untested.

(3) Changed beamstop x-tolerance to -8 cm to account for the 3" BS malfunction on NG3. Only affected recognition of transmission files, and easily worked around by resetting the BS position (NG1 Files to Trans function)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/WorkFileUtils.ipf

    r116 r206  
    367367        Variable ii,jj,dtdist,dtdis2 
    368368        Variable xi,xd,yd,rad,ratio,domega,xy 
     369        Variable lambda 
    369370         
    370371//      Print "...doing jacobian and non-linear corrections" 
     372        NVAR pixelsX = root:myGlobals:gNPixelsX 
     373        NVAR pixelsY = root:myGlobals:gNPixelsY 
    371374         
    372375        //set up values to send to auxiliary trig functions 
    373         xcenter = 64.5 
    374         ycenter = 64.5 
     376        xcenter = pixelsX/2 + 0.5               // == 64.5 for 128x128 Ordela 
     377        ycenter = pixelsY/2 + 0.5               // == 64.5 for 128x128 Ordela 
     378 
    375379        x0 = realsread[16] 
    376380        y0 = realsread[17] 
     
    383387        dtdis2 = dtdist^2 
    384388         
     389        lambda = realsRead[26] 
     390         
    385391        xx0 = dc_fx(x0,sx,sx3,xcenter) 
    386392        yy0 = dc_fy(y0,sy,sy3,ycenter) 
    387393         
    388         NVAR pixelsX = root:myGlobals:gNPixelsX 
    389 //      NVAR pixelsY = root:myGlobals:gNPixelsY 
     394 
    390395        //waves to contain repeated function calls 
    391         Make/O/N=(pixelsX) fyy,xx,yy            //Assumes square detector 
     396        Make/O/N=(pixelsX) fyy,xx,yy            //Assumes square detector !!! 
    392397        ii=0 
    393398        do 
     
    399404        while(ii<pixelsX) 
    400405         
    401 //      Make/O/N=(pixelsX,pixelsX) SolidAngle 
     406//      Make/O/N=(pixelsX,pixelsX) SolidAngle           // testing only 
    402407         
    403408        ii=0 
     
    413418                        domega = rad/dtdist 
    414419                        ratio = domega^3 
    415 //                      solidAngle[ii][jj] = ratio                       
     420//                      solidAngle[ii][jj] = ratio              //testing only   
    416421                        xy = xx[ii]*yy[jj] 
    417422                        data[ii][jj] *= xy*ratio 
     423                         
     424                        // multiplicative correction for detector efficiency JBG memo det_eff_cor2.doc 3/20/07 
     425                        // correction inserted 11/2007 SRK 
     426                         
     427                        data[ii][jj] *= DetEffCorr(lambda,dtdist,xd,yd) 
     428                         
     429//                      solidAngle[ii][jj] = DetEffCorr(lambda,dtdist,xd,yd)            //testing only 
     430                         
    418431                        jj+=1 
    419432                while(jj<pixelsX) 
     
    422435         
    423436        //clean up waves 
    424         Killwaves/Z fyy,xx,yy 
     437//      Killwaves/Z fyy,xx,yy 
    425438         
    426439        Return(0) 
     
    467480End 
    468481 
     482//distances passed in are in mm 
     483// dtdist is SDD 
     484// xd and yd are distances from the beam center to the current pixel 
     485// 
     486Function DetEffCorr(lambda,dtdist,xd,yd) 
     487        Variable lambda,dtdist,xd,yd 
     488         
     489        Variable theta,cosT,ff,stAl,stHe 
     490         
     491        theta = atan( (sqrt(xd^2 + yd^2))/dtdist ) 
     492        cosT = cos(theta) 
     493         
     494        stAl = 0.00967*lambda*0.8               //dimensionless, constants from JGB memo 
     495        stHe = 0.146*lambda*2.5 
     496         
     497        ff = exp(-stAl/cosT)*(1-exp(-stHe/cosT)) / ( exp(-stAl)*(1-exp(-stHe)) ) 
     498                 
     499        return(ff) 
     500End 
    469501//****************** 
    470502//direct port of the FORTRAN code for calculating the weighted 
Note: See TracChangeset for help on using the changeset viewer.