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_WorkFolderUtils.ipf

    r1236 r1239  
    810810                Print "Tube efficiency+shadowing correction NOT DONE" 
    811811        endif    
    812                  
    813         // (6) angle dependent transmission correction 
     812 
     813        // (6) Downstream window angle dependent transmission correction 
     814        // TODO: 
     815        // -- HARD WIRED value 
     816        // x- find a temporary way to pass this value into the function (global?) 
     817        // 
     818        // -- currently the transmission is set as a global (in V_VSANS_Preferences.ipf) 
     819        // -- need a permanent location in the file header to store the transmission value 
     820        // 
     821        NVAR/Z gDoWinTrans = root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor 
     822        if(NVAR_Exists(gDoWinTrans) != 1) 
     823                V_InitializeWindowTrans()               //set up the globals (need to check in multiple places) 
     824        endif 
     825                 
     826        if (gDoWinTrans == 1) 
     827                Print "Doing Large-angle Downstream window transmission correction"// for "+ detStr 
     828         
     829                for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     830                        detStr = StringFromList(ii, ksDetectorListAll, ";") 
     831                         
     832                        if(cmpstr(detStr,"B") == 0  && gIgnoreDetB == 1) 
     833                                // do nothing 
     834                        else 
     835                                Wave w = V_getDetectorDataW(fname,detStr) 
     836                                Wave w_err = V_getDetectorDataErrW(fname,detStr) 
     837                                 
     838                                V_DownstreamWindowTransmission(w,w_err,fname,detStr,destPath) 
     839                        endif 
     840                endfor 
     841        else 
     842                Print "Downstream Window Transmission correction NOT DONE" 
     843        endif    
     844                 
     845        // (7) angle dependent transmission correction 
    814846        // TODO: 
    815847        // x- this still needs to be filled in 
     
    822854        NVAR gDoTrans = root:Packages:NIST:VSANS:Globals:gDoTransmissionCor 
    823855        if (gDoTrans == 1) 
    824                 Print "Doing Large-angle transmission correction"// for "+ detStr 
     856                Print "Doing Large-angle sample transmission correction"// for "+ detStr 
    825857                for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    826858                        detStr = StringFromList(ii, ksDetectorListAll, ";") 
     
    839871        endif    
    840872         
    841         // (7) normalize to default monitor counts 
     873         
     874        // (8) normalize to default monitor counts 
    842875        // TODO(DONE) x- each detector is rescaled separately, but the rescaling factor is global (only one monitor!) 
    843876        // TODO -- but there are TWO monitors - so how to switch? 
     
    893926                Print "Monitor Normalization correction NOT DONE" 
    894927        endif 
    895          
    896          
    897         // (not done) angle dependent efficiency correction 
    898         // -- efficiency and shadowing are now done together (step 5) 
    899         NVAR doEfficiency = root:Packages:NIST:VSANS:Globals:gDoDetectorEffCor 
     928 
     929 
     930// flag to allow adding raw data files with different attenuation (normally not done)    
     931// -- yet to be implemented as a prefrence panel item 
     932//      NVAR gAdjustRawAtten = root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten       
     933         
     934         
     935//      // (not done) angle dependent efficiency correction 
     936//      // -- efficiency and shadowing are now done together (step 5) 
     937//      NVAR doEfficiency = root:Packages:NIST:VSANS:Globals:gDoDetectorEffCor 
    900938 
    901939//       
Note: See TracChangeset for help on using the changeset viewer.