Changeset 74


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.

Location:
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
Files:
4 edited

Legend:

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

    r72 r74  
    315315        // 0 if the file is a scattering  file, 1 (truth) if the file is a transmission file 
    316316        InsertPoints lastPoint,1,GIsTrans 
    317         GIsTrans[lastPoint]  = CheckIfBeamstopOut(fname, -5)            //returns one if beamstop is "out" 
     317        GIsTrans[lastPoint]  = isTransFile(fname, -5)           //returns one if beamstop is "out" 
    318318         
    319319        return(0) 
  • 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 
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NSORT.ipf

    r70 r74  
    17811781        // 0 if the file is a scattering  file, 1 (truth) if the file is a transmission file 
    17821782        InsertPoints lastPoint,1,GIsTrans 
    1783         GIsTrans[lastPoint]  = CheckIfBeamstopOut(fname, -5)            //returns one if beamstop is "out" 
     1783        GIsTrans[lastPoint]  = isTransFile(fname, -5)           //returns one if beamstop is "out" 
    17841784         
    17851785        KillWaves/Z w 
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Transmission.ipf

    r70 r74  
    256256        Variable lastPoint, beamstop, Whole 
    257257 
    258         isTrans = CheckIfBeamstopOut(fname, xTol) 
     258        isTrans = isTransFile(fname, xTol) 
    259259        // decalre the correct set of waves 
    260260        // S_Whole is only a place holder so the waves are of equal length 
     
    16551655 
    16561656 
    1657 //function to check the header of a raw data file (full path specified by fname) 
    1658 //checks the field of the x-position of the beamstop during data collection 
    1659 //if the x-position is more negatice (farther to the left) than xTol(input) 
    1660 //the the beamstop is "out" and the file is a transmission run and not a scattering run 
    1661 //xtol typically set at -5 (cm) - trans runs have bs(x) at -10 to -15 cm  
    1662 // function returns 1 if beamstop is out, 0 if beamstop is in 
    1663 // 
    1664 Function CheckIfBeamstopOut(fName,xTol) 
    1665         String fname 
    1666         Variable xTol 
    1667          
    1668         Variable refnum,xpos 
    1669         //pos = 369, read one real value 
    1670          
    1671         SetDataFolder root: 
    1672         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    1673         String strToExecute="" 
    1674         // 1 R*4 value 
    1675         strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 
    1676         Execute strToExecute 
    1677         Wave w=$"root:tempGBWave0" 
    1678         xPos = w[0] 
    1679         KillWaves/Z w 
    1680         //Print "xPos = ",xpos 
    1681          
    1682         if(xpos<=xTol) 
    1683                 //xpos is farther left (more negative) than xtol (currently -5 cm) 
    1684                 Return(1) 
    1685         else 
    1686                 //some other file 
    1687                 Return(0) 
    1688         Endif 
    1689 End 
    1690  
    16911657//function to update the box coordinates of the file selected as the  
    16921658//empty beam file - takes the file that is currently popped from the list 
     
    17131679         
    17141680        Variable refnum,x1,x2,y1,y2,err 
    1715         Open/R refnum as filename 
    1716         FSetPos refnum,478 
    1717         FBinRead/F=3/B=3 refnum, x1 
    1718         FBinRead/F=3/B=3 refnum, x2 
    1719         FBinRead/F=3/B=3 refnum, y1 
    1720         FBinRead/F=3/B=3 refnum, y2 
    1721         Close refnum 
    1722          
     1681        GetXYBoxFromFile(filename,x1,x2,y1,y2) 
     1682                 
    17231683        //and update the global string 
    17241684        String msgStr="" 
Note: See TracChangeset for help on using the changeset viewer.