Ignore:
Timestamp:
Feb 14, 2020 2:44:16 PM (3 years ago)
Author:
srkline
Message:

adding downstream window transmission correction -- added function to detector corrections, and added item to preference panel. Transmission value is currently set as a global since the value is not part of the VSANS header. Global value defaults to T=1= no correction.

Other changes are cleanup of TODO items that were already done and tested. inline commnents have been updated.

File:
1 edited

Legend:

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

    r1237 r1239  
    2727                        Initialize_VSANSPreferences() 
    2828                endif 
     29                // these variables were recently created, so they may not exist if someone 
     30                // opens an old experiment -- then errors will result 
     31                if(exists("root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor") != 2) 
     32                        V_InitializeWindowTrans()               //set up the globals (need to check in multiple places) 
     33                endif 
     34                 
    2935                VSANSPref_Panel() 
    3036        Endif 
     
    9096        Variable/G root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization = 1 
    9197 
    92         val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCorPref", 1 ) 
    93         Variable/G root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCorPref = 0 
     98        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor", 1 ) 
     99        Variable/G root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor = 1 
     100        V_InitializeWindowTrans()               //set up the globals (need to check in multiple places) 
    94101 
    95102        // Special global to prevent fake data from "B" detector from being written out 
     
    127134end 
    128135 
     136Function V_InitializeWindowTrans() 
     137 
     138        Variable/G root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor = 1 
     139 
     140        // TODO -- when correcting this, search for all occurences!!! also in V_WorkFolderUtils !!! 
     141        // these global values need to be replaced with real numbers 
     142        // error is currently set to zero 
     143        Variable/G root:Packages:NIST:VSANS:Globals:gDownstreamWinTrans = 1 
     144        Variable/G root:Packages:NIST:VSANS:Globals:gDownstreamWinTransErr = 0 
     145 
     146end 
     147 
    129148Function V_LogScalePrefCheck(ctrlName,checked) : CheckBoxControl 
    130149        String ctrlName 
     
    239258        Variable checked 
    240259         
    241         NVAR gVal = root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCorPref 
     260        NVAR gVal = root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor 
    242261        gVal = checked 
    243262End 
     
    284303 
    285304//on tab(1) - VSANS - initially visible 
    286         CheckBox PrefCtrl_1a,pos={21,100},size={171,14},proc=V_LogScalePrefCheck,title="Use Log scaling for 2D data display" 
     305        CheckBox PrefCtrl_1a,pos={21,80},size={171,14},proc=V_LogScalePrefCheck,title="Use Log scaling for 2D data display" 
    287306        CheckBox PrefCtrl_1a,help={"Checking this will display 2D VSANS data with a logarithmic color scale of neutron counts. If not checked, the color mapping will be linear."} 
    288307        CheckBox PrefCtrl_1a,value= root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault 
     
    290309//      CheckBox PrefCtrl_1b,help={"Checking this will allow DRK correction to be used in reduction protocols. You will need to re-draw the protocol panel for this change to be visible."} 
    291310//      CheckBox PrefCtrl_1b,value= root:Packages:NIST:VSANS:Globals:gAllowDRK 
    292         CheckBox PrefCtrl_1c,pos={21,140},size={137,14},proc=V_UnityTransPref,title="Check for Transmission = 1" 
     311        CheckBox PrefCtrl_1c,pos={21,100},size={137,14},proc=V_UnityTransPref,title="Check for Transmission = 1" 
    293312        CheckBox PrefCtrl_1c,help={"Checking this will check for SAM or EMP Trans = 1 during data correction"} 
    294313        CheckBox PrefCtrl_1c,value= root:Packages:NIST:VSANS:Globals:gDoTransCheck 
    295         SetVariable PrefCtrl_1d,pos={21,170},size={200,15},title="Averaging Bin Width (pixels)" 
     314        SetVariable PrefCtrl_1d,pos={21,130},size={200,15},title="Averaging Bin Width (pixels)" 
    296315        SetVariable PrefCtrl_1d,limits={1,100,1},value= root:Packages:NIST:VSANS:Globals:gBinWidth 
    297         SetVariable PrefCtrl_1e,pos={21,195},size={200,15},title="# Phi Steps (annular avg)" 
     316        SetVariable PrefCtrl_1e,pos={21,155},size={200,15},title="# Phi Steps (annular avg)" 
    298317        SetVariable PrefCtrl_1e,limits={1,360,1},value= root:Packages:NIST:VSANS:Globals:gNPhiSteps 
     318        SetVariable PrefCtrl_1p,pos={21,180},size={200,15},title="Window Transmission" 
     319        SetVariable PrefCtrl_1p,limits={0.01,1,0.001},value= root:Packages:NIST:VSANS:Globals:gDownstreamWinTrans 
     320 
    299321         
    300322        CheckBox PrefCtrl_1f title="Do Transmssion Correction?",size={140,14},value=root:Packages:NIST:VSANS:Globals:gDoTransmissionCor,proc=V_DoTransCorrPref 
     
    314336        CheckBox PrefCtrl_1l value=root:Packages:NIST:VSANS:Globals:gDoNonLinearCor,pos={255,180},help={"Non-linear correction can't be turned off"} 
    315337        CheckBox PrefCtrl_1m title="Do Downstream Window Corr?",size={140,14},proc=V_DoDownstreamWindowCorPref 
    316         CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCorPref,pos={255,200},help={"TURN OFF ONLY FOR DEBUGGING."} 
     338        CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor,pos={255,200},help={"TURN OFF ONLY FOR DEBUGGING."} 
    317339//      CheckBox PrefCtrl_1n title="Do Monitor Normalization?",size={140,14},proc=V_DoMonitorNormPref 
    318340//      CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."} 
     
    329351//      CheckBox PrefCtrl_1h,disable=1 
    330352//      CheckBox PrefCtrl_1g,value=0,disable=2          // angle dependent efficiency not done yet 
    331         CheckBox PrefCtrl_1m,value=0,disable=2          // downstream window transmission no done yet 
     353//      CheckBox PrefCtrl_1m,value=0,disable=2          // downstream window transmission no done yet 
    332354 
    333355//on tab(2) - Analysis 
Note: See TracChangeset for help on using the changeset viewer.