Ignore:
Timestamp:
Apr 4, 2011 12:18:33 PM (11 years ago)
Author:
srkline
Message:

Changes to SANS reduction that apply to other Facilities:

These changes are related to the propagation of errors in 2D, on a
per-pixel basis. These changes only affect the errors that are reported in
the QxQy? ASCII file output. The 1D code is unaffected.

If these changes are not implemented, then errors of zero will be substitued as defaults
for these experimental errors.

Upon data loading, an error matrix, linear_data_error is generated and filled with
error values appropriate for Poisson statistics (not simply sqrt(n)).

4 functions in FACILITY_DataReadWrite.ipf have been added, and they are rather
self-explanatory:

In FACILITY_Utils.ipf, the AttenuatorTransmission?() function now returns
an additional parameter, atten_err, which is one standard deviation of the
attenuator transmission value. It returns a default error=0 (which is
correct if no attenuation is used). Facilities can fill this function in
with their own estimates for the uncertainty in the attenutator transmission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_DataReadWrite.ipf

    r779 r795  
    214214        Setdatafolder curpath 
    215215         
    216         Duplicate/O data $"root:Packages:NIST:RAW:linear_data"                  // data is "fresh" and linear scale, so copy it now 
     216        Duplicate/O data linear_data            // data is "fresh" and linear scale, so copy it now 
     217         
     218        // proper error for counting statistics, good for low count values too 
     219        // rather than just sqrt(n) 
     220        // see N. Gehrels, Astrophys. J., 303 (1986) 336-346, equation (7) 
     221        // for S = 1 in eq (7), this corresponds to one sigma error bars 
     222        Duplicate/O linear_data linear_data_error 
     223        linear_data_error = 1 + sqrt(linear_data + 0.75)                                 
     224        // 
    217225         
    218226        //keep a string with the filename in the RAW folder 
     
    394402        data=temp0 
    395403        Redimension/N=(pixelsX,pixelsY) data            //,linear_data 
     404         
     405        Duplicate/O data linear_data_error 
     406        linear_data_error = 1 + sqrt(data + 0.75) 
     407         
     408        //just in case there are odd inputs to this, like negative intensities 
     409        WaveStats/Q linear_data_error 
     410        linear_data_error = numtype(linear_data_error[p]) == 0 ? linear_data_error[p] : V_avg 
     411        linear_data_error = linear_data_error[p] != 0 ? linear_data_error[p] : V_avg 
    396412         
    397413        //linear_data = data 
     
    501517// (2) write the specified value to the header at the correct location in the file 
    502518// (3) close the file 
     519 
     520 
     521// new, April 2011 for error propagation. fill these in with the facility- 
     522// specific versions, if desired. 
     523Function WriteTransmissionErrorToHeader(fname,transErr) 
     524        String fname 
     525        Variable transErr 
     526         
     527 
     528        return(0) 
     529End 
     530 
     531Function WriteBoxCountsErrorToHeader(fname,rel_err) 
     532        String fname 
     533        Variable rel_err 
     534         
     535        return(0) 
     536End 
     537 
     538Function getSampleTransError(fname) 
     539        String fname 
     540         
     541        return(0) 
     542end 
     543 
     544Function getBoxCountsError(fname) 
     545        String fname 
     546         
     547        return(0) 
     548end 
     549 
     550 
     551// end April 2011 additions 
     552 
    503553 
    504554//sample transmission (0<T<=1) 
Note: See TracChangeset for help on using the changeset viewer.