source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf @ 1073

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

lots of changes here:
many little fixes to clean up TODO items and marke them DONE

changed the handling of the panel "gap" to split the gap evenly. Q-calculations have been re-verified with this change.

re-named the list of "bin Type" values, and added a few more choices. Streamlined how the averaging and plotting works with this list so that it can be more easily modified as different combinations of binning are envisioned. This resulted in a lot of excess code being cut out and replaced with cleaner logic. This change has also been verified to work as intended.

Attenuation is now always calculated from the table. The table also by (NEW) definition has values for the white beam (one waelength) and graphite (multiple possible wavelengths) where the wavelengths are artificially scaled (*1000) or *1e6) so that the interpolations can be done internally without the need for multiple attenuator tables.

  • Property svn:executable set to *
File size: 34.7 KB
RevLine 
[1002]1#pragma rtGlobals=1             // Use modern global access method.
2#pragma version=5.0
3#pragma IgorVersion=6.1
4
5//
6// UPDATED for VSANS - only the simplest implementation to start with
7// June 2016  SRK
8// included ANSTO sort panel from david m
9//
10
11
12//
13// TODO
[1044]14// x- clean up and remove all of the references to other facilities, since they will not have VSANS modules
[1002]15// -- add in more appropriate and some missing fields more useful to VSANS (intent, multiple beam centers, etc.)
[1023]16// -- can I make the choice of columns customizable? There are "sets" of columns that are not used for
17//    some experiments (magnetic, rotation, temperature scans, etc.) but are necessary for others.
[1002]18//
[1073]19// (DONE):
[1002]20// x- clean up the list of files that now accumulates in the RawVSANS folder!!! Everything is there, including
21//    files that are NOT RAW VSANS data (MASK and DIV, but these are HDF)
22// x- WHY -- because if I PATCH anything, then re-run the catalog, the changes are NOT shown, since the
[1023]23//    reader will go to the LOCAL copy first! So maybe I need to clear the folder out before I start the
[1002]24//    file catalog
[1023]25// x- maybe it's a good thing to wipe out the RawVSANS folder before an Experiment SAVE (to save a LOT of
[1002]26//    space on disk and a potentially VERY long save
27// x- see V_CleanOutRawVSANS() in V_Utilities_General for the start of this (this is now called in
28//    V_BuildCatVeryShortTable(), the starting point for generating the table.)
29//
30// NEW for VSANS
31// clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk
32// will not be read in, the "bad" local copy will be read in.
[1073]33// (DONE)
[1044]34//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If
[1002]35//     the "patched" values are written locally too, then maybe the update from disk is not needed.
36//     But typically, I'd like to see that the disk version really did get updated...
[1073]37// x- (NO)make a background task to periodically "kill" a few of the files? maybe too dangerous.
38// x- (NO)change the V_GetHeaderInfoToWave function to allow "refreshing" of a single row, say after
[1034]39//    a file has been patched - then the disk and local copies are in sync
40//
41// -- run a profiler on the catalog to see if there is an obvious place to speed up the process
42//
[1002]43
[1034]44Function catalogProfiler()
45        V_BuildCatVeryShortTable()
46End
[1023]47
[1002]48//
49//      SRK modified 30 JAN07 to include Rotation angle, Temperature, and B-field in the table (at the end)
50//
51
52//**************
53// Vers 1.2 090401
54//
55// Procedures for creating the Catalog listings of the SANS datafiles in the folder
56// specified by catPathName.
57// Header information from each of the dataifles is organized in a table for
58// easy identification of each file. CatVSANSTable is the preferred invocation,
59// although CatVSNotebook and CatNotebook can also be used.
60// Files in the folder that are not RAW SANS data are appended to the end of the listing.
61//**************
62
63//this main procedure does all the work, obtaining the folder path,
64//parsing the filenames in the list and (dispatching) to write out the
65//appropriate information to the growing (table) of data. V_GetHeaderInfoToWave() does the individual reads
66Function V_BuildCatVeryShortTable()
67       
68        Variable err
69        Variable t1 = ticks
70       
71        PathInfo catPathName
72        if(v_flag==0)
73                err = V_PickPath()              //sets the local path to the data (catPathName)
74                if(err)
75                        Abort "no path to data was selected, no catalog can be made - use PickPath button"
76                Endif
77        Endif
78       
79        DoWindow/F CatVSANSTable
80       
81        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
[1023]82//      Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"
[1002]83        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
84        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
[1023]85//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]86        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
87        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
88        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
89        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
90        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
91        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]92//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
93//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]94        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
95        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
[1023]96//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"
97//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"
[1002]98        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
99        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
100        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
101        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"            //added Mar 2008
102        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"            //added Mar 2010
[1023]103        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]104        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]105        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]106
107
108        WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
[1023]109//      WAVE/T Suffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"
[1002]110        WAVE/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
111        WAVE/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
[1023]112//      WAVE SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]113        WAVE Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
114        WAVE CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
115        WAVE TotCnts = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
116        WAVE CntRate = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
117        WAVE Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
118        WAVE Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]119//      WAVE XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
120//      WAVE YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]121
122        WAVE/T nGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
123        WAVE NumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
[1023]124//      WAVE RunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"
125//      WAVE IsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"
[1002]126        WAVE RotAngle = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
127        WAVE Temperature = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
128        WAVE Field = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
129        WAVE MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"              //added Mar 2008
130        WAVE Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"
[1023]131        WAVE/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]132        WAVE/T Purpose = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]133        WAVE Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]134
135       
136        If(V_Flag==0)
137                V_BuildTableWindow()
[1023]138//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=40
[1002]139                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=40
140                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime)=50
141                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts)=60
142                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate)=60
143                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission)=40
144                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness)=40
[1023]145//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter)=40
146//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter)=40
[1002]147                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens)=30
148                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle)=50
149                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Field)=50
150                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR)=50
151
152                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides)=40
153                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos)=30
154                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos)=3                   //to make the display look nice, given the floating point values from ICE
155                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=3                //may not work in all situations, but an improvement
[1023]156//              ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=5
[1002]157                ModifyTable trailingZeros(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=1
158                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=4
159
160                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run
[1023]161
[1073]162// (DONE)
[1044]163//  x- experimental hook with contextual menu
[1023]164//             
165                SetWindow kwTopWin hook=V_CatTableHook, hookevents=1    // mouse down events
166
[1002]167        Endif
168
169
170// NEW for VSANS
171// clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk
[1023]172// will not be read in, the "bad" local copy will be read in for any subsequent operations.
[1073]173// (DONE)
[1044]174//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If
[1002]175//     the "patched" values are written locally too, then maybe the update from disk is not needed.
176//     But typically, I'd like to see that the disk version really did get updated...
177//
[1003]178        //      V_CleanOutRawVSANS()
179// This will display a progress bar
[1023]180        Variable numToClean
181        numToClean = V_CleanupData_w_Progress(0,1)
[1002]182
[1023]183        Print "Cleaned # files = ",numToClean
184        Print "Cleanup time (s) = ",(ticks - t1)/60.15
185        Variable cleanupTime = (ticks - t1)/60.15
[1002]186
187        //get a list of all files in the folder, some will be junk version numbers that don't exist     
188        String list,partialName,tempName,temp=""
189        list = IndexedFile(catPathName,-1,"????")       //get all files in folder
190        Variable numitems,ii,ok
191       
192        numitems = ItemsInList(list,";")
193       
[1073]194        // show a progress bar for filling the file catalog
195        Variable indefinite=0,useIgorDraw=1
196        NewPanel /N=ProgressPanel /W=(285,111,739,193)
197        ValDisplay valdisp0,win=ProgressPanel,pos={18,32},size={342,18},limits={0,numitems,0},barmisc={0,0}
198        ValDisplay valdisp0,win=ProgressPanel,value= _NUM:0
199        DrawText 20,24,"Refreshing file catalog... Please Wait..."
200
201        if( indefinite )
202                ValDisplay valdisp0,win=ProgressPanel,mode= 4   // candy stripe
203        else
204                ValDisplay valdisp0,win=ProgressPanel,mode= 3   // bar with no fractional part
205        endif
206        if( useIgorDraw )
207                ValDisplay valdisp0,win=ProgressPanel,highColor=(49535,1000,1000)               //(0,65535,0)
208        endif
209        Button bStop,win=ProgressPanel,pos={375,32},size={50,20},title="Stop"
210        DoUpdate /W=ProgressPanel /E=1  // mark this as our progress window
211       
212       
[1002]213        //loop through all of the files in the list, reading CAT/SHORT information if the file is RAW SANS
214        String str,fullName
215        Variable lastPoint
216        ii=0
217       
218        Make/T/O/N=0 notRAWlist
219        do
220       
221                //get current item in the list
222                partialName = StringFromList(ii, list, ";")
223                //get a valid file based on this partialName and catPathName
224                tempName = V_FindValidFilename(partialName)
225               
226               
227                If(cmpstr(tempName,"")==0)              //a null string was returned
228                        //write to notebook that file was not found
229                        //if string is not a number, report the error
230                        if(numtype(str2num(partialName)) == 2)
231                                str = "this file was not found: "+partialName+"\r\r"
232                                //Notebook CatWin,font="Times",fsize=12,text=str
233                        Endif
234                else
235                        //prepend path to tempName for read routine
236                        PathInfo catPathName
237                        FullName = S_path + tempName
238                        //make sure the file is really a RAW data file
239                        ok = V_CheckIfRawData(fullName)
240               
241                        if (!ok)
242                                //write to notebook that file was not a RAW SANS file
243                                lastPoint = numpnts(notRAWlist)
244                                InsertPoints lastPoint,1,notRAWlist
245                                notRAWlist[lastPoint]=tempname
246                        else
247                                //go write the header information to the Notebook
248                                V_GetHeaderInfoToWave(fullName,tempName)
249                        Endif
250                Endif
251                ii+=1
[1073]252               
253                ValDisplay valdisp0,win=ProgressPanel,value= _NUM:ii
254                DoUpdate /W=ProgressPanel
255               
[1002]256        while(ii<numitems)
[1073]257       
258        KillWindow ProgressPanel
259
[1002]260//Now sort them all based on some criterion that may be facility dependent (aim is to order them as collected)
261        V_SortWaves()
[1073]262       
[1002]263//Append the files that are not raw files to the list
264        V_AppendNotRAWFiles(notRAWlist)
265        KillWaves/Z notRAWlist
266//
[1023]267        Print "Total time (s) = ",(ticks - t1)/60.15
[1064]268        Print "Time per raw data file (without cleanup time) (s) = ",( (ticks - t1)/60.15 - cleanupTime)/(numpnts(labels))
[1037]269        // (don't use numpnts(notRawList) to normalize, these aren't all raw data files)
[1002]270        //
271        // clean out again, so that the file SAVE is not slow due to the large experiment size
[1073]272        // (DONE) x- decide if this is really necessary (not necessary at this point)
[1002]273//     
274//      V_CleanOutRawVSANS()
275                       
276                       
277        return(0)
278End
279
[1023]280//
281// TODO:
[1024]282//  this is experimental...not been tested by any users yet
283// -- what else to add to the menu? (MSK and DIV now work)
[1023]284// -- add directly to WORK files?
[1044]285// -- "set" as some special file type, intent, use? (quick "patch" operations)
[1023]286// -- "check" the reduction protocol for completeness?
287//
288// x- seems to not "let go" of a selection (missing the mouse up?)
289//    (possibly) less annoying if I only handle mouseup and present a menu then.
290//
291Function V_CatTableHook(infoStr)
292        String infoStr
293        String event= StringByKey("EVENT",infoStr)
294//      Print "EVENT= ",event
295        strswitch(event)
296                case "mouseup":
297//                      Variable xpix= NumberByKey("MOUSEX",infoStr)
298//                      Variable ypix= NumberByKey("MOUSEY",infoStr)
299//                      PopupContextualMenu/C=(xpix, ypix) "yes;no;maybe;"
[1024]300                        PopupContextualMenu "Load RAW;Load MSK;Load DIV;"
301                       
302                        WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
303                        Variable err
[1023]304                        strswitch(S_selection)
305                                case "Load RAW":
306                                        GetSelection table,CatVSANSTable,1
307//                                      Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol
308                                        Print "Loading " + FileNames[V_StartRow]
[1024]309                                        err = V_LoadHDF5Data(FileNames[V_StartRow],"RAW")
[1023]310                                        if(!err)                //directly from, and the same steps as DisplayMainButtonProc(ctrlName)
311                                                SVAR hdfDF = root:file_name                     // last file loaded, may not be the safest way to pass
312                                                String folder = StringFromList(0,hdfDF,".")
313                                               
314                                                // this (in SANS) just passes directly to fRawWindowHook()
[1025]315                                                V_UpdateDisplayInformation("RAW")               // plot the data in whatever folder type
316                                                                                               
[1023]317                                                // set the global to display ONLY if the load was called from here, not from the
318                                                // other routines that load data (to read in values)
319                                                SVAR gLast = root:Packages:NIST:VSANS:Globals:gLastLoadedFile
320                                                gLast = hdfDF
321                                               
322                                        endif
323                                        break;
[1024]324                                       
325                                case "Load MSK":
326                                        GetSelection table,CatVSANSTable,1
327//                                      Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol
328                                        Print "Loading " + FileNames[V_StartRow]
329                                        err = V_LoadHDF5Data(FileNames[V_StartRow],"MSK")
330                                       
[1023]331                                        break;
[1024]332                                       
333                                case "Load DIV":
334                                        GetSelection table,CatVSANSTable,1
335//                                      Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol
336                                        Print "Loading " + FileNames[V_StartRow]
337                                        err = V_LoadHDF5Data(FileNames[V_StartRow],"DIV")
338
[1023]339                                        break;
[1024]340                                       
341                        endswitch               //popup selection
342        endswitch       // event
343       
[1023]344        return 0
345End
346
347
348
[1002]349//appends the list of files that are not RAW SANS data to the filename wave (1st column)
350//for display in the table. Note that the filenames column will now be longer than all other
351//waves in the table
[1064]352//
353// skip this step if there are no files to tack on
[1002]354Function V_AppendNotRAWFiles(w)
355        Wave/T w
[1064]356        if(numpnts(w) != 0)
357                Wave/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
358                Variable lastPoint
359                lastPoint = numpnts(Filenames)
360                InsertPoints lastPoint,numpnts(w),Filenames
361                Filenames[lastPoint,numpnts(Filenames)-1] = w[p-lastPoint]
362        endif
[1002]363        return(0)
364End
365
[1073]366//
[1002]367Function V_SortWaves()
368        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
[1023]369//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"
[1002]370        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
371        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
[1023]372//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]373        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
374        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
375        Wave GTotCnts = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
376        Wave GCntRate = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
377        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
378        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]379//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
380//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]381
382        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
383        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
[1023]384//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"
385//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"
[1002]386        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
387        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
388        Wave GField = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
389        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"             //added Mar 2008
390        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"
[1023]391        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]392        Wave/T GPurpose = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]393        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]394
395
[1023]396// DONE
397// x- the default sort is by SUFFIX, which does not exist for VSANS. So decide on a better key
398//     now, the sort is by FileName by default
399//      Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides
[1063]400        Sort GFilenames, GFilenames, GLabels, GDateTime,  GIntent, GPurpose, G_ID, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,GRot,GTemp,GField,GMCR,GPos,gNumGuides
[1002]401
402        return(0)
403End
404
405//function to create the CAT/VSTable to display the header information
406//this table is just like any other table
407Function V_BuildTableWindow()
408        Wave/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
409        Wave/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
410        Wave/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
[1023]411//      Wave SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]412        Wave Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
413        Wave CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
414        Wave TotCnts = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
415        Wave CntRate = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
416        Wave Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
417        Wave Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]418//      Wave XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
419//      Wave YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]420
421        Wave/T NumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
422        Wave NumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
423        Wave RotAngle =  $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
424        Wave Temperature = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
425        Wave Field= $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
426        Wave MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"              //added Mar 2008
427        Wave Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"
[1023]428        Wave/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]429        Wave/T Purpose = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]430        Wave Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]431
432// original order, magnetic at the end
433//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog"
434// with numGuides
[1023]435//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog"
[1063]436        Edit Filenames, Labels, DateAndTime,  Intent, Purpose, Group_ID, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog"
[1002]437
438
439        String name="CatVSANSTable"
440        DoWindow/C $name
441        return(0)
442End
443
444//reads header information and puts it in the appropriate waves for display in the table.
445//fname is the full path for opening (and reading) information from the file
446//which alreay was found to exist. sname is the file;vers to be written out,
447//avoiding the need to re-extract it from fname.
448Function V_GetHeaderInfoToWave(fname,sname)
449        String fname,sname
450       
451
452        Variable lastPoint,ctime,detcnt,cntrate
453
454        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
[1023]455//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"
[1002]456        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
457        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
458
[1023]459//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]460        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
461        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
462        Wave GTotCnts = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
463        Wave GCntRate = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
464        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
465        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]466//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
467//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]468        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
469        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
[1023]470//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"
471//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"
[1002]472        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
473        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
474        Wave GField = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
475        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"
476        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"
[1023]477        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]478        Wave/T GPurpose = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]479        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]480
481        lastPoint = numpnts(GLambda)
482               
483        //filename
484        InsertPoints lastPoint,1,GFilenames
485        GFilenames[lastPoint]=sname
486       
[1023]487//      //read the file alphanumeric suffix
[1073]488//      // (DONE) x- this does not exist for VSANS - so is there an equivalent, or delete? ((delete))
[1023]489//      InsertPoints lastPoint,1,GSuffix
490//      GSuffix[lastPoint]="unknown"
[1002]491
492        //read the counting time (integer)
493        InsertPoints lastPoint,1,GCntTime
494        ctime = V_getCount_time(fname)
495        GCntTime[lastPoint]=ctime
496       
497        //read the file creation date (string)
498        InsertPoints lastPoint,1,GDateTime
499        GDateTime[lastPoint]=V_getDataStartTime(fname)
500
501        // read the sample.label text field (string)
502        InsertPoints lastPoint,1,GLabels
503        GLabels[lastPoint]=V_getSampleDescription(fname)
504       
505               
506        //read the reals
507        //detector count and (derived) count rate
508        // TODO -- this is hard-wired for a single detector, which is WRONG
509        detcnt = V_getDet_IntegratedCount(fname,"FL")
510        cntrate = detcnt/ctime
511        InsertPoints lastPoint,1,GTotCnts
512        GTotCnts[lastPoint]=detcnt
513        InsertPoints lastPoint,1,GCntRate
514        GCntRate[lastPoint]=cntrate
515       
516        //Attenuators
[1073]517        // (DONE) x- this is the "number" of the attenuator
[1002]518        InsertPoints lastPoint,1,GNumAttens
[1053]519        GNumAttens[lastPoint]=V_getAtten_number(fname)
[1002]520       
521        //Transmission
522        InsertPoints lastPoint,1,GTransmission
523        GTransmission[lastPoint]=V_getSampleTransmission(fname)
524       
525        //Thickness
526        InsertPoints lastPoint,1,GThickness
527        GThickness[lastPoint]=V_getSampleThickness(fname)
528
[1023]529//      // TODO --  the x and y center have different meaning, since there are multiple panels
530//      // TODO -- remove the hard-wiring
531//      String detStr = "FL"
532//      //XCenter of beam on detector
533//      InsertPoints lastPoint,1,GXCenter
534//      GXCenter[lastPoint]=V_getDet_beam_center_x(fname,detStr)
535//     
536//      // TODO --  the x and y center have different meaning, since there are multiple panels
537//      //YCenter
538//      InsertPoints lastPoint,1,GYCenter
539//      GYCenter[lastPoint]=V_getDet_beam_center_y(fname,detStr)
[1002]540
[1023]541//      // TODO -- SDD has no real meaning - since there are multiple distances to report
542//      //SDD
543//      InsertPoints lastPoint,1,GSDD
544//      GSDD[lastPoint]=V_getDet_ActualDistance(fname,detStr)
[1002]545       
546        //wavelength
547        InsertPoints lastPoint,1,GLambda
548        GLambda[lastPoint]=V_getWavelength(fname)
549       
550        //Rotation Angle
551        InsertPoints lastPoint,1,GRot
552        GRot[lastPoint]=V_getSampleRotationAngle(fname)
553       
554        //Sample Temperature
555        InsertPoints lastPoint,1,GTemp
[1044]556        GTemp[lastPoint]=V_getSampleTemperature(fname)
[1002]557
558        // TODO -- this is not yet implemented
559        //Sample Field
560        InsertPoints lastPoint,1,GField
[1044]561        GField[lastPoint]=-999
[1002]562       
563
[1023]564//      //the run number (not displayed in the table, but carried along)
565//      InsertPoints lastPoint,1,GRunNumber
566//      GRunNumber[lastPoint] = V_GetRunNumFromFile(sname)
567//
568//      // TODO -- the isTransFile utility has not yet been written
569//      // 0 if the file is a scattering  file, 1 (truth) if the file is a transmission file
570//      InsertPoints lastPoint,1,GIsTrans
571//      GIsTrans[lastPoint]  = V_isTransFile(fname)             //returns one if beamstop is "out"
[1002]572       
573        // Monitor Count Rate
574        InsertPoints lastPoint,1,GMCR
575        GMCR[lastPoint]  = V_getMonitorCount(fname)/ctime               //total monitor count / total count time
576
577
578// number of guides and sample position, only for NCNR (a string now)
579        InsertPoints lastPoint,1,GNumGuides
580        GNumGuides[lastPoint]  = V_getNumberOfGuides(fname)
581
582// TODO -- maybe this is better to convert to a text wave?     
583        //Sample Position (== number position in 10CB)
584        InsertPoints lastPoint,1,GPos
585        GPos[lastPoint] = str2num(V_getSamplePosition(fname))
586
[1023]587// Intent (text)
588        InsertPoints lastPoint,1,GIntent
589        GIntent[lastPoint] = V_getReduction_intent(fname)
[1063]590
591// Purpose (text)
592        InsertPoints lastPoint,1,GPurpose
593        GPurpose[lastPoint] = V_getReduction_purpose(fname)
594               
[1023]595// group_id (sample)
596        InsertPoints lastPoint,1,G_ID
[1034]597        G_ID[lastPoint] = V_getSample_groupID(fname)
[1023]598
[1002]599        return(0)
600End
601
602
603
604// just to call the function to generate the panel
[1024]605Proc V_Catalog_Sort()
[1002]606        V_BuildCatSortPanel()
607End
608
609// [davidm] create CAT Sort-Panel
610function V_BuildCatSortPanel()
611
612        // check if CatVSANSTable exists
613        DoWindow CatVSANSTable
614        if (V_flag==0)
615                DoAlert 0,"There is no File Catalog table. Use the File Catalog button to create one."
616                return 0
617        endif
618       
619        // bring CatSortPanel to front
620        DoWindow/F CatSortPanel
621        if (V_flag != 0)
622                return 0
623        endif
624       
625        print "Creating CAT Sort-Panel..."
626               
627        //PauseUpdate
628        NewPanel /W=(600,360,790,730)/K=1 as "CAT - Sort Panel"
629        DoWindow/C CatSortPanel
630        ModifyPanel fixedSize=1, cbRGB = (42919, 53970, 60909)
631       
632        Button SortFilenamesButton,             pos={25, 8},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Filenames"
633        Button SortLabelsButton,                        pos={25,38},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Labels"
634        Button SortDateAndTimeButton,   pos={25,68},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Date and Time"
[1023]635        Button SortIntentButton,                        pos={25,98},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Intent"
[1063]636        Button SortPurposeButton,               pos={25,128},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Purpose"
637        Button SortIDButton,                    pos={25,158},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Group ID"
638        Button SortLambdaButton,                        pos={25,188},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Lambda"
639        Button SortCountTimButton,              pos={25,218},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Count Time"
640        Button SortTotalCountsButton,           pos={25,248},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Total Counts"
641        Button SortCountRateButton,             pos={25,278},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Count Rate"
642        Button SortMonitorCountsButton, pos={25,308},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Monitor Counts"
643        Button SortTransmissionButton,  pos={25,338},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Transmission"
[1002]644
645end
646
647Proc V_CatVSANSTable_SortProc(ctrlName) : ButtonControl // added by [davidm]
648        String ctrlName
649       
650        // check if CatVSANSTable exists
651        DoWindow CatVSANSTable
652        if (V_flag==0)
653                DoAlert 0,"There is no File Catalog table. Use the File Catalog button to create one."
654                return
655        endif
656               
657        // have to use function
658        V_CatVSANSTable_SortFunction(ctrlName)
659       
660end
661
662function V_CatVSANSTable_SortFunction(ctrlName) // added by [davidm]
663        String ctrlName
664
665        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames"
[1023]666//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"
[1002]667        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels"
668        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime"
[1023]669//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"
[1002]670        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"
671        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"
672        Wave GTotCnts = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts"
673        Wave GCntRate = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate"
674        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"
675        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"
[1023]676//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"
677//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"
[1002]678        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"
679        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens"
[1023]680//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"
681//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"
[1002]682        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle"
683        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature"
684        Wave GField = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Field"
685        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"
686        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"
[1023]687        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent"
[1063]688        Wave/T GPurpose = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose"
[1023]689        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID"
[1002]690
691       
692        // take out the "not-RAW-Files"
693        Variable fileCount = numpnts(GFilenames)
694        Variable rawCount = numpnts(GLabels)
695        Variable notRAWcount = fileCount - rawCount
696       
697        if (notRAWcount > 0)
698                Make/T/O/N=(notRAWcount) notRAWlist
699                notRAWlist[0, notRAWcount-1] = GFilenames[p+rawCount]
700                DeletePoints rawCount, notRAWcount, GFilenames
701        endif
702       
703        strswitch (ctrlName)
704       
705                case "SortFilenamesButton":
[1023]706//                      Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]707                        Sort GFilenames,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1002]708                        break
709                       
710                case "SortLabelsButton":
[1023]711//                      Sort GLabels, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]712                        Sort GLabels,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1002]713                        break
714                       
715                case "SortDateAndTimeButton":
[1023]716//                      Sort GDateTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]717                        Sort GDateTime,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]718
[1002]719                        break
720                       
[1023]721                case "SortIntentButton":
[1063]722                        Sort GIntent,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1002]723                        break
724                       
[1023]725                case "SortIDButton":
[1063]726                        Sort G_ID,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1002]727                        break
728                       
729                case "SortLambdaButton":
[1023]730//                      Sort GLambda, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]731                        Sort GLambda,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]732
[1002]733                        break
734                       
735                case "SortCountTimButton":
[1023]736//                      Sort GCntTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]737                        Sort GCntTime,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]738
[1002]739                        break
740                       
741                case "SortTotalCountsButton":
[1023]742//                      Sort GTotCnts, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]743                        Sort GTotCnts,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]744
[1002]745                        break
746                       
747                case "SortCountRateButton":
[1023]748//                      Sort GCntRate, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]749                        Sort GCntRate,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]750
[1002]751                        break
752                       
753                case "SortMonitorCountsButton":
754                        break
755                       
756                case "SortTransmissionButton":
[1023]757//                      Sort GTransmission, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]758                        Sort GTransmission,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]759
[1002]760                        break
761                       
[1063]762                case "SortPurposeButton":
[1023]763//                      Sort GThickness, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR
[1063]764                        Sort GPurpose,  GPurpose, GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID
[1023]765
[1002]766                        break
767       
768        endswitch
769       
770        // insert the "not-RAW-Files" again
771        if (notRAWcount > 0)
772                InsertPoints rawCount, notRAWcount, GFilenames
773                GFilenames[rawCount, fileCount-1] = notRAWlist[p-rawCount]
774        endif
[1063]775end
776
Note: See TracBrowser for help on using the repository browser.