Ignore:
Timestamp:
Apr 5, 2007 5:06:48 PM (15 years ago)
Author:
srkline
Message:

More changes to move NCNR calls from the main section of code. Transmission is the current sticking point.

File:
1 edited

Legend:

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

    r70 r74  
    393393        totalBytes = V_logEOF 
    394394        //Print totalBytes 
    395         if(totalBytes!=33316) 
    396                 //can't possibly be a raw data file 
    397                 Close refnum 
    398                 return(0)               //not a raw SANS file 
    399         Endif 
    400395        FSetPos refNum,75 
    401396        FReadLine/N=3 refNum,testStr 
    402397        Close refNum 
    403398         
    404         if(cmpstr(testStr,"RAW")==0) 
     399        if(totalBytes == 33316 && cmpstr(testStr,"RAW")==0) 
    405400                //true, is raw data file 
    406401                Return(1) 
     
    410405        Endif 
    411406End 
     407 
     408 
     409 
     410//function to check the header of a raw data file (full path specified by fname) 
     411//checks the field of the x-position of the beamstop during data collection 
     412//if the x-position is more negative (farther to the left) than xTol(input) 
     413//the the beamstop is "out" and the file is a transmission run and not a scattering run 
     414//xtol typically set at -5 (cm) - trans runs have bs(x) at -10 to -15 cm  
     415// function returns 1 if beamstop is out, 0 if beamstop is in 
     416// 
     417Function isTransFile(fName,xTol) 
     418        String fname 
     419        Variable xTol 
     420         
     421        Variable refnum,xpos 
     422        //pos = 369, read one real value 
     423         
     424        SetDataFolder root: 
     425        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     426        String strToExecute="" 
     427        // 1 R*4 value 
     428        strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 
     429        Execute strToExecute 
     430        Wave w=$"root:tempGBWave0" 
     431        xPos = w[0] 
     432        KillWaves/Z w 
     433        //Print "xPos = ",xpos 
     434         
     435        if(xpos<=xTol) 
     436                //xpos is farther left (more negative) than xtol (currently -5 cm) 
     437                Return(1) 
     438        else 
     439                //some other file 
     440                Return(0) 
     441        Endif 
     442End 
     443 
    412444 
    413445//function to remove all spaces from names when searching for filenames 
Note: See TracChangeset for help on using the changeset viewer.