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.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r1100 r1122  
    14281428         
    14291429        /// items for USANS Reduction 
    1430          
     1430        val = NumVarOrDefault("root:Packages:NIST:gUseNICEDataFormat", 1 ) 
     1431        Variable/G root:Packages:NIST:gUseNICEDataFormat=val     
    14311432         
    14321433        /// items for everyone 
     
    14941495        gVal = checked 
    14951496End 
     1497 
     1498Function UseNICEDataFormat(ctrlName,checked) : CheckBoxControl 
     1499        String ctrlName 
     1500        Variable checked 
     1501         
     1502        NVAR gVal = root:Packages:NIST:gUseNICEDataFormat 
     1503        gVal = checked 
     1504End 
     1505 
     1506 
    14961507 
    14971508Function PrefDoneButtonProc(ctrlName) : ButtonControl 
     
    15531564 
    15541565//on tab(2) - USANS 
    1555         GroupBox PrefCtrl_2a pos={21,100},size={1,1},title="nothing to set",fSize=12 
    1556  
    1557         GroupBox PrefCtrl_2a,disable=1 
     1566//      GroupBox PrefCtrl_2a pos={21,100},size={1,1},title="nothing to set",fSize=12 
     1567//      GroupBox PrefCtrl_2a,disable=1 
     1568        CheckBox PrefCtrl_2a,pos={21,100},size={171,14},proc=UseNICEDataFormat,title="Read New NICE data format" 
     1569        CheckBox PrefCtrl_2a,help={"Check this if raw data was collected using NICE. If data was collected using ICP, leave this unchecked."} 
     1570        CheckBox PrefCtrl_2a,value= root:Packages:NIST:gUseNICEDataFormat 
     1571 
     1572 
     1573        CheckBox PrefCtrl_2a,disable=1 
     1574 
    15581575 
    15591576 
     
    16111628        return(0) 
    16121629End 
     1630 
     1631 
     1632 
     1633 
     1634 
    16131635 
    16141636 
  • 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) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1121 r1122  
    13261326// can't do this, or it will simply bypass the missing parameter dialog! 
    13271327//      V_GetAvgInfo(av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup) 
    1328         av_typ = StringByKey("AVTYPE", gAvgInfoStr  ,"=",";") 
    1329         autoSave = StringByKey("SAVE", gAvgInfoStr  ,"=",";") 
    1330         autoName = StringByKey("NAME", gAvgInfoStr  ,"=",";") 
    1331         binType = StringByKey("BINTYPE", gAvgInfoStr  ,"=",";") 
    1332         qCtr = NumberByKey("QCENTER", gAvgInfoStr  ,"=",";") 
    1333         qDelta = NumberByKey("QDELTA", gAvgInfoStr  ,"=",";") 
    1334         detGroup = StringByKey("DETGROUP", gAvgInfoStr  ,"=",";") 
    1335         phi = NumberByKey("PHI", gAvgInfoStr  ,"=",";") 
    1336         dphi = NumberByKey("DPHI", gAvgInfoStr  ,"=",";") 
     1328                av_typ = StringByKey("AVTYPE", gAvgInfoStr  ,"=",";") 
     1329                autoSave = StringByKey("SAVE", gAvgInfoStr  ,"=",";") 
     1330                autoName = StringByKey("NAME", gAvgInfoStr  ,"=",";") 
     1331                binType = StringByKey("BINTYPE", gAvgInfoStr  ,"=",";") 
     1332                qCtr = NumberByKey("QCENTER", gAvgInfoStr  ,"=",";") 
     1333                qDelta = NumberByKey("QDELTA", gAvgInfoStr  ,"=",";") 
     1334                detGroup = StringByKey("DETGROUP", gAvgInfoStr  ,"=",";") 
     1335                phi = NumberByKey("PHI", gAvgInfoStr  ,"=",";") 
     1336                dphi = NumberByKey("DPHI", gAvgInfoStr  ,"=",";") 
    13371337 
    13381338//      Execute "V_GetAvgInfo_Full()" 
     
    13501350//      Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 
    13511351        Prompt side,"Include detector halves?",popup,"both;right;left" 
    1352         Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 
    1353         Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
     1352        Prompt phi,"Orientation Angle (0,359) degrees (Rectangular or Sector)" 
     1353        Prompt dphi, "Sector range (+/-) degrees (0,45) (Sector only)" 
    13541354//      Prompt width, "Width of Rectangular average (1,128)" 
    13551355        Prompt binType,"Binning Type?",popup,ksBinTypeStr 
Note: See TracChangeset for help on using the changeset viewer.