Ignore:
Timestamp:
Apr 5, 2019 3:11:26 PM (4 years ago)
Author:
srkline
Message:

updates to the beam center corrections that take into account the lateral variation of zero points of the tubes. This is an important correction to the reference beam center, especially when the graphite monochrmoator is used.

various bug fixes included as part of reduction , largely to catch missing or incorrect information in the file header.

New "patch" functions have been added for number of guides, beam stops, source aperture, etc. which were missing in the file and caused the resolution calculation to be totally incorrect.

File:
1 edited

Legend:

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

    r1131 r1141  
    347347//              xctr+=1 
    348348//              yctr+=1 
     349 
     350// correct for the zero position (y-position) on the L/R panels not being exactly equal 
     351// the lateral scan data from Dec 2018 is used to correct this. The span of zero points 
     352// is relatively small (+- 0.5 pixel) but is significant for data using graphite monochromator 
     353//       
     354        // check that the correction waves exist, if not, generate them V_TubeZeroPointTables() 
     355                Wave/Z tube_num = $("root:Packages:NIST:VSANS:Globals:tube_" + detStr) 
     356                Wave/Z yCtr_tube = $("root:Packages:NIST:VSANS:Globals:yCtr_" + detStr) 
     357                if(!WaveExists(tube_num)) 
     358                        Execute "V_TubeZeroPointTables()" 
     359                        Wave/Z tube_num = $("root:Packages:NIST:VSANS:Globals:tube_" + detStr) 
     360                        Wave/Z yCtr_tube = $("root:Packages:NIST:VSANS:Globals:yCtr_" + detStr) 
     361                endif 
     362                 
     363                Variable yCorrection = interp(xCtr,tube_num,yCtr_tube) 
     364                Variable yPixSize = V_getDet_y_pixel_size(gCurDispType,detStr) 
     365                yPixSize /= 10          // convert mm to cm 
     366                // offsets were determined in Dec 2018 using: 
     367                // FR tube # 7 = 61.70 pix 
     368                // MR tube # 10 = 61.94 pix 
    349369                 
    350370                Print "X-center (in array coordinates 0->n-1 ) = ",xctr 
     
    353373                Print "X-center (cm) = ",x_mm/10 
    354374                Print "Y-center (cm) = ",y_mm/10 
    355                  
     375 
    356376                if(cmpstr(detStr,"FR") == 0) 
     377                        Print "Reference Y-Center is corrected for tube #7 zero position"                
     378 
     379                        yCorrection = 61.70 - yCorrection 
     380                        Print "yCorrection (pix) = ",yCorrection 
     381                        Print "yCorrection (cm) = ",yCorrection*yPixSize 
    357382                        Print "FRONT Reference X-center (cm) = ",x_mm/10 
    358                         Print "FRONT Reference Y-center (cm) = ",y_mm/10 
     383                        Print "FRONT Reference Y-center (cm) = ",y_mm/10 + yCorrection*yPixSize 
    359384                endif 
    360385 
    361386                if(cmpstr(detStr,"MR") == 0) 
     387                        Print "Reference Y-Center is corrected for tube #10 zero position"               
     388 
     389                        yCorrection = 61.94 - yCorrection 
     390                        Print "yCorrection (pix) = ",yCorrection 
     391                        Print "yCorrection (cm) = ",yCorrection*yPixSize 
    362392                        Print "MIDDLE Reference X-center (cm) = ",x_mm/10 
    363                         Print "MIDDLE Reference Y-center (cm) = ",y_mm/10 
     393                        Print "MIDDLE Reference Y-center (cm) = ",y_mm/10 + yCorrection*yPixSize 
    364394                endif 
    365395                 
     
    367397// these corrections are exactly the opposite (subtract, not add) of what is done in V_fDeriveBeamCenters(xFR,yFR,xMR,yMR) 
    368398                if(cmpstr(detStr,"FL") == 0) 
    369                         Print "FRONT Reference X-center (cm) (Velocity Selector) = ",x_mm/10 - kBCtrOffset_FL_x         // NEW Dec 2018 values 
    370                         Print "FRONT Reference Y-center (cm) (Velocity Selector) = ",y_mm/10 - kBCtrOffset_FL_y 
     399                        Print "FRONT Reference X-center (cm) = ",x_mm/10 - kBCtrOffset_FL_x     // NEW Dec 2018 values 
     400                        Print "FRONT Reference Y-center (cm) = ",y_mm/10 - kBCtrOffset_FL_y 
    371401                endif 
    372402                 
    373403                if(cmpstr(detStr,"ML") == 0) 
    374                         Print "MIDDLE Reference X-center (cm) (Velocity Selector) = ",x_mm/10 - kBCtrOffset_ML_x 
    375                         Print "MIDDLE Reference Y-center (cm) (Velocity Selector) = ",y_mm/10 - kBCtrOffset_ML_y 
     404                        Print "MIDDLE Reference X-center (cm) = ",x_mm/10 - kBCtrOffset_ML_x 
     405                        Print "MIDDLE Reference Y-center (cm) = ",y_mm/10 - kBCtrOffset_ML_y 
    376406                endif 
    377407        endif 
Note: See TracChangeset for help on using the changeset viewer.