Ignore:
Timestamp:
Jul 6, 2012 5:29:38 PM (11 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.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
6 edited

Legend:

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

    r795 r857  
    396396End 
    397397 
     398 
     399//function to test a file to see if it is a DIV file 
     400// 
     401// returns truth 0/1 
     402// 
     403// called by many procedures (both external and local) 
     404// 
     405Function CheckIfDIVData(fname) 
     406        String fname 
     407         
     408 
     409//      if(your test here) 
     410//              //true, is DIV data file 
     411                Return(1) 
     412//      else 
     413//              //some other file 
     414//              Return(0) 
     415//      Endif 
     416 
     417End 
     418 
    398419Function isScatFile(fname) 
    399420        String fname 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/FACILITY_Utils.ipf

    r795 r857  
    259259//      if(your test here) 
    260260//              //true, is raw data file 
     261//              Return(1) 
     262//      else 
     263//              //some other file 
     264//              Return(0) 
     265//      Endif 
     266 
     267End 
     268 
     269//function to test a file to see if it is a DIV file 
     270// 
     271// returns truth 0/1 
     272// 
     273// called by many procedures (both external and local) 
     274// 
     275Function CheckIfDIVData(fname) 
     276        String fname 
     277         
     278 
     279//      if(your test here) 
     280//              //true, is DIV data file 
    261281//              Return(1) 
    262282//      else 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_Utils.ipf

    r795 r857  
    450450End 
    451451 
     452//function to test a file to see if it is a DIV file 
     453// 
     454// returns truth 0/1 
     455// 
     456// called by many procedures (both external and local) 
     457// 
     458Function CheckIfDIVData(fname) 
     459        String fname 
     460         
     461 
     462//      if(your test here) 
     463//              //true, is DIV file data file 
     464                Return(1) 
     465//      else 
     466//              //some other file 
     467//              Return(0) 
     468//      Endif 
     469 
     470End 
    452471 
    453472// function returns 1 if file is a transmission file, 0 if not 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/KIST_Utils.ipf

    r807 r857  
    267267End 
    268268 
     269//function to test a file to see if it is a DIV file 
     270// 
     271// returns truth 0/1 
     272// 
     273// called by many procedures (both external and local) 
     274// 
     275Function CheckIfDIVData(fname) 
     276        String fname 
     277         
     278 
     279//      if(your test here) 
     280//              //true, is DIV data file 
     281//              Return(1) 
     282//      else 
     283//              //some other file 
     284//              Return(0) 
     285//      Endif 
     286 
     287End 
    269288 
    270289// function returns 1 if file is a transmission file, 0 if not 
  • 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 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProtocolAsPanel.ipf

    r853 r857  
    21092109                        endif 
    21102110#else 
    2111                         if(strlen(junkStr)==0 || CheckIfRawData(junkStr))               //for NCNR, not raw is sufficient, but better in the future to confirm it is DIV if either is false, exit 
     2111                        if(strlen(junkStr)==0 || !CheckIfDIVData(junkStr))              //for NCNR, and other data confirm it is DIV if either is false, exit 
    21122112                                SetDataFolder root: 
    21132113                                Abort "No DIV (PLEX) file selected. Please use setABSParams again, selecting the empty beam file and then the detector sensitivity (Plex_) file" 
Note: See TracChangeset for help on using the changeset viewer.