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

    r1114 r1117  
    3030// for the change in July 2017 where the beam center is now defined in cm, rather than pixels. 
    3131// this need not ever change from 1 
     32// the back detector is always treated as a beam center in pixels, since it is the natural definition 
    3233Constant kBCTR_CM = 1                   //set to 1 to use beam center in cm. O to use pixels 
    3334 
     
    8485// 
    8586// 200 appears to be a better value - (empirical, based on teflon/converging pinhole data) 
    86 Constant kReadNoiseLevel = 200 
    87 //Constant kReadNoiseLevel = 208 
    88 Constant kReadNoiseLevel_Err = 14 
     87Constant kReadNoiseLevel_bin4 = 200 
     88//Constant kReadNoiseLevel_bin4 = 208 
     89Constant kReadNoiseLevel_Err_bin4 = 14 
     90 
     91 
     92// TODOHIGHRES: these values are complete fiction 
     93Constant kReadNoiseLevel_bin1 = 20 
     94Constant kReadNoiseLevel_Err_bin1 = 1 
    8995 
    9096 
     
    96102// middle CCD is not moved 
    97103// See V_ShiftBackDetImage() for implementation 
    98 Constant        kShift_TopX = 7 
    99 Constant                kShift_TopY = 105 
    100 Constant                kShift_BottomX = 5 
    101 Constant                kShift_BottomY = 35 
    102  
    103  
     104Constant        kShift_TopX_bin4 = 7 
     105Constant                kShift_TopY_bin4 = 105 
     106Constant                kShift_BottomX_bin4 = 5 
     107Constant                kShift_BottomY_bin4 = 35 
     108 
     109// TODOHIGHRES -- these values need to be verified. they are currently simply 4x the bin4 values 
     110Constant        kShift_TopX_bin1 = 28 
     111Constant                kShift_TopY_bin1 = 420 
     112Constant                kShift_BottomX_bin1 = 20 
     113Constant                kShift_BottomY_bin1 = 130 
    104114 
    105115 
     
    110120End 
    111121 
    112 //this is the main initualization procedure that must be the first thing 
     122//this is the main initialization procedure that must be the first thing 
    113123//done when opening a new Data reduction experiment 
    114124// 
     
    131141        V_InitFolders() 
    132142         
    133         VC_Initialize_Space()           //initialize folders for VCALC 
    134143         
    135144        V_InitFakeProtocols() 
     
    142151        Endif 
    143152//      V_ResizeCmdWindow() 
     153 
     154        VC_Initialize_Space()           //initialize folders for VCALC 
    144155 
    145156// TODO - be sure that NCNR is defined correctly         
     
    246257        //set flag if Demo Version is detected 
    247258        Variable/G root:Packages:NIST:VSANS:Globals:isDemoVersion = V_isDemo() 
     259 
    248260         
    249261        //set XML globals 
     
    452464        Printf "Hook cleaned out RawVSANS, experiment saved\r" 
    453465 
    454  
     466        NVAR gHighResBinning = root:Packages:NIST:VSANS:Globals:gHighResBinning 
     467        if(gHighResBinning == 1) 
    455468// these KillDF are a bad idea - it wipes out all of the current work 
    456469// whenever a save is done - which is the opposite of what you want 
    457470// to happen when you save! 
    458  
    459 //      KillDataFolder/Z root:Packages:NIST:VSANS:RAW 
    460 //      KillDataFolder/Z root:Packages:NIST:VSANS:SAM 
    461 //      KillDataFolder/Z root:Packages:NIST:VSANS:EMP 
    462 //      KillDataFolder/Z root:Packages:NIST:VSANS:BGD 
    463 //      KillDataFolder/Z root:Packages:NIST:VSANS:COR 
    464 //      KillDataFolder/Z root:Packages:NIST:VSANS:DIV 
    465 //      KillDataFolder/Z root:Packages:NIST:VSANS:MSK 
    466 //      KillDataFolder/Z root:Packages:NIST:VSANS:ABS 
    467 //      KillDataFolder/Z root:Packages:NIST:VSANS:CAL 
    468 //      KillDataFolder/Z root:Packages:NIST:VSANS:STO 
    469 //      KillDataFolder/Z root:Packages:NIST:VSANS:SUB 
    470 //      KillDataFolder/Z root:Packages:NIST:VSANS:DRK 
    471 //      KillDataFolder/Z root:Packages:NIST:VSANS:ADJ 
    472  
     471         
     472                Printf "Hook cleaned out WORK folders, experiment saved\r" 
     473 
     474                KillDataFolder/Z root:Packages:NIST:VSANS:RAW 
     475                KillDataFolder/Z root:Packages:NIST:VSANS:SAM 
     476                KillDataFolder/Z root:Packages:NIST:VSANS:EMP 
     477                KillDataFolder/Z root:Packages:NIST:VSANS:BGD 
     478                KillDataFolder/Z root:Packages:NIST:VSANS:COR 
     479                KillDataFolder/Z root:Packages:NIST:VSANS:DIV 
     480                KillDataFolder/Z root:Packages:NIST:VSANS:MSK 
     481                KillDataFolder/Z root:Packages:NIST:VSANS:ABS 
     482                KillDataFolder/Z root:Packages:NIST:VSANS:CAL 
     483                KillDataFolder/Z root:Packages:NIST:VSANS:STO 
     484                KillDataFolder/Z root:Packages:NIST:VSANS:SUB 
     485                KillDataFolder/Z root:Packages:NIST:VSANS:DRK 
     486                KillDataFolder/Z root:Packages:NIST:VSANS:ADJ 
     487                KillDataFolder/Z root:Packages:NIST:VSANS:VCALC 
     488 
     489        endif 
    473490// re-create anthing that was killed 
    474491        V_initFolders() 
Note: See TracChangeset for help on using the changeset viewer.