Ignore:
Timestamp:
Mar 26, 2019 1:58:56 PM (4 years ago)
Author:
srkline
Message:

more changes to VCALC functionality and bug fixes for VCALC

File:
1 edited

Legend:

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

    r1133 r1134  
    165165        nPix_Y = VCALC_get_nPix_Y("FL") 
    166166 
     167        VC_MakeRealDistXYWaves(det_FL,detStr) 
     168 
    167169        //approx beam center in pixels 
    168170        xCtr = nPix_X-(F_L_sep/pixSizeX)                // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
    169171        yCtr = nPix_Y/2 
    170          
     172// put these values into the local folder for later use (in masking) 
     173        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     174        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     175        V_putDet_beam_center_x_pix("VCALC","FL",xCtr) 
     176        V_putDet_beam_center_y_pix("VCALC","FL",yCtr) 
     177                 
    171178        if(kBCTR_CM)            //convert to cm 
    172179                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    214221        nPix_Y = VCALC_get_nPix_Y("FR") 
    215222 
     223        VC_MakeRealDistXYWaves(det_FR,detStr) 
     224 
    216225// beam center in pixels 
    217226        xCtr = -(F_R_sep/pixSizeX)-1             
    218227        yCtr = nPix_Y/2  
     228// put these values into the local folder for later use (in masking) 
     229        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     230        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     231        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     232        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     233         
    219234        if(kBCTR_CM) 
    220235                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX")           //in mm 
     
    260275        nPix_Y = VCALC_get_nPix_Y("FT") 
    261276 
     277        VC_MakeRealDistXYWaves(det_FT,detStr) 
     278 
    262279// beam center in pixels 
    263280        xCtr = nPix_X/2 
    264281        yCtr = -(F_T_sep/2/pixSizeY)-1  
    265                  
     282// put these values into the local folder for later use (in masking) 
     283        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     284        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     285        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     286        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     287                         
    266288        if(kBCTR_CM) 
    267289                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    307329        nPix_Y = VCALC_get_nPix_Y("FB") 
    308330 
     331        VC_MakeRealDistXYWaves(det_FB,detStr) 
     332 
    309333// beam center in pixels 
    310334        xCtr = nPix_X/2 
    311         yCtr = nPix_Y+(F_B_sep/2/pixSizeY)               
    312          
     335        yCtr = nPix_Y-(F_B_sep/2/pixSizeY)               
     336// put these values into the local folder for later use (in masking) 
     337        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     338        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     339        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     340        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     341                 
    313342        if(kBCTR_CM) 
    314343                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    634663        qy_ML = 0 
    635664        qz_ML = 0        
    636          
     665 
    637666// TODO - these are to be set from globals, not hard-wired. N and pixelSixze will be known (or pre-measured) 
    638667// pixel sizes are in cm 
     
    642671        nPix_Y = VCALC_get_nPix_Y("ML") 
    643672 
    644         xCtr = nPix_X+(M_L_sep/pixSizeX)                // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
     673        VC_MakeRealDistXYWaves(det_ML,detStr) 
     674 
     675        xCtr = nPix_X-(M_L_sep/pixSizeX)                // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
    645676        yCtr = nPix_Y/2 
     677// put these values into the local folder for later use (in masking) 
     678        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     679        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     680        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     681        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
    646682                 
    647683        if(kBCTR_CM) 
     
    694730        nPix_Y = VCALC_get_nPix_Y("MR") 
    695731 
     732        VC_MakeRealDistXYWaves(det_MR,detStr) 
     733 
     734// beam center in pixels 
    696735        xCtr = -(M_R_sep/pixSizeX)-1             
    697736        yCtr = nPix_Y/2  
    698                  
     737// put these values into the local folder for later use (in masking) 
     738        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     739        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     740        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     741        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr)          
     742         
    699743        if(kBCTR_CM) 
    700744                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    740784        nPix_Y = VCALC_get_nPix_Y("MT") 
    741785 
     786        VC_MakeRealDistXYWaves(det_MT,detStr) 
     787 
     788// beam center in pixels 
    742789        xCtr = nPix_X/2 
    743790        yCtr = -(M_T_sep/pixSizeY)-1  
    744                  
     791// put these values into the local folder for later use (in masking) 
     792        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     793        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     794        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     795        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     796                         
    745797        if(kBCTR_CM) 
    746798                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    787839        nPix_Y = VCALC_get_nPix_Y("MB") 
    788840 
     841        VC_MakeRealDistXYWaves(det_MB,detStr) 
     842 
     843// beam center in pixels 
    789844        xCtr = nPix_X/2 
    790         yCtr = nPix_Y+(M_B_sep/pixSizeY)         
    791          
     845        yCtr = nPix_Y-(M_B_sep/pixSizeY)         
     846// put these values into the local folder for later use (in masking) 
     847        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     848        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     849        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     850        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     851                 
    792852        if(kBCTR_CM) 
    793853                Wave data_realDistX = $(folderPath+instPath+detStr+":data_realDistX") 
     
    11941254        yCtr = V_getDet_beam_center_y("VCALC","B") 
    11951255 
     1256// put these values into the local folder for later use (in masking) 
     1257        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_x_pix") 
     1258        Make/O/D/N=1 $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":beam_center_y_pix") 
     1259        V_putDet_beam_center_x_pix("VCALC",detStr,xCtr) 
     1260        V_putDet_beam_center_y_pix("VCALC",detStr,yCtr) 
     1261         
    11961262//      Print "Xctr B = ",xctr,yctr 
    11971263 
Note: See TracChangeset for help on using the changeset viewer.