Ignore:
Timestamp:
Nov 28, 2017 9:39:57 AM (5 years ago)
Author:
srkline
Message:

Important change -- re-worked the calculation of how the detector panel "gap" is treated. It is now split equally between the panels rather than assigned to one panel. Makes no difference in the q calculation, simply a philosophical change that should make the measured beam centers make a little more sense, as they will be symmetric.

Changed the appearance and function of the panel to select the "trim" values for the combined 1D data sets. Data no longer needs to be saved as ITX and re-read into the panel. Simply uses the data binning popup and the current data.

File:
1 edited

Legend:

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

    r1073 r1074  
    152152         
    153153        // TODO 
    154         // -- GAP IS HARD-WIRED as a single constant value (there really are 4 values) 
     154        // -- GAP IS HARD-WIRED as constant values  
    155155        Variable offset,gap 
    156156 
    157157// kPanelTouchingGap is in mm    
    158 // the gap is added to the RIGHT and TOP panels ONLY 
    159 // TODO -- replace with V_getDet_panel_gap(fname,detStr) once it is added to the file 
    160         gap = kPanelTouchingGap 
     158// the gap is split equally between the panel pairs 
     159// TODO -- replace all of this with V_getDet_panel_gap(fname,detStr) once it is added to the file 
     160// these hard-wired values were determined from 6A and WB beam centers. LR values were exactly the same for 
     161// both beam considitions (+/- 0.0 mm). FTB was +/- 0.8 mm, MTB +/- 2 mm 
     162        if(cmpstr(detStr,"FL") == 0 || cmpstr(detStr,"FR") == 0) 
     163                gap = 3.2               //mm 
     164        endif 
     165        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
     166                gap = 8         //mm 
     167        endif 
     168        if(cmpstr(detStr,"ML") == 0 || cmpstr(detStr,"MR") == 0) 
     169                gap = 5.4               //mm 
     170        endif 
     171        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
     172                gap = 5         //mm 
     173        endif 
     174// TODO: this is the line to keep, to replace the hard-wired values 
     175//      gap = V_getDet_panel_gap(fname,detStr) 
    161176         
    162177        if(cmpstr(orientation,"vertical")==0) 
     
    182197                        if(cmpstr("L",detStr[1]) == 0) 
    183198//                              data_realDistX[][] = offset - (dimX - p)*tube_width                     // TODO should this be dimX-1-p = 47-p? 
    184                                 data_realDistX[][] = offset - (dimX - p)*tube_width - gap/2             // TODO should this be dimX-1-p = 47-p? 
     199                                data_realDistX[][] = offset - (dimX - p - 1/2)*tube_width - gap/2               // TODO should this be dimX-1-p = 47-p? 
    185200                        else 
    186201                        //      right 
    187202//                              data_realDistX[][] = tube_width*(p+1) + offset + gap            //add to the Right det, 
    188                                 data_realDistX[][] = tube_width*(p+1) + offset + gap/2          //add to the Right det 
     203                                data_realDistX[][] = tube_width*(p+1/2) + offset + gap/2                //add to the Right det 
    189204                        endif 
    190205                else 
     
    214229                        if(cmpstr("T",detStr[1]) == 0) 
    215230//                              data_realDistY[][] = tube_width*(q+1) + offset + gap                     
    216                                 data_realDistY[][] = tube_width*(q+1) + offset + gap/2                   
     231                                data_realDistY[][] = tube_width*(q+1/2) + offset + gap/2                         
    217232                        else 
    218233                                // bottom 
    219234//                              data_realDistY[][] = offset - (dimY - q)*tube_width     // TODO should this be dimY-1-q = 47-q? 
    220                                 data_realDistY[][] = offset - (dimY - q)*tube_width - gap/2     // TODO should this be dimY-1-q = 47-q? 
     235                                data_realDistY[][] = offset - (dimY - q - 1/2)*tube_width - gap/2       // TODO should this be dimY-1-q = 47-q? 
    221236                        endif 
    222237                else 
     
    375390 
    376391        variable edge,delta 
    377         Variable gap = kPanelTouchingGap                // TODO: -- replace with V_getDet_panel_gap(fname,detStr) 
    378  
     392        Variable gap  
     393 
     394// kPanelTouchingGap is in mm    
     395// the gap is split equally between the panel pairs 
     396// TODO -- replace all of this with V_getDet_panel_gap(fname,detStr) once it is added to the file 
     397// these hard-wired values were determined from 6A and WB beam centers. LR values were exactly the same for 
     398// both beam considitions (+/- 0.0 mm). FTB was +/- 0.8 mm, MTB +/- 2 mm 
     399        if(cmpstr(detStr,"FL") == 0 || cmpstr(detStr,"FR") == 0) 
     400                gap = 16.8              //mm 
     401        endif 
     402        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
     403                gap = 20                //mm 
     404        endif 
     405        if(cmpstr(detStr,"ML") == 0 || cmpstr(detStr,"MR") == 0) 
     406                gap = 14.6              //mm 
     407        endif 
     408        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
     409                gap = 15                //mm 
     410        endif 
     411// TODO: this is the line to keep, to replace the hard-wired values 
     412//      gap = V_getDet_panel_gap(fname,detStr) 
     413         
    379414// 
    380415        if(cmpstr(orientation,"vertical")==0) 
Note: See TracChangeset for help on using the changeset viewer.