Ignore:
Timestamp:
Oct 18, 2018 12:09:16 PM (4 years ago)
Author:
srkline
Message:

extensive changes to accomodate 1x1 binning of the HighRes? detector. It is implemented as a global flag. Currently only 4x4 and 1x1 are allowed. 1x1 has never been tested in reality, only simulated data - so my assumed dimensions may not be correct. look for TODOHIGHRES in the file for places that may need to be updated for different file dimensions. Testing of the simulated data is proving to be excruciatingly slow, but passable for a test. Speed optimization will be needed if this is the final solution. Memory management will also be an issue since every "copy" of the highRes matrix is enormous. Carry as few of these around as possible in the future to keep the experiment size to something reasonable.

File:
1 edited

Legend:

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

    r1116 r1117  
    25262526                // and determine box sum and error 
    25272527                // store these locally 
    2528                  
    2529  
    2530                 if(cmpstr(detStr,"B") == 0 ) 
    2531                         Print "Median Filtering RAW data (3 passes)" 
    2532                         Wave w = V_getDetectorDataW("RAW",detStr) 
    2533                         MatrixFilter /N=3 /P=3 median w 
     2528                Variable tmpReadNoiseLevel,tmpReadNoiseLevel_Err 
     2529 
     2530        // TODO: change the math to do the filtering and subtraction both here in this step, 
     2531        // then determine the patch sum and proper error propogation. 
     2532        // 
     2533        // just do the median filter now, do the background subtraction later on the patch 
     2534                if(isBack) 
     2535                        Wave w = V_getDetectorDataW("RAW","B") 
     2536                        NVAR gHighResBinning = root:Packages:NIST:VSANS:Globals:gHighResBinning 
     2537                        switch(gHighResBinning) 
     2538                                case 1: 
     2539                                        tmpReadNoiseLevel = kReadNoiseLevel_bin1                // a constant value 
     2540                                        tmpReadNoiseLevel_Err = kReadNoiseLevel_Err_bin1                // a constant value 
     2541                                         
     2542                                        MatrixFilter /N=11 /P=1 median w                        //              /P=n flag sets the number of passes (default is 1 pass) 
     2543                                         
     2544                                        Print "*** median noise filter 11x11 applied to the back detector (1 pass) ***" 
     2545                                        break 
     2546                                case 4: 
     2547                                        tmpReadNoiseLevel = kReadNoiseLevel_bin4                // a constant value 
     2548                                        tmpReadNoiseLevel_Err = kReadNoiseLevel_Err_bin4                // a constant value 
     2549                                                                         
     2550                                        MatrixFilter /N=3 /P=3 median w                 //              /P=n flag sets the number of passes (default is 1 pass) 
     2551                                         
     2552                                        Print "*** median noise filter 3x3 applied to the back detector (3 passes) ***" 
     2553                                        break 
     2554                                default: 
     2555                                        Abort "No binning case matches in V_AskForAbsoluteParams_Quest" 
     2556                        endswitch 
     2557                         
    25342558                endif 
    25352559 
     
    25612585// 
    25622586                        nPixInBox = (xyBoxW[1] - xyBoxW[0])*(xyBoxW[3]-xyBoxW[2]) 
    2563                         emptyCts -= kReadNoiseLevel*nPixInBox 
    2564                         empty_ct_err = sqrt(empty_ct_err^2 + (kReadNoiseLevel_Err*nPixInBox)^2) 
     2587                        emptyCts -= tmpReadNoiseLevel*nPixInBox 
     2588                        empty_ct_err = sqrt(empty_ct_err^2 + (tmpReadNoiseLevel_Err*nPixInBox)^2) 
    25652589                                                 
    25662590                        Print "adjusted empty counts = ",emptyCts 
Note: See TracChangeset for help on using the changeset viewer.