Ignore:
Timestamp:
Dec 8, 2009 6:18:04 PM (13 years ago)
Author:
srkline
Message:

Added USANS help for adding files. Ticket #214

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_AddFiles.ipf

    r577 r611  
    55// Version 1.0 
    66// SRK 7 OCT 2009 
     7// 
     8 
     9// Adding two raw .bt5 files: 
     10//      - only files with the same angle range and the same number of points can be added. 
     11//      - NO shifting is done - these are raw data files, and the angular shift is not known 
     12//      - it can be repeated multiple times to add more than two files together 
     13//      - the two added files are listed in the title of the summed file. 
     14 
     15// Adding two data sets: 
     16//      - here, two entire data sets (inlcluding the main beam) are added together after 
     17//         loading and normalizing and coverting to Q. The data file is NOT saved out, because 
     18//              it is not a format that can be re-read in for reduction. 
     19//      - to use the summed data set, it is first summed in a separate panel, and then transferred 
     20//              to either the active "SAM" or "EMP" data 
     21//      - since the zero offset can make the point values not exactly the same, only those within a  
     22//              certain tolerance are actually added. Points that cannot be added are still kept in the final 
     23//              data set. 
    724// 
    825 
     
    1532// - convert to countrate seems like a good idea, then 1+1=2 and I can propagate errors 
    1633//  -- but how to save the data? At this point, errCR != sqrt(CR) 
     34// -> answer is -- don't save the full data sets that have been summed... 
    1735// 
    1836// - Why can't I just use the whole set of files from the main USANS panel, and add what needs 
     
    2038//   the shift to... 
    2139// 
    22 // 
    23 // - need a global for the tolerance (and a good reason to use that particular value) 
    24 // 
    2540// - do I have anything hard-wired in the code that needs to be generalized before release?  
    26 // 
    27 // - add descriptions of this to the help files 
    2841// 
    2942 
     
    6275//      Variable/G root:Packages:NIST:USANS:Globals:gUseXMLOutput = 0 
    6376        String/G FilterStr 
     77        Variable/G gAddUSANSTolerance = 0.01            // add points if x is within 1% (an arbitrary choice!) 
    6478 
    6579        Make/O/T/N=1 fileWave,AWave,BWave  
     
    141155        Button pickSavePathButton,pos={97,8},size={80,20},proc=PickSaveButtonProc,title="SavePath..." 
    142156        Button pickSavePathButton,help={"Select the data folder where data is to be saved to disk"} 
    143         Button USANSHelpButton,pos={220,6},size={50,20},proc=USANSHelpButtonProc,title="Help" 
     157        Button USANSHelpButton,pos={220,6},size={50,20},proc=USANSAddFilesHelpButton,title="Help" 
    144158        Button USANSHelpButton,help={"Show the USANS reduction help file"} 
    145159 
     
    159173         
    160174EndMacro 
     175 
     176// Show the help file, don't necessarily keep it with the experiment (/K=1) 
     177Function USANSAddFilesHelpButton(ctrlName) : ButtonControl 
     178        String ctrlName 
     179         
     180        DisplayHelpTopic/Z/K=1 "Adding Two Data Sets" 
     181        if(V_flag !=0) 
     182                DoAlert 0,"The USANS Data Reduction Help file could not be found" 
     183        endif 
     184        return(0) 
     185End 
    161186 
    162187Function AddUSANSDone(ba) : ButtonControl 
     
    266291         
    267292         
    268         Variable minPt,minDelta,tol 
     293        Variable minPt,minDelta 
    269294        Variable ii,jj,nA,nB,sumPt=0 
    270295        nA = numpnts(Angle_A) 
     
    272297        Make/O/D/N=(nB) tmp_delta 
    273298         
    274         tol = 0.01              //1% error allowed       
     299        NVAR tol = root:Packages:NIST:USANS:Globals:AddPanel:gAddUSANSTolerance //1% error allowed as default 
     300                 
    275301        for(ii=0;ii<nA;ii+=1) 
    276302                Redimension/N=(nB) tmp_delta 
Note: See TracChangeset for help on using the changeset viewer.