Changeset 1098


Ignore:
Timestamp:
May 1, 2018 8:52:07 AM (5 years ago)
Author:
srkline
Message:

renamed white beam smearing models so they would be grouped together on the file list.

Re-worked the logic and flow of the averaging/plotting/saving steps of the reduction protocol so that it would flow cleanly and leave room for changes for the multitude of different collimation conditions. The averaging routines are now aware of the collimation conditions so that the appropriate resolution can be calculated. The collimation string is also written out to the averaged data file as element[9] of the protocol. The hope is that one could key on this collimation string to decide how to proceed with the analysis.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
2 added
2 deleted
8 edited

Legend:

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

    r1097 r1098  
    13621362        String folderStr = "VCALC" 
    13631363        String collimationStr="pinhole"         // TODO: fill this in from the VCALC panel 
     1364        Print "collimationStr hard-wired to pinhole: update as VCALC is filled in" 
    13641365 
    13651366        switch(binType) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Slit.ipf

    r1078 r1098  
    268268// -- there is also wavelength smearing present 
    269269 
     270 
     271 
    270272// ASSUMPTION: As a first approximation, ignore the wavelength smearing component        
    271         // TODO : do I use 1/2 of dQy due to the symmetry of my smearing calculation?    
     273        // TODO : do I use 1/2 of dQy due to the symmetry of my smearing calculation?   (as infinite slit) 
    272274        sigmaq = -delQy/2 
    273275        qbar = -delQy/2 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf

    r1097 r1098  
    14231423         
    14241424// DDet = detector pixel resolution [cm]        **assumes square pixel 
    1425         DDet = 0.8              // TODO -- this is hard-wired 
    1426          
     1425        // V_getDet_pixel_fwhm_x(folderStr,detStr) 
     1426        // V_getDet_pixel_fwhm_y(folderStr,detStr) 
     1427//      DDet = 0.8              // TODO -- this is hard-wired 
     1428 
     1429        if(strlen(type) == 1) 
     1430                // it's "B" 
     1431                DDet = V_getDet_pixel_fwhm_x(folderStr,type)            // value is already in cm 
     1432        else 
     1433                DDet = V_getDet_pixel_fwhm_x(folderStr,type[0,1])               // value is already in cm 
     1434        endif 
     1435                 
    14271436// apOff = sample aperture to sample distance [cm] 
    14281437        apOff = 10              // TODO -- this is hard-wired 
    14291438         
    14301439// S1 = source aperture diameter [mm] 
    1431         S1 = str2num(V_getSourceAp_size(folderStr)) 
     1440// may be either circle or rectangle 
     1441        String s1_shape="",bs_shape="" 
     1442        Variable width,height,equiv_S1,equiv_bs 
     1443         
     1444         
     1445        s1_shape = V_getSourceAp_shape(folderStr) 
     1446        if(cmpstr(s1_shape,"CIRCLE") == 0) 
     1447                S1 = str2num(V_getSourceAp_size(folderStr)) 
     1448        else 
     1449                S1 = V_getSourceAp_height(folderStr)            // TODO: need the width or at least an equivalent diameter 
     1450        endif 
     1451         
    14321452         
    14331453// S2 = sample aperture diameter [cm] 
     
    14471467// if the type is say, MLRTB, then the implicit assumption in combining all four panels is that the resolution 
    14481468// is not an issue for the slightly different distances. 
    1449         L2 = V_getDet_ActualDistance(folderStr,type[0,1])/100           //convert cm to m 
     1469        if(strlen(type) == 1) 
     1470                // it's "B" 
     1471                L2 = V_getDet_ActualDistance(folderStr,type)/100                //convert cm to m 
     1472        else 
     1473                L2 = V_getDet_ActualDistance(folderStr,type[0,1])/100           //convert cm to m 
     1474        endif 
    14501475         
    14511476// BS = beam stop diameter [mm] 
    14521477//TODO:? which BS is in? carr2, carr3, none? 
    1453 // -- need to check the num_beamstops field, then description, then shape/size or shape/height and shape/width 
     1478// -- need to check the detector, num_beamstops field, then description, then shape/size or shape/height and shape/width 
    14541479// 
    14551480// TODO: the values in the file are incorrect!!! BS = 1000 mm diameter!!! 
    14561481//      BS = V_getBeamStopC2_size(folderStr)            // Units are [mm]  
    14571482        BS = 25.4                       //TODO hard-wired value 
     1483         
     1484//      bs_shape = V_getBeamStopC2_shape(folderStr) 
     1485//      if(cmpstr(s1_shape,"CIRCLE") == 0) 
     1486//              bs = V_getBeamStopC2_size(folderStr) 
     1487//      else 
     1488//              bs = V_getBeamStopC2_height(folderStr)   
     1489//      endif 
     1490 
     1491 
    14581492         
    14591493// del_r = step size [mm] = binWidth*(mm/pixel)  
     
    14841518// pinhole 
    14851519// pinhole_whiteBeam 
     1520// convergingPinholes 
     1521// 
     1522// *slit data should be reduced using the slit routine, not here, proceed but warn 
    14861523// narrowSlit 
    14871524// narrowSlit_whiteBeam 
    1488 // convergingPinholes 
    14891525 
    14901526        if(cmpstr(collimationStr,"pinhole") == 0) 
     
    15361572         
    15371573        endif 
     1574 
     1575 
     1576// should not end up here, except for odd testing cases 
     1577        if(cmpstr(collimationStr,"narrowSlit") == 0) 
     1578 
     1579                Print "??? Slit data is being averaged as pinhole - reset the AVERAGE parameters in the protocol ???" 
     1580                ii=0 
     1581                do 
     1582                        V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 
     1583                        sigmaq[ii] = ret1        
     1584                        qbar[ii] = ret2  
     1585                        fsubs[ii] = ret3         
     1586                        ii+=1 
     1587                while(ii<nq) 
     1588         
     1589        endif 
     1590         
     1591// should not end up here, except for odd testing cases 
     1592        if(cmpstr(collimationStr,"narrowSlit_whiteBeam") == 0) 
     1593 
     1594//              set lambdaWidth == 0 so that the gaussian resolution calculates only the geometry contribution. 
     1595// the white beam distribution will need to be flagged some other way 
     1596// 
     1597                Print "??? Slit data is being averaged as pinhole - reset the AVERAGE parameters in the protocol ???" 
     1598 
     1599                lambdaWidth = 0 
     1600                 
     1601                ii=0 
     1602                do 
     1603                        V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 
     1604                        sigmaq[ii] = ret1        
     1605                        qbar[ii] = ret2  
     1606                        fsubs[ii] = ret3         
     1607                        ii+=1 
     1608                while(ii<nq) 
     1609         
     1610        endif 
     1611 
     1612 
     1613 
    15381614                 
    15391615        SetDataFolder root: 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf

    r1097 r1098  
    121121#include "V_DummyFunctions" 
    122122// VSANS Analysis functions (under Analysis trunk, not Reduction) 
    123 #include "V_BroadPeak_WB" 
    124 #include "V_GaussSpheres_WB" 
     123#include "V_WB_BroadPeak" 
     124#include "V_WB_GaussSpheres" 
    125125 
    126126#include "V_Utilities_Comparisons" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf

    r1097 r1098  
    666666        for(ii=0;ii<num;ii+=1) 
    667667                detStr = StringFromList(ii, detListStr) 
    668                 nBeg = NumberByKey(detStr, nBegStr,"=",";") 
    669                 nEnd = NumberByKey(detStr, nEndStr,"=",";") 
    670                 if(!gIgnoreDetB) 
     668                if(cmpstr(detStr,"B")==0 && gIgnoreDetB) 
     669                                //skip det B, do nothing 
     670                else 
     671                        nBeg = NumberByKey(detStr, nBegStr,"=",";") 
     672                        nEnd = NumberByKey(detStr, nEndStr,"=",";") 
     673 
    671674                        V_TrimOneSet(folderStr,detStr,nBeg,nEnd) 
    672675                endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1097 r1098  
    25492549 
    25502550                                        V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType)         // this removes q=0 point, concatenates, sorts 
     2551                                 
     2552                                        prot[9] = collimationStr 
     2553                                         
    25512554                                        V_Write1DData("root:Packages:NIST:VSANS:",activeType,newFileName+"."+exten)             //don't pass the full path, just the name 
     2555                                 
    25522556                                endif 
    25532557                                 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_Comparisons.ipf

    r1097 r1098  
    366366         
    367367        guides = V_getNumberOfGuides(fname) 
    368         if(cmpstr(guides,"NARROW_SLIT") == 0) 
     368        if(cmpstr(guides,"NARROW_SLITS") == 0) 
    369369                slit = 1 
    370370        endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf

    r1097 r1098  
    125125        fprintf refnum, "Beginning Trim Points: %s\r\n",ProtoStr7 
    126126        fprintf refnum, "End Trim Points: %s\r\n",ProtoStr8 
     127        fprintf refnum, "COLLIMATION=%s\r\n",proto[9] 
    127128 
    128129// TODO 
Note: See TracChangeset for help on using the changeset viewer.