- Timestamp:
- Jul 5, 2013 3:40:33 PM (10 years ago)
- Location:
- sans/Dev/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf
r916 r917 204 204 Button button2,pos={419,28},size={140,20},proc=ShowEventDataButtonProc,title="Show Event Data" 205 205 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"207 206 Button button5,pos={419,85},size={140,20},proc=ExportSlicesButtonProc,title="Export Slices as VAX" 208 207 Button button6,pos={718,9},size={40,20},proc=EventModeHelpButtonProc,title="?" 208 209 209 210 Button button7,pos={487,197},size={120,20},proc=AdjustEventDataButtonProc,title="Adjust Events" 210 211 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 213 215 214 216 SetVariable setvar0,pos={208,149},size={160,16},proc=sliceSelectEvent_Proc,title="Display Time Slice" … … 223 225 PopupMenu popup0,fSize=10 224 226 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" 225 228 226 229 Button button10,pos={488,305},size={100,20},proc=SplitFileButtonProc,title="Split Big File" … … 463 466 endif 464 467 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 465 473 // toggle the checkbox for log display to force the display to be correct 466 474 NVAR gLog = root:Packages:NIST:gEvent_logint … … 859 867 // TODO: 860 868 // 861 // What, if anything is different about the OSC or STREAM load?862 // I think that only the processing is different. so this could be863 // consolidated into a single loader.864 //865 869 // ** currently, the "stream" loader uses the first data point as time=0 866 870 // and rescales everything to that time. "Osc" loading uses the times "as-is" … … 884 888 String abortStr 885 889 886 Open/R/D/ F=fileFilters fileref890 Open/R/D/P=catPathName/F=fileFilters fileref 887 891 filename = S_filename 888 892 if(strlen(S_filename) == 0) … … 937 941 endif 938 942 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 940 953 941 954 SetDataFolder root: … … 1803 1816 dispStr += tmpStr 1804 1817 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 1805 1828 SetDataFolder root: 1806 1829 … … 2108 2131 SetDataFolder root:Packages:NIST:Event: 2109 2132 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 2135 2164 2136 2165 SetDataFolder root: … … 2159 2188 End 2160 2189 2190 // updates the longest time (as does every operation of adjusting the data) 2191 // 2161 2192 Function EC_AddTimeButtonProc(ba) : ButtonControl 2162 2193 STRUCT WMButtonAction &ba … … 2181 2212 MultiThread rescaledTime[lo,hi] += rollTime 2182 2213 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) 2183 2217 2184 2218 SetDataFolder root: … … 2213 2247 MultiThread rescaledTime[lo,hi] -= rollTime 2214 2248 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 2215 2253 SetDataFolder root: 2216 2254 … … 2250 2288 2251 2289 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 2252 2295 SetDataFolder root: 2253 2296 … … 2331 2374 dispStr = tmpStr 2332 2375 2376 SetDataFolder root: 2333 2377 break 2334 2378 case -1: // control being killed … … 2397 2441 zoom = 200 //points in each direction 2398 2442 2399 WaveStats/ Q rescaledTime_DIF2443 WaveStats/M=1/Q rescaledTime_DIF 2400 2444 avg = V_avg 2401 2445 … … 2426 2470 2427 2471 2472 // find the max (or min) of the rescaled time set 2473 // and place both cursors there 2474 Function 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) 2507 End 2508 2428 2509 Function EC_FindStepButton_down(ctrlName) : ButtonControl 2429 2510 String ctrlName … … 2445 2526 end 2446 2527 2528 // if the Trim button section is uncommented, it's "Zap outlier" 2529 // 2530 Function 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) 2541 end 2447 2542 2448 2543 Function EC_DoDifferential(ctrlName) : ButtonControl … … 2771 2866 2772 2867 String fileName="" // File name, partial path, full path or "" for dialog. 2773 String pathName=""2774 2868 Variable refNum 2775 2869 String str … … 2789 2883 2790 2884 // Open file for read. 2791 Open/R/Z=2/F="????"/P= $pathName refNum as fileName2885 Open/R/Z=2/F="????"/P=catPathName refNum as fileName 2792 2886 thePath = ParseFilePath(1, S_fileName, ":", 1, 0) 2793 2887 Print "thePath = ",thePath … … 2839 2933 2840 2934 Close outRef 2841 listStr += outStr+";" 2935 // listStr += outStr+";" 2936 listStr += baseStr+num2str(ii)+";" 2842 2937 endfor 2843 2938 … … 2854 2949 2855 2950 Close outRef 2856 listStr += outStr+";"2857 2951 // listStr += outStr+";" 2952 listStr += baseStr+num2str(ii)+";" 2858 2953 2859 2954 FSetPos refNum,V_logEOF … … 3115 3210 3116 3211 3117 3212 // unused, old testing procedure 3118 3213 Function LoadDecimateButtonProc(ctrlName) : ButtonControl 3119 3214 String ctrlName … … 3158 3253 SVAR filename = root:Packages:NIST:gEvent_logfile 3159 3254 NVAR t_longest = root:Packages:NIST:gEvent_t_longest 3160 3255 3161 3256 SVAR listStr = root:Packages:NIST:Event:gSplitFileList 3162 3163 3257 NVAR t_longest_dec = root:Packages:NIST:gEvent_t_longest_decimated 3164 3258 NVAR decimation = root:Packages:NIST:Event:gDecimation 3165 3259 3260 String pathStr 3261 PathInfo catPathName 3262 pathStr = S_Path 3166 3263 3167 3264 // if "stream" mode is not checked - abort … … 3176 3273 if(WaveExists(tw)) 3177 3274 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) 3178 3279 endif 3179 3280 … … 3186 3287 for(ii=0;ii<num;ii+=1) 3187 3288 3188 // (1) load the file 3189 filename = StringFromList(ii, listStr ,";")3289 // (1) load the file, prepending the path 3290 filename = pathStr + StringFromList(ii, listStr ,";") 3190 3291 3191 3292 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf
r916 r917 2058 2058 2059 2059 // 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 2061 2062 if (err == -1) 2062 2063 Abort "no sample label entered - no file written" // User did not fill in header correctly/completely … … 2454 2455 String folder 2455 2456 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) 2457 2458 return(1) 2458 2459 endif -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/QKK_ANSTO_Transmission.ipf
r908 r917 367 367 368 368 do 369 Execute "ProgressWindow spin"369 // Execute "ProgressWindow spin" 370 370 xpath_config = xpath_SampleEnv + "/config[" + num2str(jj) + "]" //there may be multiple config per report 371 371 … … 733 733 variable FilesAreMissing = 0 734 734 735 Execute "ProgressWindow open, text=\"Loading Table...\""735 // Execute "ProgressWindow open, text=\"Loading Table...\"" 736 736 737 737 ii = 0 … … 741 741 emp_fname = S_path + EMP_Filenames[ii] 742 742 743 Execute "ProgressWindow text=\"Loading Table...\n" + S_Filenames[ii] + "\""743 // Execute "ProgressWindow text=\"Loading Table...\n" + S_Filenames[ii] + "\"" 744 744 745 745 InsertPoints ii,1,S_Labels … … 816 816 817 817 ii+=1 818 Execute "ProgressWindow percent=" + Num2Str(100*ii/lastPoint)818 // Execute "ProgressWindow percent=" + Num2Str(100*ii/lastPoint) 819 819 820 820 while(ii<lastPoint) 821 821 822 Execute "ProgressWindow close"822 // Execute "ProgressWindow close" 823 823 824 824 if (FilesAreMissing) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/QKK_CatVSTable.ipf
r908 r917 145 145 ii=0 146 146 147 Execute "ProgressWindow open, text=\"Loading Table...\""147 // Execute "ProgressWindow open, text=\"Loading Table...\"" 148 148 149 149 Make/T/O/N=0 notRAWlist … … 165 165 Endif 166 166 else 167 Execute "ProgressWindow text=\"Loading Table...\n" + tempName + "\""167 // Execute "ProgressWindow text=\"Loading Table...\n" + tempName + "\"" 168 168 169 169 //prepend path to tempName for read routine … … 184 184 185 185 ii+=1 186 Execute "ProgressWindow percent=" + Num2Str(100*ii/numitems)186 // Execute "ProgressWindow percent=" + Num2Str(100*ii/numitems) 187 187 188 188 while(ii<numitems) … … 192 192 AppendNotRAWFiles(notRAWlist) 193 193 KillWaves/Z notRAWlist 194 Execute "ProgressWindow close"194 // Execute "ProgressWindow close" 195 195 // 196 196 // Print "Total time (s) = ",(ticks - t1)/60.15
Note: See TracChangeset
for help on using the changeset viewer.