Ignore:
Timestamp:
Aug 23, 2017 10:03:41 AM (5 years ago)
Author:
srkline
Message:

Added USANS loader/initializer

Updated units of distance for q-calculation (SDD)

status display bug fixed

File:
1 edited

Legend:

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

    r1043 r1061  
    2828//   the normalization will be way off -- and the "active" area will end up much larger  
    2929//   than it should be - since the wings of the detector are mostly zero... 
     30//   ? Can I apply a mask, or will the detectors be set in a different configuration? 
    3031// 
    3132// 
     
    3839// -- expand this to do a basic renormalization of all 9 panels, and move the data into the  
    3940//    appropriate locations for saving as a DIV file. 
    40 // 
     41// x- (YES, done) what about error propogation? Can I store the error in the data file? 
     42//    Makes a difference if the DIV is not collected for long "enough". 
     43// x- then I need to be able to read the error in (done) 
    4144// 
    4245 
     
    4649// -- next, V_NormalizeDIV() 
    4750// -- then Setup_VSANS_DIV_Struct() 
    48 // -- next, V_CopyDIVToSave() 
     51// -- next, V_CopyDIVToSave() -or- V_CopyDIVToSave_OnePanel() 
    4952// -- last, Save_VSANS_DIV_Nexus()  
    50  
     53// 
    5154 
    5255 
     
    6063// TODO 
    6164// -- data should be copied to some alternate work folder before this step 
     65// -- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 
     66//    How to handle? A mask? 
     67// x- is this the correct calculation of the error? (YES) It should be correct up to this point since the 
     68//    standard reduction has been used, but now the normalization step is a multiplication 
     69//    by a constant (w/no error). Be sure this error transformation is correct. (YES - this is correct, and is 
     70//    what is done in SANS) 
    6271// 
    6372Function V_NormalizeDIV(type) 
     
    7483                pixelY = V_getDet_pixel_num_y(type,detStr) 
    7584 
    76                 totCts=sum(w,Inf,-Inf)          //sum all of the data 
     85                totCts = sum(w,Inf,-Inf)                //sum all of the data 
    7786                 
    7887                w /= totCts 
     
    8897 
    8998 
    90  
     99// copies an entire work folder, all 9 detectors (at COR level) 
     100// to the DIV structure to write out 
     101// 
    91102Function V_CopyDIVToSave(type) 
    92103        String type 
     
    109120End 
    110121 
     122// 
     123// copies only the specified panel from a work folder, (at COR level) 
     124// to the DIV structure to write out 
     125// 
     126// used to replace a single panel, or to fill in carriage by carriage. 
     127// 
     128Function V_CopyDIVToSave_OnePanel(type,detStr) 
     129        String type,detStr 
     130         
     131        Variable ii,totCts,pixelX,pixelY 
     132        String topath = "root:VSANS_DIV_file:entry:instrument:detector_" 
     133        String fromPath = "root:Packages:NIST:VSANS:"+type+":entry:instrument:detector_" 
     134         
     135         
     136                Duplicate/O $(fromPath+detStr+":data") $(toPath+detStr+":data") 
     137                Duplicate/O $(fromPath+detStr+":linear_data_error") $(toPath+detStr+":linear_data_error") 
     138                         
     139        return(0) 
     140End 
    111141 
    112142 
     
    170200// 
    171201// TODO -- make the number of pixels GLOBAL 
    172 // TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the  
    173 //      9 data sets to become the DIV file contents. More complexity here than for the simple SANS case. 
    174202// 
    175203Proc H_Setup_VSANS_DIV_Structure() 
Note: See TracChangeset for help on using the changeset viewer.