Ignore:
Timestamp:
Feb 25, 2016 4:30:38 PM (7 years ago)
Author:
srkline
Message:

more changes and additons to display VSANS data

adding functions for IvsQ plotting

coverted much of VCALC to have similar folder structure as HDF to allow re-use of the Q-binning procedures from VCALC with real data in work files.

re-working the beam center finder to get it to work with work file data rather then only VCALC.

new plotting routines for the panels to rescale to the beam center (still in pixels, though)

File:
1 edited

Legend:

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

    r955 r982  
    2828// LR banks are defined as (48,256) (n,m), sumRows gives sum w/ dimension (n x 1) 
    2929// 
    30 Function V_fBinDetector_byRows(folderStr,type) 
    31         String folderStr,type 
     30// updated to new folder structure Feb 2016 
     31// folderStr = RAW,SAM, VCALC or other 
     32// detStr is the panel identifer "ML", etc. 
     33Function VC_fBinDetector_byRows(folderStr,detStr) 
     34        String folderStr,detStr 
    3235         
    33         SetDataFolder root:Packages:NIST:VSANS:VCALC     
     36//      SetDataFolder root:Packages:NIST:VSANS:VCALC     
    3437         
    3538        Variable pixSizeX,pixSizeY,delQx, delQy 
     39        Variable isVCALC=0 
     40         
     41        if(cmpstr(folderStr,"VCALC") == 0) 
     42                isVCALC = 1 
     43        endif 
    3644 
    37         WAVE inten = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":det_"+type)                // 2D detector data 
    38         WAVE/Z iErr = $("iErr_"+type)                   // 2D errors -- may not exist, especially for simulation 
    39         Wave qTotal = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qTot_"+type)                      // 2D q-values 
    40         Wave qx = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qx_"+type) 
    41         Wave qy = $("root:Packages:NIST:VSANS:VCALC:"+folderStr+":qy_"+type) 
     45        String folderPath = "root:Packages:NIST:VSANS:"+folderStr 
     46        String instPath = ":entry:entry:instrument:detector_"    
    4247         
    43         pixSizeX = VCALC_getPixSizeX(type) 
    44         pixSizeY = VCALC_getPixSizeY(type) 
     48        if(isVCALC) 
     49                WAVE inten = $(folderPath+instPath+detStr+":det_"+detStr)               // 2D detector data 
     50                WAVE/Z iErr = $("asdf_iErr_"+detStr)                    // TODO: 2D errors -- may not exist, especially for simulation 
     51        else 
     52                Wave inten = V_getDetectorDataW(folderStr,detStr) 
     53                Wave iErr = V_getDetectorDataErrW(folderStr,detStr) 
     54        endif 
     55 
     56        Wave qTotal = $(folderPath+instPath+detStr+":qTot_"+detStr)                     // 2D q-values 
     57        Wave qx = $(folderPath+instPath+detStr+":qx_"+detStr) 
     58        Wave qy = $(folderPath+instPath+detStr+":qy_"+detStr) 
     59 
     60// ?? TODO not needed here?      
     61//      pixSizeX = VCALC_getPixSizeX(detStr) 
     62//      pixSizeY = VCALC_getPixSizeY(detStr) 
    4563         
    4664        delQx = abs(qx[0][0] - qx[1][0]) 
     
    5270        nq = DimSize(inten,0)           //nq == the number of columns (x dimension) 
    5371         
    54         SetDataFolder root:Packages:NIST:VSANS:VCALC     
     72//      SetDataFolder $(folderPath+instPath+detStr)      
    5573 
    56         Make/O/D/N=(nq)  $("iBin_qxqy_"+type) 
    57         Make/O/D/N=(nq)  $("qBin_qxqy_"+type) 
    58         Make/O/D/N=(nq)  $("nBin_qxqy_"+type) 
    59         Make/O/D/N=(nq)  $("iBin2_qxqy_"+type) 
    60         Make/O/D/N=(nq)  $("eBin_qxqy_"+type) 
    61         Make/O/D/N=(nq)  $("eBin2D_qxqy_"+type) 
     74        Make/O/D/N=(nq)  $(folderPath+":"+"iBin_qxqy_"+detStr) 
     75        Make/O/D/N=(nq)  $(folderPath+":"+"qBin_qxqy_"+detStr) 
     76        Make/O/D/N=(nq)  $(folderPath+":"+"nBin_qxqy_"+detStr) 
     77        Make/O/D/N=(nq)  $(folderPath+":"+"iBin2_qxqy_"+detStr) 
     78        Make/O/D/N=(nq)  $(folderPath+":"+"eBin_qxqy_"+detStr) 
     79        Make/O/D/N=(nq)  $(folderPath+":"+"eBin2D_qxqy_"+detStr) 
    6280         
    63         Wave iBin_qxqy = $("iBin_qxqy_"+type) 
    64         Wave qBin_qxqy = $("qBin_qxqy_"+type) 
    65         Wave nBin_qxqy = $("nBin_qxqy_"+type) 
    66         Wave iBin2_qxqy = $("iBin2_qxqy_"+type) 
    67         Wave eBin_qxqy = $("eBin_qxqy_"+type) 
    68         Wave eBin2D_qxqy = $("eBin2D_qxqy_"+type) 
     81        Wave iBin_qxqy = $(folderPath+":"+"iBin_qxqy_"+detStr) 
     82        Wave qBin_qxqy = $(folderPath+":"+"qBin_qxqy_"+detStr) 
     83        Wave nBin_qxqy = $(folderPath+":"+"nBin_qxqy_"+detStr) 
     84        Wave iBin2_qxqy = $(folderPath+":"+"iBin2_qxqy_"+detStr) 
     85        Wave eBin_qxqy = $(folderPath+":"+"eBin_qxqy_"+detStr) 
     86        Wave eBin2D_qxqy = $(folderPath+":"+"eBin2D_qxqy_"+detStr) 
    6987 
    7088// sum the rows  
     
    96114 
    97115 
     116// TODO -- update to new folder structure 
     117// unused -- update if necessary 
    98118Proc CopyIQWaves() 
    99119 
     
    124144End 
    125145 
     146// TODO -- update to new folder structure 
     147// unused -- update if necessary 
    126148Window slit_vs_pin_graph() : Graph 
    127149        PauseUpdate; Silent 1           // building window... 
Note: See TracChangeset for help on using the changeset viewer.