Ignore:
Timestamp:
Mar 24, 2017 2:13:01 PM (6 years ago)
Author:
srkline
Message:

First pass at routines to interactively combine and mask VSANS 1-D data sets. Based on masking as done in the USANS Desmearing panel.

File:
1 edited

Legend:

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

    r1025 r1030  
    1414// 
    1515// 
     16 
     17 
     18 
     19/// TODO: 
     20// -- this is the basic renormalization that is done in PRODIV. see that file for all of the  
     21//    details of how it's used 
     22// -- update to VSANS file locations and data reads 
     23// -- expand this to do a basic renormalization of all 9 panels, and move the data into the  
     24//    appropriate locations for saving as a DIV file. 
     25// 
     26// 
     27 
     28//works on the data in "type" folder (expecting data to be reduced to the COR level) 
     29//sums all of the data, and normalizes by the number of cells (=pixelX*pixelY) 
     30// calling procedure must make sure that the folder is on linear scale FIRST 
     31Function V_NormalizeDIV(type) 
     32        String type 
     33         
     34        WAVE data=$("root:Packages:NIST:"+type+":data") 
     35        WAVE data_lin=$("root:Packages:NIST:"+type+":linear_data") 
     36        WAVE data_err=$("root:Packages:NIST:"+type+":linear_data_error") 
     37         
     38        Variable totCts=sum(data,Inf,-Inf)              //sum all of the data 
     39        NVAR pixelX = root:myGlobals:gNPixelsX 
     40        NVAR pixelY = root:myGlobals:gNPixelsY 
     41 
     42         
     43        data /= totCts 
     44        data *= pixelX*pixelY 
     45         
     46        data_lin /= totCts 
     47        data_lin *= pixelX*pixelY 
     48         
     49        data_err /= totCts 
     50        data_err *= pixelX*pixelY 
     51                 
     52        return(0) 
     53End 
     54 
     55 
     56 
     57 
     58 
     59 
    1660 
    1761// TODO 
Note: See TracChangeset for help on using the changeset viewer.