source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Combine_1D.ipf @ 1097

Last change on this file since 1097 was 1097, checked in by srkline, 5 years ago

added procedures to compare files to see if they are from the same configuration, same wavelength, etc. so they can be properly chosen for transmission files, scattering files, and properly identified for the different resolution conditions.

Re-worked the logic of dispatching averaging, plotting, and saving in Execute_Protocol. Hopefully this will alow for easier dispatching for future conditions, including getting the correct resolution calculation.

File size: 19.0 KB
Line 
1#pragma TextEncoding = "MacRoman"
2#pragma rtGlobals=3             // Use modern global access method and strict wave access.
3
4
5
6
7
8//
9// TODO:
10// x- make  the data folder list for the popup
11// x- make the data folder popup do the work of plotting
12//
13// x- (done by invoking the panel)
14//   x-make a button to show the default table, and set up dependencies to link to the graph display
15//
16// -- have an "active" data set to trim, or make duplicates for all of the data sets
17//
18// -- button to convert the points to strings that can be used and written to data files?
19// -- is this really necessary? if the save button is clicked, the strings are automatically generated
20//  -- but what if it's not? What if I do something else to send the strings to a protocol? or to a file?
21//
22// -- find a better way to be sure that the dependency does not generate errors if it is not
23//   properly killed
24//
25// -- help file
26//
27// x- larger panel
28//
29// x- error checking if the binType and the data present don't match. (test for failure)
30// -- do I really need the binType popup? How else would I know what data sets to plot/remove?
31//
32// x- table is continually duplicated
33// -- AutoPosition the windows next to each other
34// x- (different)(not ugly) color for the control bar so it's distinguishable from the regular data plot
35// x- "Done" button that kills the root:ToTrim folder (may need to kill the dependency first)
36//
37Proc V_CombineDataGraph()
38
39// this is the "initialization" step
40        NewDataFolder/O root:ToTrim
41       
42        DoWindow/F V_1D_Combine
43
44        Variable num,ii
45        String detStr
46               
47        if(V_flag==0)
48
49                Display /W=(277,526,879,1069)/N=V_1D_Combine /K=2
50
51                ControlBar 70
52                ModifyGraph cbRGB=(44000,44000,44000)
53               
54//              Button button2,pos={15,5},size={70,20},proc=V_Load_ITX_button,title="Load Data"
55//              Button button2,help={"Load an ITX file"}
56               
57//              PopupMenu popup1,pos={125,5},size={90,20},title="Data Folder"
58//              PopupMenu popup1,help={"data folder"}
59//              PopupMenu popup1,value= GetAList(4),proc=V_DataFolderPlotPop
60               
61                PopupMenu popup0,pos={15,5},size={70,20},title="Bin Type"
62                PopupMenu popup0,help={"binning type"}
63                PopupMenu popup0,value= ksBinTypeStr,proc=V_DataBinTypePlotPop
64
65                Button button3,pos={544.00,5},size={30.00,20.00},title="?"
66                Button button3,help={"help file for combining 1D data"}
67
68                CheckBox check0,pos={18.00,36.00},size={57.00,16.00},proc=V_Plot1D_LogCheckProc,title="Log Axes"
69                CheckBox check0,value= 1
70
71                Button AllQ,pos={100,36},size={70,20},proc=V_AllQ_Plot_1D_ButtonProc,title="All Q"
72                Button AllQ,help={"Show the full q-range of the dataset"}
73
74                Button button1,pos={225,36},size={100,20},proc=V_TrimWaves2StringButton,title="Wave 2 Str"
75                Button button1,help={"Convert the waves to global strings"}
76               
77//              Button button4,pos={388,36},size={90.00,20.00},title="Trim & Save"
78//              Button button4,help={"combine and save 1D data"},proc=V_SaveTrimmed_Button
79               
80                Button button0,pos={524,36},size={70,20},proc=V_DoneCombine1D_ButtonProc,title="Done"
81                Button button0,help={"Close the panel and kill the temporary folder"}
82                               
83                Legend/C/N=text0/J/X=72.00/Y=60.00
84
85        endif   
86       
87
88        //trust that the table is present? No, but don't overwrite the data in the waves
89        // unless any one of the three doesn't exist
90       
91        SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols
92
93        if(exists("PanelNameW") == 0 || exists("Beg_pts") == 0 || exists("End_pts") == 0)
94                Make/O/T/N=(ItemsInList(ksPanelBinTypeList)) PanelNameW
95                Make/O/D/N=(ItemsInList(ksPanelBinTypeList)) Beg_pts
96                Make/O/D/N=(ItemsInList(ksPanelBinTypeList)) End_pts
97       
98                num = ItemsInList(ksPanelBinTypeList)
99                ii=0
100                do
101                        detStr = StringFromList(ii, ksPanelBinTypeList)
102                        Beg_pts[ii]  = NumberByKey(detStr, ksBinTrimBegDefault,"=",";")
103                        End_pts[ii] = NumberByKey(detStr, ksBinTrimEndDefault,"=",";")
104                        PanelNameW[ii] = detStr
105                        ii += 1
106                while(ii<num)
107               
108        endif
109        // now make sure that the table is present
110        DoWindow/F V_TrimPointsTable
111
112        if(V_flag==0)
113                Edit/K=0/N=V_TrimPointsTable PanelNameW,Beg_pts,End_pts         
114        endif
115       
116        // last, set up the dependency (but don't set it up twice!)
117        if(exists("root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate") == 0)
118                Make/O/D/N=1 root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate
119                root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate := V_TrimTestUpdate(Beg_pts, End_pts)
120        else
121                string dependencyStr = GetFormula(root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate)
122                if(strlen(dependencyStr)==0)
123                        root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate := V_TrimTestUpdate(Beg_pts, End_pts)
124                endif
125        endif
126       
127        SetDataFolder root:
128               
129End
130
131
132// function that is a simple dependency, and updates the trimmed waves
133// that are displayed
134//
135// does not actually modify the real data, makes a copy, and is only a visual
136//
137//
138Function V_TrimTestUpdate(Beg_pts, End_pts)
139        Wave Beg_pts,End_pts
140       
141        // trim the data displayed
142        // do this by setting the iBin values to NaN, so it won't display
143        // won't hurt to set twice...
144       
145        Wave/T panelStr = root:Packages:NIST:VSANS:Globals:Protocols:PanelNameW
146        Wave begW = root:Packages:NIST:VSANS:Globals:Protocols:Beg_pts
147        Wave endW = root:Packages:NIST:VSANS:Globals:Protocols:End_pts
148
149        // in case the dependency is still active, and the folder was killed
150        if(DataFolderExists("root:ToTrim") == 0)
151                return(0)
152        endif
153       
154//      SetDataFolder root:ToTrim
155//      ControlInfo/W=V_1D_Combine popup1
156//      String dataFldrStr = S_Value
157       
158        SVAR curDispType = root:Packages:NIST:VSANS:Globals:gCurDispType
159        String dataFldrStr = "root:Packages:NIST:VSANS:"+curDispType
160       
161        Variable num,ii,p1,p2
162        String str,detStr
163        num=numpnts(panelStr)
164       
165        for(ii=0;ii<num;ii+=1)
166                detStr = panelStr[ii]
167                Wave/Z iw = $("root:ToTrim:iBin_qxqy_"+detStr+"_trim")
168                Wave/Z iw_orig = $(dataFldrStr+":iBin_qxqy_"+detStr)
169//              Wave/Z iw = $("iBin_qxqy_"+detStr)
170//              Wave/Z ew = $("eBin_qxqy_"+detStr)
171                if(WaveExists(iw) && WaveExists(iw_orig))
172                       
173//                      DeletePoints 0,nBeg, qw,iw,ew
174                        // start fresh
175                        iw = iw_orig
176                       
177                        p1 = begW[ii]
178                        iw[0,p1-1] = NaN
179                               
180                        Variable npt
181                        npt = numpnts(iw)
182//                      DeletePoints npt-nEnd,nEnd, qw,iw,ew
183                        p2 = EndW[ii]
184                        iw[npt-p2,npt-1] = NaN
185                       
186                endif
187               
188        endfor
189       
190        SetDataFolder root:
191
192        return(0)
193End
194
195//
196// x- verify that the proper waves exist for the binning type
197//
198// x- the logic here is wrong. if the ToTrim folder is empty (As on startup)
199//  then the waves are always missing - and the function returns an error - every time
200//
201// now works with the "current" data that is displayed, rather than relying on
202// a lot of user input regarding the details of the saved data
203//
204Function V_DataBinTypePlotPop(ctrlName,popNum,popStr) : PopupMenuControl
205        String ctrlName
206        Variable popNum // which item is currently selected (1-based)
207        String popStr           // contents of current popup item as string
208
209
210        String str,winStr="V_1D_Combine"
211        Variable binType,num,ii,err
212
213        binType = V_BinTypeStr2Num(popStr)
214       
215       
216        //  x- need to update this to make sure that the data waves are present before plotting. This
217        //    currently looks in the ToTrim folder, but the binning could be wrong in the data folder
218        //    and will be an error...
219       
220        //dataType now needs to be the full path to the folder
221        // Plot the "real" data. data copy to trim will be plotted later
222        //
223        SVAR dispType = root:Packages:NIST:VSANS:Globals:gCurDispType
224        String collimationStr="pinhole"         //TODO: where do I get this information from ? does it matter here?
225
226// dispatch based on the string, not on the number of selection in the pop string
227        V_QBinAllPanels_Circular(dispType,binType,collimationStr)
228
229        String workTypeStr
230        workTypeStr = "root:Packages:NIST:VSANS:"+dispType
231       
232
233//      dataType = "root:"+popStr
234//     
235//      //remove EVERYTHING from the graph, no matter what
236        String type,list,item
237//      list = TraceNameList(winStr,";",1)
238//      for(ii=0;ii<ItemsInList(list);ii+=1)
239//              item = StringFromList(ii, list, ";")
240////            CheckDisplayed/W=$winStr $(item)
241////            if(V_flag==1)
242//                      RemoveFromGraph/Z/W=$winStr $(item)
243////            endif
244//      endfor 
245//     
246       
247        sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,binType,winStr
248
249        Execute ("V_Back_IQ_Graph"+str)
250        Execute ("V_Middle_IQ_Graph"+str)
251        Execute ("V_Front_IQ_Graph"+str)
252
253        ModifyGraph marker=8,opaque=1,msize=3           //make the traces open white circles
254
255
256        NewDataFolder/O root:ToTrim
257       
258        //remove all of the "toTrim" data from the graph, if it's there
259        SetDataFolder root:ToTrim
260        for(ii=0;ii<ItemsInList(ksPanelBinTypeList);ii+=1)
261                type = StringFromList(ii, ksPanelBinTypeList, ";")
262                CheckDisplayed/W=$winStr $("iBin_qxqy_"+type+"_trim")
263                if(V_flag==1)
264                        RemoveFromGraph/W=$winStr $("iBin_qxqy_"+type+"_trim")
265                endif
266        endfor 
267        SetDataFolder root:
268
269
270        //then kill the data folder, so it can be duplicated
271       
272//
273//      // duplicate all of the data into the new folder
274        SetDataFolder $workTypeStr
275        list = WaveList("*",";","")             //must be in the correct data folder
276        SetDataFolder root:
277//      Print list     
278        num = ItemsInList(list)
279        for(ii=0;ii<num;ii+=1)
280                str = StringFromList(ii,list)
281                Duplicate/O $(workTypeStr+":"+str), $("root:ToTrim:"+str+"_trim")
282        endfor
283       
284//      // be sure that the data is present in the ToTrim folder before trying to plot
285//      err = V_TrimWavesExist(binType)
286//      if(err)
287//              DoAlert 0,"wrong bin type selected"
288//              return(0)
289//      endif
290       
291       
292        // plot the linked data
293        sprintf str,"(\"%s\",%d,\"%s\")","root:ToTrim",binType,winStr
294
295        Execute ("V_Back_IQ_Graph_trim"+str)
296        Execute ("V_Middle_IQ_Graph_trim"+str)
297        Execute ("V_Front_IQ_Graph_trim"+str)
298        // and link the data to the table with a dependency?
299//      done in the panel macro?
300       
301        // last, force the dependency to update so that the trimmed points are shown
302        Wave w = root:Packages:NIST:VSANS:Globals:Protocols:Beg_pts
303        w[0] += 1
304        w[0] -= 1
305       
306       
307        return(0)       
308End
309
310
311
312//
313// x- verify that the proper waves exist for the binning type
314//
315// x- the logic here is wrong. if the ToTrim folder is empty (As on startup)
316//  then the waves are always missing - and the function returns an error - every time
317//
318// currently unused, in favor of using the current data rather than saved itx data
319//
320Function V_DataFolderPlotPop(ctrlName,popNum,popStr) : PopupMenuControl
321        String ctrlName
322        Variable popNum // which item is currently selected (1-based)
323        String popStr           // contents of current popup item as string
324
325
326        String str,winStr="V_1D_Combine",dataType
327        Variable binType,num,ii
328        ControlInfo popup0
329        binType = V_BinTypeStr2Num(S_Value)
330       
331       
332        //  x- need to update this to make sure that the data waves are present before plotting. This
333        //    currently looks in the ToTrim folder, but the binning could be wrong in the data folder
334        //    and will be an error...
335       
336        // be sure that the data is present in the ToTrim folder before trying to plot
337        Variable err = V_itxWavesExist(popStr,binType)
338        if(err)
339                DoAlert 0,"wrong bin type selected"
340                return(0)
341        endif
342       
343       
344        //dataType now needs to be the full path to the folder
345        // Plot the "real" data. data copy to trim will be plotted later
346        //
347        dataType = "root:"+popStr
348       
349        //remove EVERYTHING from the graph, no matter what
350        String type,list,item
351        list = TraceNameList(winStr,";",1)
352        for(ii=0;ii<ItemsInList(list);ii+=1)
353                item = StringFromList(ii, list, ";")
354//              CheckDisplayed/W=$winStr $(item)
355//              if(V_flag==1)
356                        RemoveFromGraph/Z/W=$winStr $(item)
357//              endif
358        endfor 
359       
360       
361        sprintf str,"(\"%s\",%d,\"%s\")",dataType,binType,winStr
362
363        Execute ("V_Back_IQ_Graph"+str)
364        Execute ("V_Middle_IQ_Graph"+str)
365        Execute ("V_Front_IQ_Graph"+str)
366
367        ModifyGraph marker=8,opaque=1,msize=3           //make the traces open white circles
368
369
370        NewDataFolder/O root:ToTrim
371       
372        //remove all of the "toTrim" data from the graph, if it's there
373        SetDataFolder root:ToTrim
374        for(ii=0;ii<ItemsInList(ksPanelBinTypeList);ii+=1)
375                type = StringFromList(ii, ksPanelBinTypeList, ";")
376                CheckDisplayed/W=$winStr $("iBin_qxqy_"+type+"_trim")
377                if(V_flag==1)
378                        RemoveFromGraph/W=$winStr $("iBin_qxqy_"+type+"_trim")
379                endif
380        endfor 
381        SetDataFolder root:
382
383
384        //then kill the data folder, so it can be duplicated
385       
386//
387//      // duplicate all of the data into the new folder
388        SetDataFolder $dataType
389        list = WaveList("*",";","")             //must be in the correct data folder
390        SetDataFolder root:
391//      Print list     
392        num = ItemsInList(list)
393        for(ii=0;ii<num;ii+=1)
394                str = StringFromList(ii,list)
395                Duplicate/O $(dataType+":"+str), $("root:ToTrim:"+str+"_trim")
396        endfor
397       
398        // be sure that the data is present in the ToTrim folder before trying to plot
399        err = V_TrimWavesExist(binType)
400        if(err)
401                DoAlert 0,"wrong bin type selected"
402                return(0)
403        endif
404       
405       
406        // plot the linked data
407        sprintf str,"(\"%s\",%d,\"%s\")","root:ToTrim",binType,winStr
408
409        Execute ("V_Back_IQ_Graph_trim"+str)
410        Execute ("V_Middle_IQ_Graph_trim"+str)
411        Execute ("V_Front_IQ_Graph_trim"+str)
412        // and link the data to the table with a dependency?
413//      done in the panel macro?
414       
415        // last, force the dependency to update so that the trimmed points are shown
416        Wave w = root:Packages:NIST:VSANS:Globals:Protocols:Beg_pts
417        w[0] += 1
418        w[0] -= 1
419       
420       
421        return(0)       
422End
423
424
425
426// kill the dependency,
427// kill the panel, then the associated ToTrim folder
428// do not kill the beg/end waves
429//
430Function V_DoneCombine1D_ButtonProc(ctrlName) : ButtonControl
431        String ctrlName
432       
433        Wave trimUpdate = root:Packages:NIST:VSANS:Globals:Protocols:trimUpdate
434        trimUpdate = 1          //kills the dependency
435        DoWindow/K V_1D_Combine
436       
437        KillDataFolder/Z root:ToTrim
438       
439        return(0)
440End
441
442// TODO
443// -- verify that this works for all binning cases
444// -- see V_Trim1DDataStr to see if they can be combined
445//
446Function V_SaveTrimmed_Button(ctrlName) : ButtonControl
447        String ctrlName
448       
449        String detListStr,dataType,str
450        Variable bintype,num,ii
451
452        ControlInfo popup0
453        binType = V_BinTypeStr2Num(S_Value)
454       
455       
456        if(binType == 1)
457                detListStr = ksBinType1
458        endif
459        if(binType == 2)
460                detListStr = ksBinType2
461        endif
462        if(binType == 3)
463                detListStr = ksBinType3
464        endif
465        if(binType == 4)
466                detListStr = ksBinType4
467        endif
468        if(strlen(detListStr)==0)
469                DoAlert 0,"error in V_SaveTrimmed_Button"
470                return(0)
471        endif
472
473// set the global strings
474        V_TrimWaves2String()            //in case the button wasn't clicked
475        SVAR gBegPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr
476        SVAR gEndPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr
477
478// get a fresh copy of the data
479// duplicate all of the data into the new folder
480        ControlInfo popup1
481        dataType = "root:"+S_Value
482
483        SetDataFolder $dataType
484        String list = WaveList("*",";","")              //must be in the correct data folder
485        SetDataFolder root:
486//      Print list     
487        num = ItemsInList(list)
488        for(ii=0;ii<num;ii+=1)
489                str = StringFromList(ii,list)
490                Duplicate/O $(dataType+":"+str), $("root:ToTrim:"+str+"_trim")
491        endfor
492
493       
494// trim each data set
495        Variable nBeg,nEnd,npt
496        String detstr
497       
498        SetDataFolder root:ToTrim
499        num = ItemsInList(detListStr)
500        for(ii=0;ii<num;ii+=1)
501                detStr = StringFromList(ii, detListStr)
502                nBeg = NumberByKey(detStr, gBegPtsStr,"=",";")
503                nEnd = NumberByKey(detStr, gEndPtsStr,"=",";")
504               
505//              V_TrimOneSet(folderStr,detStr,nBeg,nEnd)
506                Wave/Z qw = $("qBin_qxqy_"+detStr+"_trim")
507                Wave/Z iw = $("iBin_qxqy_"+detStr+"_trim")
508                Wave/Z ew = $("eBin_qxqy_"+detStr+"_trim")
509
510                DeletePoints 0,nBeg, qw,iw,ew
511
512                npt = numpnts(qw)
513                DeletePoints npt-nEnd,nEnd, qw,iw,ew
514//             
515        endfor
516
517
518// remove Q=0 from "B" if it's present
519        SetDataFolder root:ToTrim
520        WAVE/Z qBin = qBin_qxqy_B_trim
521        WAVE/Z iBin = iBin_qxqy_B_trim
522        WAVE/Z eBin = eBin_qxqy_B_trim
523//      WAVE/Z nBin = nBin_qxqy_B_trim
524//      WAVE/Z iBin2 = iBin2_qxqy_B_trim
525
526        if(qBin[0] == 0)
527                DeletePoints 0, 1, qBin,iBin,eBin//,nBin,iBin2
528        endif
529
530       
531// concatenate
532        V_1DConcatenate("root:","ToTrim","_trim",binType)
533
534// sort the waves - concatenation creates tmp_q, tmp_i, tmp_s
535// so this call will work (doesn't need the "_trim" tag)
536        V_TmpSort1D("root:","ToTrim")
537
538// write out the data to disk
539
540        Execute "V_GetNameForSave()"
541        SVAR newName = root:saveName
542        String saveName = newName
543
544        //will write out the tmp_q, tmp_i, tmp_s waves
545        V_Write1DData("root:","ToTrim",saveName)                //don't pass the full path, just the name
546
547       
548// put a fresh copy of the data back into the folder since the data was actually trimmed
549// duplicate all of the data into the new folder
550        ControlInfo popup1
551        dataType = "root:"+S_Value
552
553        SetDataFolder $dataType
554        list = WaveList("*",";","")             //must be in the correct data folder
555        SetDataFolder root:
556//      Print list     
557        num = ItemsInList(list)
558        for(ii=0;ii<num;ii+=1)
559                str = StringFromList(ii,list)
560                Duplicate/O $(dataType+":"+str), $("root:ToTrim:"+str+"_trim")
561        endfor
562
563
564        SetDataFolder root:
565       
566        return(0)
567End
568
569
570
571//
572// dialog to select and load an itx format data file
573//
574Function V_Load_ITX_Button(ctrlName) : ButtonControl
575        String ctrlName
576       
577        Execute "V_Load_Data_ITX()"
578       
579        return(0)
580End
581
582
583// TODO
584// -- document
585Function V_TrimWaves2StringButton(ctrlName) : ButtonControl
586        String ctrlName
587       
588        V_TrimWaves2String()
589
590        return(0)
591End
592
593// for each of the binning types, be sure that the corresponding waves in the
594// root:ToTrim folder actually do exist.
595// return 0 for OK, 1 if error
596Function V_TrimWavesExist(binType)
597        Variable binType
598       
599        String binStr="",str
600        Variable num,ii
601       
602        if(binType == 1)
603                binStr = ksBinType1
604        endif
605        if(binType == 2)
606                binStr = ksBinType2
607        endif
608        if(binType == 3)
609                binStr = ksBinType3
610        endif
611        if(binType == 4)
612                binStr = ksBinType4
613        endif
614       
615        num = ItemsInList(binStr)
616        for(ii=0;ii<num;ii+=1)
617                str = StringFromList(ii,binStr)
618                if(exists("root:ToTrim:iBin_qxqy_"+Str+"_trim") == 0)           // not in use = error
619                        return(1)
620                endif
621        endfor
622       
623        return(0)               //everything checked out OK, no error
624
625end
626
627// for each of the binning types, be sure that the corresponding waves in the
628// root:ToTrim folder actually do exist.
629// return 0 for OK, 1 if error
630Function V_itxWavesExist(folderStr,binType)
631        String folderStr
632        Variable binType
633       
634        String binStr="",str
635        Variable num,ii
636       
637        if(binType == 1)
638                binStr = ksBinType1
639        endif
640        if(binType == 2)
641                binStr = ksBinType2
642        endif
643        if(binType == 3)
644                binStr = ksBinType3
645        endif
646        if(binType == 4)
647                binStr = ksBinType4
648        endif
649       
650        num = ItemsInList(binStr)
651        for(ii=0;ii<num;ii+=1)
652                str = StringFromList(ii,binStr)
653                if(exists("root:"+folderStr+":iBin_qxqy_"+Str) == 0)            // not in use = error
654                        return(1)
655                endif
656        endfor
657       
658        return(0)               //everything checked out OK, no error
659
660end
661
662
663
664//
665// take the waves, and convert to strings that can be added to the protocol
666//
667//
668// x- get the variables out of root:, and move it to Protocols
669// x- get the waves out of root:, and move it to Protocols
670// x- be sure that the variables are initialized (done in main initialization
671// x- link this to the panel?
672//
673Function V_TrimWaves2String()
674
675
676        SVAR gBegPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr
677        SVAR gEndPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr
678
679        Wave/T PanelNameW = root:Packages:NIST:VSANS:Globals:Protocols:PanelNameW
680        Wave Beg_pts = root:Packages:NIST:VSANS:Globals:Protocols:Beg_pts
681        Wave End_pts = root:Packages:NIST:VSANS:Globals:Protocols:End_pts
682       
683// ksPanelBinTypeList = "B;FT;FB;FL;FR;MT;MB;ML;MR;FTB;FLR;MTB;MLR;FLRTB;MLRTB;"
684// ksBinTrimBegDefault = "B=5;FT=6;FB=6;FL=6;FR=6;MT=6;MB=6;ML=6;MR=6;FTB=7;FLR=7;MTB=7;MLR=7;FLRTB=8;MLRTB=8;"
685// ksBinTrimEndDefault
686
687        // wipe out the "old" global strings
688        gBegPtsStr = ksBinTrimBegDefault
689        gEndPtsStr = ksBinTrimEndDefault
690
691        Variable num, ii,nBeg,nEnd
692        String item,panelStr
693       
694        num = numpnts(PanelNameW)
695        for(ii=0;ii<num;ii+=1)
696                panelStr = PanelNameW[ii]
697                gBegPtsStr = ReplaceNumberByKey(panelStr, gBegPtsStr, Beg_pts[ii],"=",";")
698                gEndPtsStr = ReplaceNumberByKey(panelStr, gEndPtsStr, End_pts[ii],"=",";")
699        endfor
700
701        return(0)
702End
703
704
Note: See TracBrowser for help on using the repository browser.