Ignore:
Timestamp:
Jul 6, 2012 5:29:38 PM (10 years ago)
Author:
srkline
Message:

Added support for reading 4-column data into the 2D reader

Calculation of kappa for ABS now does a specific byte check for ensuring a "good" DIV file. hopefully this will eliminate errors where incorrect DIV files are selected and bad kappa values are generated - and the program thinks (incorrectly) that there is a valid DVI file present, when there really isn't one (and then there is no easy recovery from this)

Added CheckIfDIVData() functions to NCNR_Utils and to FACILITY_Utils, and to other (facility)_Utils

Changed the calls to writing BT5 files after adding so that it could be more easily scripted in the future.

File:
1 edited

Legend:

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

    r838 r857  
    831831                Return(0) 
    832832        Endif 
     833End 
     834 
     835//function to test a file to see if it is a DIV file 
     836// 
     837// returns truth 0/1 
     838// 
     839// called by many procedures (both external and local) 
     840// 
     841Function CheckIfDIVData(fname) 
     842        String fname 
     843         
     844 
     845        Variable refnum,totalBytes 
     846//      String testStr="" 
     847         
     848        Open/R/T="????TEXT" refNum as fname 
     849        if(strlen(s_filename) == 0)     //user cancel (/Z not used, so V_flag not set) 
     850                return(0) 
     851        endif 
     852         
     853        //get the total number of bytes in the file 
     854        FStatus refNum 
     855        totalBytes = V_logEOF 
     856        //Print totalBytes 
     857        if(totalBytes < 100) 
     858                Close refNum 
     859                return(0)               //not a raw file 
     860        endif 
     861//      FSetPos refNum,75 
     862//      FReadLine/N=3 refNum,testStr 
     863        Close refNum 
     864         
     865        if(totalBytes == 66116)         // && ( cmpstr(testStr,"RAW")==0 ||  cmpstr(testStr,"SIM")==0)) 
     866                //true, is raw data file 
     867                Return(1) 
     868        else 
     869                //some other file 
     870                Return(0) 
     871        Endif 
     872 
    833873End 
    834874 
Note: See TracChangeset for help on using the changeset viewer.