Ignore:
Timestamp:
Apr 11, 2007 12:21:15 PM (15 years ago)
Author:
srkline
Message:
  • Documentation of what parameters are passed to some "Generic" functions. There are only a few of these, like AttenuationFactor?, and they are passed a set parameter list that is always taken from the R/T/I waves that are loaded with the data. If filled properly from the loader, all will work, or the accessor can be fudged to work.
  • A new initialization global was added for beamstop XTol for isTransFile()
  • A new initialization global was added for sample aperture offset (apOff)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf

    r81 r82  
    3939        Variable/G root:myGlobals:DeadtimeNG7_ORNL = 3.4e-6 
    4040        Variable/G root:myGlobals:DeadtimeDefault = 3.4e-6 
     41         
     42        //new 11APR07 
     43        Variable/G root:myGlobals:BeamstopXTol = -5                     // (cm) is BS Xpos is -5 cm or less, it's a trans measurement 
     44        // sample aperture offset is NOT stored in the VAX header, but it should be 
     45        // - when it is, remove the global and write an accessor AND make a place for  
     46        // it in the RealsRead  
     47        Variable/G root:myGlobals:apOff = 5.0                           // (cm) distance from sample aperture to sample position 
     48 
    4149End 
    4250 
     
    5462//          raw data header to indicate the presence of lenses. 
    5563// 
    56 // 
    5764// - called by CircSectAvg.ipf and RectAnnulAvg.ipf 
     65// 
     66// passed values are read from RealsRead 
     67// except DDet and apOff, which are set from globals before passing 
    5868// 
    5969Function/S getResolution(inQ,lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,SigmaQ,QBar,fSubS) 
     
    6676 
    6777        //Constants 
    68         //Variable del_r = .1 
    6978        Variable vz_1 = 3.956e5         //velocity [cm/s] of 1 A neutron 
    7079        Variable g = 981.0                              //gravity acceleration [cm/s^2] 
     
    7382        results ="Failure" 
    7483 
    75         //rename for working variables,  these must be gotten from global 
    76         //variables 
    77  
    78 //      Variable wLam, wLW, wL1, wL2, wS1, wS2 
    79 //      Variable wBS, wDDet, wApOff 
    80 //      wLam = lambda 
    81 //      wLW = lambdaWidth 
    82 //      wDDet = DDet 
    83 //      wApOff = apOff 
    8484        S1 *= 0.5*0.1                   //convert to radius and [cm] 
    8585        S2 *= 0.5*0.1 
     
    142142 
    143143 
    144 //Utility function that returns the detector resolution (in cm) given information  
    145 //from the file header 
     144//Utility function that returns the detector resolution (in cm) 
    146145//Global values are set in the Initialize procedure 
    147146// 
    148147// 
    149148// - called by CircSectAvg.ipf, RectAnnulAvg.ipf, and ProtocolAsPanel.ipf 
     149// 
     150// fileStr is passed as TextRead[3] 
     151// detStr is passed as TextRead[9] 
    150152// 
    151153Function DetectorPixelResolution(fileStr,detStr) 
     
    187189                default:                                                         
    188190                        //return error? 
    189                         DDet = PixelResDefault  //5mm, typical for new ORNL detectors 
     191                        DDet = PixelResDefault  //0.5 cm, typical for new ORNL detectors 
    190192        endswitch 
    191193         
     
    193195End 
    194196 
    195 //Utility function that returns the detector deadtime (in seconds) given information  
    196 //from the file header 
     197//Utility function that returns the detector deadtime (in seconds) 
    197198//Global values are set in the Initialize procedure 
    198199// 
    199200// - called by WorkFileUtils.ipf 
    200201// 
     202// fileStr is passed as TextRead[3] 
     203// detStr is passed as TextRead[9] 
    201204// 
    202205Function DetectorDeadtime(fileStr,detStr) 
     
    434437End 
    435438 
    436  
    437  
    438439//function to check the header of a raw data file (full path specified by fname) 
    439440//checks the field of the x-position of the beamstop during data collection 
     
    443444// function returns 1 if beamstop is out, 0 if beamstop is in 
    444445// 
     446// tolerance is set as a global value "root:myGlobals:BeamstopXTol" 
    445447// 
    446448// called by Transmission.ipf, CatVSTable.ipf, NSORT.ipf 
    447449// 
    448 Function isTransFile(fName,xTol) 
     450Function isTransFile(fName) 
    449451        String fname 
    450         Variable xTol 
    451452         
    452453        Variable refnum,xpos 
     454        NVAR xTol = root:myGlobals:BeamstopXTol 
     455         
    453456        //pos = 369, read one real value 
    454457         
     
    10461049//NG5 values are taken from the NG7 tables (there is very little difference in the 
    10471050//values, and NG5 attenuators have not been calibrated (as of 8/01) 
    1048 //filestr as passed is textread[3], the default directory 
     1051// 
     1052// filestr is passed from TextRead[3] = the default directory 
     1053// lam is passed from RealsRead[26] 
     1054// AttenNo is passed from ReaslRead[3] 
    10491055// 
    10501056// Attenuation factor as defined here is <= 1 
     1057// 
    10511058// ORNL can pass ("",1,attenuationFactor) and have this function simply 
    10521059// spit back the attenuationFactor (that was read into rw[3]) 
Note: See TracChangeset for help on using the changeset viewer.