Ignore:
Timestamp:
Apr 22, 2016 5:02:30 PM (7 years ago)
Author:
srkline
Message:

lots of changes to plotting of q-values, generating fake data with non-linear corrections, masking of data, etc.

File:
1 edited

Legend:

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

    r992 r993  
    6666        WAVE det_FR = $(folderPath+instPath+detStr+":det_"+detStr)       
    6767        WAVE qTot_FR = $(folderPath+instPath+detStr+":qTot_"+detStr) 
     68//      WAVE qTot_FR = $("root:Packages:NIST:VSANS:RAW:entry:instrument:detector_FR:qTot_FR") 
    6869         
    6970        detStr = "FT" 
     
    7576        WAVE qTot_FB = $(folderPath+instPath+detStr+":qTot_"+detStr) 
    7677 
     78         
     79         
    7780        FillPanel_wModelData(det_FL,qTot_FL,"FL") 
    7881        FillPanel_wModelData(det_FR,qTot_FR,"FR") 
     
    8285        SetDataFolder root: 
    8386                 
    84         // set any "shadowed" area of the T/B detectors to NaN to get a realitic 
     87        // set any "shadowed" area of the T/B detectors to NaN to get a realistic 
    8588        // view of how much of the detectors are actually collecting data 
    8689        // -- I can get the separation L/R from the panel - only this "open" width is visible. 
     
    175178        xCtr = nPix_X+(F_LR_sep/2/pixSizeX)             // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
    176179        yCtr = nPix_Y/2  
    177         VC_Detector_2Q(det_FL,qTot_FL,qx_FL,qy_FL,qz_FL,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
    178 //      Print "xy for FL = ",xCtr,yCtr 
     180        //put these  beam center values into the local folder 
     181        V_putDet_beam_center_x("VCALC","FL",xCtr) 
     182        V_putDet_beam_center_y("VCALC","FL",yCtr) 
     183         
     184//      VC_Detector_2Q(det_FL,qTot_FL,qx_FL,qy_FL,qz_FL,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     185        VC_Detector_2Q_NonLin(det_FL,qTot_FL,qx_FL,qy_FL,qz_FL,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,"FL") 
     186        Print "xy for FL = ",xCtr,yCtr 
    179187         
    180188        //set the wave scaling for the detector image so that it can be plotted in q-space 
     
    207215         
    208216        xCtr = -(F_LR_sep/2/pixSizeX)-1          
    209         yCtr = nPix_Y/2  
    210         VC_Detector_2Q(det_FR,qTot_FR,qx_FR,qy_FR,qz_FR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     217        yCtr = nPix_Y/2 
     218        //put these  beam center values into the local folder 
     219        V_putDet_beam_center_x("VCALC","FR",xCtr) 
     220        V_putDet_beam_center_y("VCALC","FR",yCtr)        
     221//      VC_Detector_2Q(det_FR,qTot_FR,qx_FR,qy_FR,qz_FR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     222        VC_Detector_2Q_NonLin(det_FR,qTot_FR,qx_FR,qy_FR,qz_FR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,"FR") 
     223 
    211224//      Print "xy for FR = ",xCtr,yCtr 
    212225        SetScale/I x WaveMin(qx_FR),WaveMax(qx_FR),"", det_FR           //this sets the left and right ends of the data scaling 
     
    235248         
    236249        xCtr = nPix_X/2 
    237         yCtr = -(F_TB_sep/2/pixSizeY)-1    
     250        yCtr = -(F_TB_sep/2/pixSizeY)-1  
     251                //put these  beam center values into the local folder 
     252        V_putDet_beam_center_x("VCALC","FT",xCtr) 
     253        V_putDet_beam_center_y("VCALC","FT",yCtr) 
     254           
    238255        // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    239         VC_Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     256//      VC_Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     257        VC_Detector_2Q_NonLin(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY,"FT") 
     258 
    240259//      Print "xy for FT = ",xCtr,yCtr 
    241260        SetScale/I x WaveMin(qx_FT),WaveMax(qx_FT),"", det_FT           //this sets the left and right ends of the data scaling 
     
    265284        xCtr = nPix_X/2 
    266285        yCtr = nPix_Y+(F_TB_sep/2/pixSizeY)             // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
     286                //put these  beam center values into the local folder 
     287        V_putDet_beam_center_x("VCALC","FB",xCtr) 
     288        V_putDet_beam_center_y("VCALC","FB",yCtr) 
     289         
    267290        // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    268         VC_Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     291//      VC_Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     292        VC_Detector_2Q_NonLin(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY,"FB") 
     293 
    269294//      Print "xy for FB = ",xCtr,yCtr 
    270295        SetScale/I x WaveMin(qx_FB),WaveMax(qx_FB),"", det_FB           //this sets the left and right ends of the data scaling 
     
    572597        xCtr = nPix_X+(M_LR_sep/2/pixSizeX)             // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
    573598        yCtr = nPix_Y/2  
    574         VC_Detector_2Q(det_ML,qTot_ML,qx_ML,qy_ML,qz_ML,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     599                //put these  beam center values into the local folder 
     600        V_putDet_beam_center_x("VCALC","ML",xCtr) 
     601        V_putDet_beam_center_y("VCALC","ML",yCtr) 
     602         
     603//      VC_Detector_2Q(det_ML,qTot_ML,qx_ML,qy_ML,qz_ML,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     604        VC_Detector_2Q_NonLin(det_ML,qTot_ML,qx_ML,qy_ML,qz_ML,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,"ML") 
     605 
    575606//      Print "xy for ML = ",xCtr,yCtr 
    576607         
     
    607638        xCtr = -(M_LR_sep/2/pixSizeX)-1          
    608639        yCtr = nPix_Y/2 
    609         VC_Detector_2Q(det_MR,qTot_MR,qx_MR,qy_MR,qz_MR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     640                //put these  beam center values into the local folder 
     641        V_putDet_beam_center_x("VCALC","MR",xCtr) 
     642        V_putDet_beam_center_y("VCALC","MR",yCtr) 
     643         
     644//      VC_Detector_2Q(det_MR,qTot_MR,qx_MR,qy_MR,qz_MR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     645        VC_Detector_2Q_NonLin(det_MR,qTot_MR,qx_MR,qy_MR,qz_MR,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,"MR") 
     646 
    610647//      Print "xy for MR = ",xCtr,yCtr 
    611648        SetScale/I x WaveMin(qx_MR),WaveMax(qx_MR),"", det_MR           //this sets the left and right ends of the data scaling 
     
    635672        xCtr = nPix_X/2 
    636673        yCtr = -(M_TB_sep/2/pixSizeY)-1  
     674                //put these  beam center values into the local folder 
     675        V_putDet_beam_center_x("VCALC","MT",xCtr) 
     676        V_putDet_beam_center_y("VCALC","MT",yCtr) 
     677         
    637678        // global sdd_offset is in (mm), convert to meters here for the Q-calculation   
    638         VC_Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     679//      VC_Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     680        VC_Detector_2Q_NonLin(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY,"MT") 
     681 
    639682//      Print "xy for MT = ",xCtr,yCtr 
    640683        SetScale/I x WaveMin(qx_MT),WaveMax(qx_MT),"", det_MT           //this sets the left and right ends of the data scaling 
     
    664707        xCtr = nPix_X/2 
    665708        yCtr = nPix_Y+(M_TB_sep/2/pixSizeY)             // TODO  -- check -- starting from 47 rather than 48 (but I'm in pixel units for centers)?? 
     709        //put these  beam center values into the local folder 
     710        V_putDet_beam_center_x("VCALC","MB",xCtr) 
     711        V_putDet_beam_center_y("VCALC","MB",yCtr) 
     712         
    666713                // global sdd_offset is in (mm), convert to meters here for the Q-calculation 
    667         VC_Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     714//      VC_Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 
     715        VC_Detector_2Q_NonLin(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY,"MB") 
     716 
    668717//      Print "xy for MB = ",xCtr,yCtr 
    669718        SetScale/I x WaveMin(qx_MB),WaveMax(qx_MB),"", det_MB           //this sets the left and right ends of the data scaling 
     
    9941043        xCtr = trunc( DimSize(det_B,0)/2 )              //should be 150/2=75 
    9951044        yCtr = trunc( DimSize(det_B,1)/2 )              //should be 150/2=75 
    996         VC_Detector_2Q(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     1045                //put these  beam center values into the local folder 
     1046        V_putDet_beam_center_x("VCALC","B",xCtr) 
     1047        V_putDet_beam_center_y("VCALC","B",yCtr) 
     1048         
     1049//      VC_Detector_2Q(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) 
     1050        // this will always do the linear calculation, since the real-space distance waves do not exist 
     1051        VC_Detector_2Q_NonLin(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,"B") 
     1052 
    9971053         
    9981054        //set the wave scaling for the detector image so that it can be plotted in q-space 
Note: See TracChangeset for help on using the changeset viewer.