Ignore:
Timestamp:
Sep 18, 2017 12:08:50 PM (5 years ago)
Author:
srkline
Message:

many minor changes after real VSANS data collected.

additional procedures added to allow easy correction of the incorrect header information from NICE.

Most notable addition is the pinhole resolution added to the calculation and the I(q) output. White beam is also treated (incorrectly) as a gaussian distrivution, but the results of smeared fitting look to be quite good.

Trimming and sorting routines are now (pinhole) resolution aware.

File identification routines have been updated to use the proper definitions of "purpose" and "intent". Both fields are now in the catalog, to allow for better sorting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf

    r1062 r1064  
    13601360         
    13611361        // TODO: 
    1362         // -- is this where I do the resolution calculation? This is where I calculate the resolution in SANS (see CircSectAve) 
    1363         // -- or do I do it as a separate call? 
     1362        // -- This is where I calculate the resolution in SANS (see CircSectAve) 
    13641363        // -- use the isVCALC flag to exclude VCALC from the resolution calculation if necessary 
     1364        // -- from the top of the function, folderStr = work folder, type = "FLRTB" or other type of averaging 
    13651365        // 
     1366        nq = numpnts(qBin_qxqy) 
     1367        Make/O/D/N=(nq)  $(folderPath+":"+"sigmaQ_qxqy"+"_"+type) 
     1368        Make/O/D/N=(nq)  $(folderPath+":"+"qBar_qxqy"+"_"+type) 
     1369        Make/O/D/N=(nq)  $(folderPath+":"+"fSubS_qxqy"+"_"+type) 
     1370        Wave sigmaq = $(folderPath+":"+"sigmaQ_qxqy_"+type) 
     1371        Wave qbar = $(folderPath+":"+"qBar_qxqy_"+type) 
     1372        Wave fsubs = $(folderPath+":"+"fSubS_qxqy_"+type) 
     1373                                 
     1374 
     1375        Variable ret1,ret2,ret3 
     1376        Variable lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses 
     1377 
     1378// TODO: check the units of all of the inputs 
     1379 
     1380// lambda = wavelength [A] 
     1381        lambda = V_getWavelength(folderStr) 
     1382         
     1383// lambdaWidth = [dimensionless] 
     1384        lambdaWidth = V_getWavelength_spread(folderStr) 
     1385         
     1386// DDet = detector pixel resolution [cm]        **assumes square pixel 
     1387        DDet = 0.8              // TODO -- this is hard-wired 
     1388         
     1389// apOff = sample aperture to sample distance [cm] 
     1390        apOff = 10              // TODO -- this is hard-wired 
     1391         
     1392// S1 = source aperture diameter [mm] 
     1393        S1 = str2num(V_getSourceAp_size(folderStr)) 
     1394         
     1395// S2 = sample aperture diameter [mm] 
     1396        S2 = V_getSampleAp2_size(folderStr)*10          // sample ap 1 or 2? the "external" may not exist? 
     1397         
     1398// L1 = source to sample distance [m]  
     1399        L1 = V_getSourceAp_distance(folderStr)/100 
     1400 
     1401// L2 = sample to detector distance [m] 
     1402        L2 = V_getDet_ActualDistance(folderStr,type[0]+"L")/100         //TODO "L" panel is hard wired and is WRONG 
     1403         
     1404// BS = beam stop diameter [mm] 
     1405        //BS = V_getBeamStopC2_size(folderStr)          // TODO: what are the units? which BS is in? carr2, carr3, back, none? 
     1406        BS = 25.4                       //TODO hard-wired value 
     1407         
     1408// del_r = step size [mm] = binWidth*(mm/pixel)  
     1409        del_r = 1*8                     // TODO: 8mm/pixel hard-wired 
     1410 
     1411// usingLenses = flag for lenses = 0 if no lenses, non-zero if lenses are in-beam 
     1412        usingLenses = 0 
     1413 
     1414 
     1415Print "Resolution lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses" 
     1416Print lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses 
     1417 
     1418        ii=0 
     1419        do 
     1420                V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 
     1421                sigmaq[ii] = ret1        
     1422                qbar[ii] = ret2  
     1423                fsubs[ii] = ret3         
     1424                ii+=1 
     1425        while(ii<nq) 
    13661426         
    13671427         
Note: See TracChangeset for help on using the changeset viewer.