Ignore:
Timestamp:
Feb 6, 2019 12:25:46 PM (4 years ago)
Author:
srkline
Message:

changes to the USANS procedures to accommodate the re-ordering of the data columns in the raw USANS data that is to be output from NICE, versus what was previously written out by ICP.

A global flag switches between the two reading modes. On startup, the preferences panel is automatically opened to the USANS tab so that the user can immediately set the flag correctly. Currently it defaults to "checked" to read the New data format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_Loader.ipf

    r907 r1122  
    7676//      print BT5Date2Secs(filedt) 
    7777//      print date2secs(2010,11,7) 
     78         
     79        // as of Feb 6 2019, USANS is using NICE for data collection rather than ICP 
     80        // as a consequence, the data file is somewhat different. Specifically, the  
     81        // order of the detectors in the comma-delimited list is different, with the 
     82        // 5 main detectors all listed in order, rather than separated. 
     83        // --- I can either flag on the date, or set a global to switch 
     84        // I also do not know if there will be any other changes in the data file format 
     85         
     86        Variable useNewDataFormat 
     87 
     88// test by date 
     89//      Variable thisFileSecs,switchSecs 
     90//      switchSecs = date2secs(2019,2,6) 
     91//      thisFileSecs = BT5Date2Secs(filedt)             // could use BT5DateTime2Secs() to include HR:MIN 
     92//      if(thisFileSecs >= switchSecs) 
     93//              useNewDataFormat = 1 
     94//      else 
     95//              useNewDataFormat = 0 
     96//      endif 
     97 
     98// or use the global 
     99        NVAR gVal = root:Packages:NIST:gUseNICEDataFormat        
     100        useNewDataFormat = gVal 
     101         
    78102         
    79103        USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime) 
     
    106130                //valuesRead = V_flag 
    107131                //print valuesRead 
    108                 MonCts[numlinesloaded] = v1             //monitor 
    109                 v2 = v2/(1.0-V2*MainDeadTime/countTime)   // Deadtime correction 
    110                 v3 = v3/(1.0-V3*MainDeadTime/countTime)   // Deadtime correction 
    111                 v5 = v5/(1.0-V5*MainDeadTime/countTime)   // Deadtime correction 
    112                 v6 = v6/(1.0-V6*MainDeadTime/countTime)   // Deadtime correction 
    113                 v7 = v7/(1.0-V7*MainDeadTime/countTime)   // Deadtime correction 
    114                 DetCts[numlinesloaded] = v2 + v3 + v5 + v6 + v7         //5 detectors 
    115                 TransCts[numlinesloaded] = v4/(1.0-V4*TransDeadTime/countTime)          //trans detector+deadtime correction 
    116                 ErrDetCts[numlinesloaded] = sqrt(detCts[numlinesloaded]) 
    117                 //values 8-16 are always zero 
     132                if(useNewDataFormat == 1) 
     133                // new order is MonCt, det1,det2,det3,det4,det5, Trans 
     134                        MonCts[numlinesloaded] = v1             //monitor 
     135                        v2 = v2/(1.0-v2*MainDeadTime/countTime)   // Deadtime correction 
     136                        v3 = v3/(1.0-v3*MainDeadTime/countTime)   // Deadtime correction 
     137                        v4 = v6/(1.0-v4*MainDeadTime/countTime)   // Deadtime correction 
     138                        v5 = v5/(1.0-v5*MainDeadTime/countTime)   // Deadtime correction 
     139                        v6 = v6/(1.0-v6*MainDeadTime/countTime)   // Deadtime correction 
     140                        DetCts[numlinesloaded] = v2 + v3 + v4 + v5 + v6         //5 detectors 
     141                        TransCts[numlinesloaded] = v7/(1.0-v7*TransDeadTime/countTime)          //trans detector+deadtime correction 
     142                        ErrDetCts[numlinesloaded] = sqrt(detCts[numlinesloaded]) 
     143                        //values 8-16 are always zero 
     144                else 
     145                // this is the original format from ICP 
     146                        MonCts[numlinesloaded] = v1             //monitor 
     147                        v2 = v2/(1.0-v2*MainDeadTime/countTime)   // Deadtime correction 
     148                        v3 = v3/(1.0-v3*MainDeadTime/countTime)   // Deadtime correction 
     149                        v5 = v5/(1.0-v5*MainDeadTime/countTime)   // Deadtime correction 
     150                        v6 = v6/(1.0-v6*MainDeadTime/countTime)   // Deadtime correction 
     151                        v7 = v7/(1.0-v7*MainDeadTime/countTime)   // Deadtime correction 
     152                        DetCts[numlinesloaded] = v2 + v3 + v5 + v6 + v7         //5 detectors 
     153                        TransCts[numlinesloaded] = v4/(1.0-v4*TransDeadTime/countTime)          //trans detector+deadtime correction 
     154                        ErrDetCts[numlinesloaded] = sqrt(detCts[numlinesloaded]) 
     155                        //values 8-16 are always zero 
     156                endif 
     157                 
    118158                numlinesloaded += 1             //2 lines in file read, one "real" line of data 
    119159        while(1) 
Note: See TracChangeset for help on using the changeset viewer.