Ignore:
Timestamp:
Jul 5, 2013 3:40:33 PM (10 years ago)
Author:
srkline
Message:

Modified QKK files to remove the calls to the ProgressWindow? XOP, which crashed my machine (OSX 10.8), Igor 6.3

Updated event processing to add new editing features to remove outliers

Updated help file for Event Mode.

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

Legend:

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

    r916 r917  
    204204        Button button2,pos={419,28},size={140,20},proc=ShowEventDataButtonProc,title="Show Event Data" 
    205205        Button button3,pos={419,56},size={140,20},proc=ShowBinDetailsButtonProc,title="Show Bin Details" 
    206         Button button4,pos={487,227},size={120,20},proc=UndoTimeSortButtonProc,title="Undo Time Sort" 
    207206        Button button5,pos={419,85},size={140,20},proc=ExportSlicesButtonProc,title="Export Slices as VAX" 
    208207        Button button6,pos={718,9},size={40,20},proc=EventModeHelpButtonProc,title="?" 
     208         
     209         
    209210        Button button7,pos={487,197},size={120,20},proc=AdjustEventDataButtonProc,title="Adjust Events" 
    210211        Button button8,pos={619,197},size={120,20},proc=CustomBinButtonProc,title="Custom Bins" 
    211         Button button1,pos={206,100},size={120,20},proc=ProcessEventLog_Button,title="Bin Event Data" 
    212         Button button1,fSize=12 
     212        Button button4,pos={487,227},size={120,20},proc=UndoTimeSortButtonProc,title="Undo Time Sort" 
     213        Button button18,pos={619,227},size={120,20},proc=EC_ImportWavesButtonProc,title="Import Edited" 
     214 
    213215         
    214216        SetVariable setvar0,pos={208,149},size={160,16},proc=sliceSelectEvent_Proc,title="Display Time Slice" 
     
    223225        PopupMenu popup0,fSize=10 
    224226        PopupMenu popup0,mode=1,popvalue="Equal",value= #"\"Equal;Fibonacci;Custom;\"" 
     227        Button button1,pos={206,100},size={120,20},fSize=12,proc=ProcessEventLog_Button,title="Bin Event Data" 
    225228 
    226229        Button button10,pos={488,305},size={100,20},proc=SplitFileButtonProc,title="Split Big File" 
     
    463466        endif 
    464467         
     468        // If TOF mode, process as Oscillatory -- that is, take the times as is 
     469        if(mode == MODE_TOF) 
     470                Osc_ProcessEventLog("") 
     471        endif 
     472         
    465473        // toggle the checkbox for log display to force the display to be correct 
    466474        NVAR gLog = root:Packages:NIST:gEvent_logint 
     
    859867// TODO: 
    860868// 
    861 // What, if anything is different about the OSC or STREAM load? 
    862 // I think that only the processing is different. so this could be 
    863 // consolidated into a single loader. 
    864 // 
    865869// ** currently, the "stream" loader uses the first data point as time=0 
    866870//    and rescales everything to that time. "Osc" loading uses the times "as-is" 
     
    884888        String abortStr 
    885889         
    886         Open/R/D/F=fileFilters fileref 
     890        Open/R/D/P=catPathName/F=fileFilters fileref 
    887891        filename = S_filename 
    888892        if(strlen(S_filename) == 0) 
     
    937941        endif 
    938942 
    939  
     943// MODE_TISANE 
     944 
     945// MODE_TOF 
     946        if(mode == MODE_TOF)            // TOF mode - don't adjust the times, we get periodic t0 to reset t=0 
     947                Duplicate/O timePt rescaledTime 
     948                rescaledTime *= 1e-7                    //convert to seconds and that's all 
     949                t_longest = waveMax(rescaledTime)               //if oscillatory, won't be the last point, so get it this way 
     950         
     951                KillWaves/Z OscSortIndex                        //to make sure that there is no old index hanging around 
     952        endif 
    940953 
    941954        SetDataFolder root: 
     
    18031816        dispStr += tmpStr 
    18041817 
     1818 
     1819// simply to compile a table of # XY vs # bytes 
     1820//      Wave/Z nxy = root:numberXY 
     1821//      Wave/Z nBytes = root:numberBytes 
     1822//      if(WaveExists(nxy) && WaveExists(nBytes)) 
     1823//              InsertPoints 0, 1, nxy,nBytes 
     1824//              nxy[0] = numXYevents 
     1825//              nBytes[0] = totBytes 
     1826//      endif 
     1827 
    18051828        SetDataFolder root: 
    18061829 
     
    21082131        SetDataFolder root:Packages:NIST:Event: 
    21092132         
    2110         Display /W=(35,44,761,533)/K=2 rescaledTime 
    2111         DoWindow/C EventCorrectionPanel 
    2112         ModifyGraph mode=4 
    2113         ModifyGraph marker=19 
    2114         ModifyGraph rgb=(0,0,0) 
    2115         ModifyGraph msize=1 
    2116         ErrorBars rescaledTime OFF  
    2117         Label left "\\Z14Time (seconds)" 
    2118         Label bottom "\\Z14Event number"         
    2119         SetAxis bottom 0,0.10*numpnts(rescaledTime)             //show 1st 10% of data for speed in displaying 
    2120          
    2121         ControlBar 100 
    2122         Button button0,pos={18,12},size={70,20},proc=EC_AddCursorButtonProc,title="Cursors" 
    2123         Button button1,pos={153,12},size={80,20},proc=EC_AddTimeButtonProc,title="Add time" 
    2124         Button button2,pos={153,38},size={80,20},proc=EC_SubtractTimeButtonProc,title="Subtr time" 
    2125         Button button3,pos={153,64},size={90,20},proc=EC_TrimPointsButtonProc,title="Trim points" 
    2126         Button button4,pos={295+200,12},size={90,20},proc=EC_SaveWavesButtonProc,title="Save Waves" 
    2127         Button button5,pos={295+200,38},size={100,20},proc=EC_ImportWavesButtonProc,title="Import Waves" 
    2128         Button button6,pos={18,38},size={80,20},proc=EC_ShowAllButtonProc,title="All Data" 
    2129         Button button7,pos={683,12},size={30,20},proc=EC_HelpButtonProc,title="?" 
    2130         Button button8,pos={658,72},size={60,20},proc=EC_DoneButtonProc,title="Done" 
    2131  
    2132         Button button9,pos={295,12},size={110,20},proc=EC_FindStepButton_down,title="Find Step Down" 
    2133         Button button10,pos={295,38},size={110,20},proc=EC_FindStepButton_up,title="Find Step Up" 
    2134         Button button11,pos={295,64},size={110,20},proc=EC_DoDifferential,title="Differential" 
     2133        if(exists("rescaledTime") == 1) 
     2134                Display /W=(35,44,761,533)/K=2 rescaledTime 
     2135                DoWindow/C EventCorrectionPanel 
     2136                ModifyGraph mode=4 
     2137                ModifyGraph marker=19 
     2138                ModifyGraph rgb=(0,0,0) 
     2139                ModifyGraph msize=1 
     2140                ErrorBars rescaledTime OFF  
     2141                Label left "\\Z14Time (seconds)" 
     2142                Label bottom "\\Z14Event number"         
     2143                SetAxis bottom 0,0.10*numpnts(rescaledTime)             //show 1st 10% of data for speed in displaying 
     2144                 
     2145                ControlBar 100 
     2146                Button button0,pos={18,12},size={70,20},proc=EC_AddCursorButtonProc,title="Cursors" 
     2147                Button button1,pos={153,12},size={80,20},proc=EC_AddTimeButtonProc,title="Add time" 
     2148                Button button2,pos={153,38},size={80,20},proc=EC_SubtractTimeButtonProc,title="Subtr time" 
     2149                Button button3,pos={153,64},size={90,20},proc=EC_TrimPointsButtonProc,title="Trim points" 
     2150                Button button4,pos={295+150,12},size={90,20},proc=EC_SaveWavesButtonProc,title="Save Waves" 
     2151                Button button5,pos={295,64},size={100,20},proc=EC_FindOutlierButton,title="Find Outlier" 
     2152                Button button6,pos={18,38},size={80,20},proc=EC_ShowAllButtonProc,title="All Data" 
     2153                Button button7,pos={683,12},size={30,20},proc=EC_HelpButtonProc,title="?" 
     2154                Button button8,pos={658,72},size={60,20},proc=EC_DoneButtonProc,title="Done" 
     2155         
     2156                Button button9,pos={295,12},size={110,20},proc=EC_FindStepButton_down,title="Find Step Down" 
     2157                Button button10,pos={295,38},size={110,20},proc=EC_FindStepButton_up,title="Find Step Up" 
     2158                Button button11,pos={295+150,38},size={110,20},proc=EC_DoDifferential,title="Differential" 
     2159                 
     2160                 
     2161        else 
     2162                DoAlert 0, "Please load some event data, then you'll have something to edit." 
     2163        endif 
    21352164         
    21362165        SetDataFolder root: 
     
    21592188End 
    21602189 
     2190// updates the longest time (as does every operation of adjusting the data) 
     2191// 
    21612192Function EC_AddTimeButtonProc(ba) : ButtonControl 
    21622193        STRUCT WMButtonAction &ba 
     
    21812212                        MultiThread rescaledTime[lo,hi] += rollTime 
    21822213 
     2214                        // updates the longest time (as does every operation of adjusting the data) 
     2215                        NVAR t_longest = root:Packages:NIST:gEvent_t_longest 
     2216                        t_longest = waveMax(rescaledTime) 
    21832217                         
    21842218                        SetDataFolder root: 
     
    22132247                        MultiThread rescaledTime[lo,hi] -= rollTime 
    22142248 
     2249                        // updates the longest time (as does every operation of adjusting the data) 
     2250                        NVAR t_longest = root:Packages:NIST:gEvent_t_longest 
     2251                        t_longest = waveMax(rescaledTime) 
     2252                         
    22152253                        SetDataFolder root: 
    22162254                         
     
    22502288                         
    22512289                        printf "Points %g to %g have been deleted in rescaledTime, timePt, xLoc, and yLoc\r",ptA,ptB 
     2290                         
     2291                        // updates the longest time (as does every operation of adjusting the data) 
     2292                        NVAR t_longest = root:Packages:NIST:gEvent_t_longest 
     2293                        t_longest = waveMax(rescaledTime) 
     2294                         
    22522295                        SetDataFolder root: 
    22532296                         
     
    23312374                        dispStr = tmpStr 
    23322375         
     2376                        SetDataFolder root: 
    23332377                        break 
    23342378                case -1: // control being killed 
     
    23972441        zoom = 200              //points in each direction 
    23982442         
    2399         WaveStats/Q rescaledTime_DIF 
     2443        WaveStats/M=1/Q rescaledTime_DIF 
    24002444        avg = V_avg 
    24012445         
     
    24262470 
    24272471 
     2472// find the max (or min) of the rescaled time set 
     2473// and place both cursors there 
     2474Function fFindOutlier() 
     2475 
     2476        SetDataFolder root:Packages:NIST:Event: 
     2477 
     2478        Wave rescaledTime=rescaledTime 
     2479        Variable avg,pt,zoom,maxPt,minPt,maxVal,minVal 
     2480         
     2481        zoom = 200              //points in each direction 
     2482         
     2483        WaveStats/M=1/Q rescaledTime 
     2484        maxPt = V_maxLoc 
     2485        minPt = V_minLoc 
     2486        avg = V_avg 
     2487        maxVal = abs(V_max) 
     2488        minVal = abs(V_min) 
     2489 
     2490         
     2491        pt = abs(maxVal - avg) > abs(minVal - avg) ? maxPt : minPt 
     2492         
     2493//      Variable loLeft,hiLeft, loBottom,hiBottom 
     2494//      loLeft = V_min*0.98             //+/- 2% 
     2495//      hiLeft = V_max*1.02 
     2496         
     2497//      SetAxis left loLeft,hiLeft 
     2498//      SetAxis bottom pnt2x(rescaledTime,pt-zoom),pnt2x(rescaledTime,pt+zoom) 
     2499         
     2500        Cursor/P A rescaledTime pt              //at the point 
     2501        Cursor/P B rescaledTime pt              //at the same point 
     2502 
     2503        SetDataFolder root: 
     2504 
     2505 
     2506        return(0) 
     2507End 
     2508 
    24282509Function EC_FindStepButton_down(ctrlName) : ButtonControl 
    24292510        String ctrlName 
     
    24452526end 
    24462527 
     2528// if the Trim button section is uncommented, it's "Zap outlier" 
     2529// 
     2530Function EC_FindOutlierButton(ctrlName) : ButtonControl 
     2531        String ctrlName 
     2532         
     2533        fFindOutlier() 
     2534// 
     2535//      STRUCT WMButtonAction ba 
     2536//      ba.eventCode = 2 
     2537// 
     2538//      EC_TrimPointsButtonProc(ba) 
     2539 
     2540        return(0) 
     2541end 
    24472542 
    24482543Function EC_DoDifferential(ctrlName) : ButtonControl 
     
    27712866 
    27722867        String fileName=""              // File name, partial path, full path or "" for dialog. 
    2773         String pathName="" 
    27742868        Variable refNum 
    27752869        String str 
     
    27892883         
    27902884        // Open file for read. 
    2791         Open/R/Z=2/F="????"/P=$pathName refNum as fileName 
     2885        Open/R/Z=2/F="????"/P=catPathName refNum as fileName 
    27922886        thePath = ParseFilePath(1, S_fileName, ":", 1, 0) 
    27932887        Print "thePath = ",thePath 
     
    28392933 
    28402934                Close outRef 
    2841                 listStr += outStr+";" 
     2935//              listStr += outStr+";" 
     2936                listStr += baseStr+num2str(ii)+";" 
    28422937        endfor 
    28432938 
     
    28542949 
    28552950        Close outRef 
    2856         listStr += outStr+";" 
    2857  
     2951//      listStr += outStr+";" 
     2952        listStr += baseStr+num2str(ii)+";" 
    28582953 
    28592954        FSetPos refNum,V_logEOF 
     
    31153210 
    31163211 
    3117  
     3212// unused, old testing procedure 
    31183213Function LoadDecimateButtonProc(ctrlName) : ButtonControl 
    31193214        String ctrlName 
     
    31583253        SVAR filename = root:Packages:NIST:gEvent_logfile 
    31593254        NVAR t_longest = root:Packages:NIST:gEvent_t_longest 
    3160          
     3255 
    31613256        SVAR listStr = root:Packages:NIST:Event:gSplitFileList 
    3162  
    31633257        NVAR t_longest_dec = root:Packages:NIST:gEvent_t_longest_decimated 
    31643258        NVAR decimation = root:Packages:NIST:Event:gDecimation 
    31653259 
     3260        String pathStr 
     3261        PathInfo catPathName 
     3262        pathStr = S_Path 
    31663263 
    31673264// if "stream" mode is not checked - abort 
     
    31763273        if(WaveExists(tw)) 
    31773274                listStr = TextWave2SemiList(tw) 
     3275        else 
     3276                ShowSplitFileTable() 
     3277                DoAlert 0,"Enter the file names in the table, then click 'Load From List' again." 
     3278                return(0) 
    31783279        endif 
    31793280         
     
    31863287        for(ii=0;ii<num;ii+=1) 
    31873288 
    3188 // (1) load the file             
    3189                 filename = StringFromList(ii, listStr  ,";") 
     3289// (1) load the file, prepending the path                
     3290                filename = pathStr + StringFromList(ii, listStr  ,";") 
    31903291                 
    31913292 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r916 r917  
    20582058         
    20592059        // fill the last bits of the header information 
    2060         err = SimulationVAXHeader(type) 
     2060        err = SimulationVAXHeader(type)         //if the type != 'SAS', this function does nothing 
     2061         
    20612062        if (err == -1) 
    20622063                Abort "no sample label entered - no file written"                       // User did not fill in header correctly/completely 
     
    24542455        String folder 
    24552456 
    2456         if(cmpstr(folder,"SAS")!=0)             //if not the SAS folder passed in, get out now, and return 1 
     2457        if(cmpstr(folder,"SAS")!=0)             //if not the SAS folder passed in, get out now, and return 1 (-1 is the error condition) 
    24572458                return(1) 
    24582459        endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/QKK_ANSTO_Transmission.ipf

    r908 r917  
    367367 
    368368                do 
    369                         Execute  "ProgressWindow spin" 
     369//                      Execute  "ProgressWindow spin" 
    370370                        xpath_config = xpath_SampleEnv + "/config[" + num2str(jj) + "]" //there may be multiple config per report 
    371371 
     
    733733        variable FilesAreMissing = 0 
    734734 
    735         Execute "ProgressWindow open, text=\"Loading Table...\"" 
     735//      Execute "ProgressWindow open, text=\"Loading Table...\"" 
    736736         
    737737        ii = 0 
     
    741741                emp_fname = S_path + EMP_Filenames[ii] 
    742742 
    743                 Execute "ProgressWindow text=\"Loading Table...\n" + S_Filenames[ii] + "\"" 
     743//              Execute "ProgressWindow text=\"Loading Table...\n" + S_Filenames[ii] + "\"" 
    744744                 
    745745                InsertPoints ii,1,S_Labels 
     
    816816                 
    817817                ii+=1 
    818                 Execute  "ProgressWindow percent=" + Num2Str(100*ii/lastPoint) 
     818//              Execute  "ProgressWindow percent=" + Num2Str(100*ii/lastPoint) 
    819819                 
    820820        while(ii<lastPoint) 
    821821         
    822         Execute "ProgressWindow close" 
     822//      Execute "ProgressWindow close" 
    823823         
    824824        if (FilesAreMissing) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/QKK_CatVSTable.ipf

    r908 r917  
    145145        ii=0 
    146146         
    147         Execute "ProgressWindow open, text=\"Loading Table...\"" 
     147//      Execute "ProgressWindow open, text=\"Loading Table...\"" 
    148148         
    149149        Make/T/O/N=0 notRAWlist 
     
    165165                        Endif 
    166166                else 
    167                         Execute "ProgressWindow text=\"Loading Table...\n" + tempName + "\"" 
     167//                      Execute "ProgressWindow text=\"Loading Table...\n" + tempName + "\"" 
    168168                 
    169169                        //prepend path to tempName for read routine  
     
    184184                 
    185185                ii+=1 
    186                 Execute  "ProgressWindow percent=" + Num2Str(100*ii/numitems) 
     186//              Execute  "ProgressWindow percent=" + Num2Str(100*ii/numitems) 
    187187                 
    188188        while(ii<numitems) 
     
    192192        AppendNotRAWFiles(notRAWlist)    
    193193        KillWaves/Z notRAWlist 
    194         Execute "ProgressWindow close" 
     194//      Execute "ProgressWindow close" 
    195195// 
    196196//      Print "Total time (s) = ",(ticks - t1)/60.15 
Note: See TracChangeset for help on using the changeset viewer.