source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_HDF5_VSANS_Utils.ipf @ 986

Last change on this file since 986 was 986, checked in by srkline, 7 years ago

fixing issues with QUOKKA reduction procedures that generate errors in Igor 7

updated the QKK_NSORT file to match the new 4-file NSORT. this was a complete, direct copy of the file as there were no Ansto -specific bits.

File size: 19.8 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2
3//
4// This file has utility procedures to be able to read/write
5// test HDF5 (from Igor) for SANS and VSANS in Nexus format
6//
7// It is predominantly to be able to WRITE a full Nexus file from Igor
8// -- this is only necessary to be able to write out "fake" VSANS files from VCALC
9//    since I need a "template" of the Nexus folder structure to start from and fill in
10//
11// It doesn't reproduce the NICE logs, but will leave a spece for them if
12// it is read in and is part of the xref.
13//
14// It may be easier to hard-wire my own folder definition (NewDataFolder)
15// that is MY Nexus file to write out and use that as the base case
16// rather than rely on Pete's code, which is terribly slow for writing.
17// Attributes are the issue, but it may be unimportant if they are missing.
18//
19
20
21
22//
23// There's an odd sequence of steps that need to be done to use HDFGateway
24// to most easily write out attributes, and be able to read then back in.
25// Rather awkward, but it works without me needing to go nuts with an atomistic
26// understanding of HDF5. This is necessary for me to be able to write out
27// Nexus files, which is important both for testing, and for simulation.
28//
29// This is done as a set of macros that need to be applied in a specific sequence
30// in order to be able to generate HDF5___xref
31// Ideally, the HDF5___xref wave can be saved/imported to make proper saving possible
32// once the "tree" is finalized.
33//
34//
35// The basic saving routines are here, just as Proc rather than Macro menu clutter
36//
37
38
39// Next... think of all of R/W access needed
40//
41// the simple read/write works...
42// linear_data does not seem to need to be transposed at all
43//
44//  -- this seems too easy. what am I doing wrong? Is something getting garbled when I
45// write back any single values back to the file
46//
47// -- try a string value next
48// -- then start to write the generic get/write functions
49//
50
51//
52// do I ditch the RealsRead/IntegersRead/TextRead? It makes little sense now.
53// maybe copy a "dataInfo" folder/subfolders. can't keep them all (bloat)
54// but then what about multiple files added together?
55//
56
57Menu "VSANS"
58        SubMenu "Nexus File Testing"
59                "Fill_Nexus_V_Template"
60                "Save_Nexus_V_Template"
61                "Load_Nexus_V_Template"
62                "-"
63                "IgorOnly_Setup_VSANS_Struct"
64                "IgorOnly_Save_VSANS_Nexus"
65                "IgorOnly_Setup_SANS_Struct"
66                "IgorOnly_Save_SANS_Struct"
67                "Setup_VSANS_DIV_Struct"
68                "Save_VSANS_DIV_Nexus"
69                "-"
70                "Read_Nexus with attributes",Read_Nexus_Xref()          //this will read with attributes
71                "Write_Nexus with attributes",Write_Nexus_Xref()                                //this will write out with attributes if read in by Read_Nexus_Xref
72        End
73End
74
75
76Proc Load_Nexus_V_Template()
77        H_HDF5Gate_Read_Raw("")
78        String tmpStr=root:file_name  //SRK - so I can get the file name that was loaded
79       
80// this is the folder name
81        String base_name = StringFromList(0,File_Name,".")
82        RenameDataFolder $("root:"+base_name), V_Nexus_Template
83End
84
85
86Proc Fill_Nexus_V_Template()
87        H_Fill_VSANS_Template_wSim()
88End
89
90
91Proc Save_Nexus_V_Template()
92        H_HDF5Gate_Write_Raw("root:V_Nexus_Template:","")
93End
94
95
96
97
98
99
100
101
102
103
104
105
106
107/////////////////////////////
108
109/////////////below is largely depricated, ugly dance to be able to "fake" a file from Igor
110// which was not complete anyways.
111
112
113
114Proc IgorOnly_Setup_VSANS_Struct()
115
116        // lays out the tree and fills with dummy values
117        H_Setup_VSANS_Structure()
118       
119        // writes in the attributes
120        H_Fill_VSANS_Attributes()
121       
122        // fill in with VCALC simulation bits
123        H_Fill_VSANS_wSim()
124       
125End
126
127Proc IgorOnly_Save_VSANS_Nexus(fileName)
128        String fileName="Test_VSANS_file"
129
130        // save as HDF5 (no attributes saved yet)
131        Save_VSANS_file("root:VSANS_file", fileName+".h5")
132       
133        // read in a data file using the gateway-- reads from the home path
134        H_HDF5Gate_Read_Raw(fileName+".h5")
135       
136        // after reading in a "partial" file using the gateway (to generate the xref)
137        // Save the xref to disk (for later use)
138        Save_HDF5___xref("root:"+fileName,"HDF5___xref")
139       
140        // after you've generated the HDF5___xref, load it in and copy it
141        // to the necessary folder location.
142        Copy_HDF5___xref("root:VSANS_file", "HDF5___xref")
143       
144        // writes out the contents of a data folder using the gateway
145        H_HDF5Gate_Write_Raw("root:VSANS_file", fileName+".h5")
146
147        // re-load the data file using the gateway-- reads from the home path
148        // now with attributes
149        H_HDF5Gate_Read_Raw(fileName+".h5")
150       
151End
152
153
154
155Proc IgorOnly_Setup_SANS_Struct()
156
157        // lays out the tree and fills with dummy values
158        H_Setup_SANS_Structure()
159       
160        // writes in the attributes
161        H_Fill_SANS_Attributes()
162       
163        // fill in with VCALC simulation bits
164        H_Fill_SANS_wSim()
165
166End
167
168Proc IgorOnly_Save_SANS_Nexus(fileName)
169        String fileName="Test_SANS_file"
170       
171        // save as HDF5 (no attributes saved yet) (save_VSANS is actually generic HDF...)
172        Save_VSANS_file("root:SANS_file", fileName+".h5")
173       
174        // read in a data file using the gateway-- reads from the home path
175        H_HDF5Gate_Read_Raw(fileName+".h5")
176       
177        // after reading in a "partial" file using the gateway (to generate the xref)
178        // Save the xref to disk (for later use)
179        Save_HDF5___xref("root:"+fileName,"HDF5___xref")
180       
181        // after you've generated the HDF5___xref, load it in and copy it
182        // to the necessary folder location.
183        Copy_HDF5___xref("root:SANS_file", "HDF5___xref")
184       
185        // writes out the contents of a data folder using the gateway
186        H_HDF5Gate_Write_Raw("root:SANS_file", fileName+".h5")
187
188        // re-load the data file using the gateway-- reads from the home path
189        // now with attributes
190        H_HDF5Gate_Read_Raw(fileName+".h5")
191
192
193End
194
195
196
197// TODO
198// currently, there are no dummy fill values or attributes for the fake DIV file
199//
200Proc Setup_VSANS_DIV_Struct()
201
202        // lays out the tree and fills with dummy values
203        H_Setup_VSANS_DIV_Structure()
204       
205        // writes in the attributes
206//      H_Fill_VSANS_Attributes()
207       
208        // fill in with VCALC simulation bits
209//      H_Fill_VSANS_wSim()
210       
211End
212
213Proc Save_VSANS_DIV_Nexus(fileName)
214        String fileName="Test_VSANS_DIV_file"
215
216        // save as HDF5 (no attributes saved yet)
217        Save_VSANS_file("root:VSANS_DIV_file", fileName+".h5")
218       
219        // read in a data file using the gateway-- reads from the home path
220        H_HDF5Gate_Read_Raw(fileName+".h5")
221       
222        // after reading in a "partial" file using the gateway (to generate the xref)
223        // Save the xref to disk (for later use)
224        Save_HDF5___xref("root:"+fileName,"HDF5___xref")
225       
226        // after you've generated the HDF5___xref, load it in and copy it
227        // to the necessary folder location.
228        Copy_HDF5___xref("root:VSANS_DIV_file", "HDF5___xref")
229       
230        // writes out the contents of a data folder using the gateway
231        H_HDF5Gate_Write_Raw("root:VSANS_DIV_file", fileName+".h5")
232
233        // re-load the data file using the gateway-- reads from the home path
234        // now with attributes
235        H_HDF5Gate_Read_Raw(fileName+".h5")
236       
237End
238
239////////////// fake DIV file tests
240//
241//
242//      Make/O/T/N=1    file_name       = "VSANS_DIV_test.h5"
243//
244// simple generation of a fake div file. for sans, nothing other than the creation date was written to the
245// file header. nothing more is needed (possibly)
246//
247// TODO -- I want to re-visit the propagation of errors in the DIV file. No errors are ever calculated/saved
248//   during the generation of the file, but there's no reason it couldn't. the idea is that the plex
249//   is counted so long that the errors are insignificant compared to the data errors, but that may not
250//   always be the case. A bit of math may prove this. or not. Plus, the situation for VSANS may be different.
251//
252//
253// TODO -- make the number of pixels GLOBAL
254// TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the
255//      9 data sets to become the DIV file contents. More complexity here than for the simple SANS case.
256//
257Proc H_Setup_VSANS_DIV_Structure()
258       
259        NewDataFolder/O/S root:VSANS_DIV_file           
260
261        NewDataFolder/O/S root:VSANS_DIV_file:entry     
262                Make/O/T/N=1    title   = "This is a fake DIV file for VSANS"
263                Make/O/T/N=1    start_date      = "2015-02-28T08:15:30-5:00"
264                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument         
265                        Make/O/T/N=1    name    = "NG3_VSANS"
266                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_B       
267                        Make/O/D/N=(150,150)    data    = abs(gnoise(10))
268                        Make/O/D/N=(150,150)    linear_data_error       = 0.01*abs(gnoise(10))
269                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MR             
270                        Make/O/D/N=(48,128)     data    = abs(gnoise(10))
271                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(10))
272                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_ML             
273                        Make/O/D/N=(48,128)     data    = abs(gnoise(10))
274                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(10))
275                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MT             
276                        Make/O/D/N=(128,48)     data    = abs(gnoise(10))
277                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(10))
278                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MB             
279                        Make/O/D/N=(128,48)     data    = abs(gnoise(10))
280                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(10))
281                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FR             
282                        Make/O/D/N=(48,128)     data    = abs(gnoise(10))
283                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(10))
284                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FL             
285                        Make/O/D/N=(48,128)     data    = abs(gnoise(10))
286                        Make/O/D/N=(48,128)     linear_data_error       = 0.01*abs(gnoise(10))
287                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FT             
288                        Make/O/D/N=(128,48)     data    = abs(gnoise(10))
289                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(10))
290                NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FB             
291                        Make/O/D/N=(128,48)     data    = abs(gnoise(10))
292                        Make/O/D/N=(128,48)     linear_data_error       = 0.01*abs(gnoise(10))
293                       
294        SetDataFolder root:
295
296End
297
298
299
300
301
302
303
304
305
306
307
308
309
310//
311// saves a specified folder, with a given filename.
312// saves to the home path
313//
314Proc Save_VSANS_file(dfPath, filename)
315        String dfPath   ="root:VSANS_file"              // e.g., "root:FolderA" or ":"
316        String filename = "Test_VSANS_file.h5"
317       
318        H_NXSANS_SaveGroupAsHDF5(dfPath, filename)
319End
320
321
322//     
323// this is my procedure to save the folders to HDF5, once I've filled the folder tree
324//
325// this does NOT save attributes, but gets the folder structure correct
326//
327Function H_NXSANS_SaveGroupAsHDF5(dfPath, filename)
328        String dfPath   // e.g., "root:FolderA" or ":"
329        String filename
330
331        Variable result = 0     // 0 means no error
332       
333        Variable fileID
334        HDF5CreateFile/P=home /O /Z fileID as filename
335        if (V_flag != 0)
336                Print "HDF5CreateFile failed"
337                return -1
338        endif
339
340        HDF5SaveGroup /IGOR=0 /O /R /Z $dfPath, fileID, "."
341//      HDF5SaveGroup /O /R /Z $dfPath, fileID, "."
342        if (V_flag != 0)
343                Print "HDF5SaveGroup failed"
344                result = -1
345        endif
346       
347        HDF5CloseFile fileID
348
349        return result
350End
351
352// passing null file string presents a dialog
353// these two procedures will use the full Xrefs, so they can write out full
354// files. They are, however, slow
355Proc Read_Nexus_Xref()
356        H_HDF5Gate_Read_Raw("")
357End
358
359Proc Write_Nexus_Xref()
360        H_HDF5Gate_Write_Raw()
361End
362
363//
364// writes out the contents of a data folder using the gateway
365// -- the HDF5___xref wave must be present at the top level for it to
366//    write out anything.
367//
368Proc H_HDF5Gate_Write_Raw(dfPath,filename)
369        String dfPath   = "root:"       // e.g., "root:FolderA" or ":"
370        String filename = "Test_VSANS_file.h5"
371//      Prompt dfPath, "Data Folder",popup,H_GetAList(4)       
372//      Prompt fileName, "File name"
373       
374//      DoPrompt "Folder and file to write", dfPath,fileName
375        // Check our work so far.
376        // If something prints, there was an error above.
377//      print H5GW_ValidateFolder(dfPath)
378
379// H5GW_WriteHDF5 calls the validate function, so no need to call it before
380        print H5GW_WriteHDF5(dfPath, filename)
381       
382        SetDataFolder root:
383End
384
385//
386// read in a data file using the gateway
387//
388// reads from the home path
389//
390Proc H_HDF5Gate_Read_Raw(file)
391        String file
392       
393//      NewDataFolder/O/S root:newdata
394        Print H5GW_ReadHDF5("", file)   // reads into current folder
395        SetDataFolder root:
396End
397
398
399
400// this is in PlotUtils, but duplicated here
401// utility used in the "PlotSmeared...() macros to get a list of data folders
402//
403//1:    Waves.
404//2:    Numeric variables.
405//3:    String variables.
406//4:    Data folders.
407Function/S H_GetAList(type)
408        Variable type
409       
410        SetDataFolder root:
411       
412        String objName,str=""
413        Variable index = 0
414        do
415                objName = GetIndexedObjName(":", type, index)
416                if (strlen(objName) == 0)
417                        break
418                endif
419                //Print objName
420                str += objName + ";"
421                index += 1
422        while(1)
423       
424        // remove myGlobals, Packages, etc. from the folder list
425        if(type==4)
426                str = RemoveFromList("myGlobals", str , ";" )
427                str = RemoveFromList("Packages", str, ";")
428        endif
429       
430        return(str)
431End
432
433//
434// after reading in a "partial" file using the gateway (to generate the xref)
435// Save the xref to disk (for later use)
436//
437Proc Save_HDF5___xref(dfPath, filename)
438        String dfPath   ="root:VSANS_file"              // e.g., "root:FolderA" or ":"
439        String filename = "HDF5___xref"
440
441        Save/T/P=home $(dfPath+":HDF5___xref") as "HDF5___xref.itx"
442
443//      Copy_HDF5___xref(dfPath, filename)
444       
445        SetDataFolder root:
446End
447
448//
449// after you've generated the HDF5___xref, load it in and copy it to
450// the necessary folder location.
451// - then all is set to *really* write out the file correctly, including the attributes
452//
453Proc Copy_HDF5___xref(dfPath, filename)
454        String dfPath   ="root:VSANS_file"              // e.g., "root:FolderA" or ":"
455        String filename = "HDF5___xref"
456
457        if(exists(filename) != 1)
458                //load it in   
459                LoadWave/T/P=home/O "HDF5___xref.itx"
460        endif
461       
462        Duplicate/O HDF5___xref, $(dfPath+":HDF5___xref")
463       
464        SetDataFolder root:
465End
466
467
468
469//////// testing procedures, may be of use, maybe not //////////////
470
471
472//////// Two procedures that test out Pete Jemain's HDF5Gateway
473//
474// This works fine, but it may not be terribly compatible with the way NICE will eventually
475// write out the data files. I'll have very little control over that and I'll need to cobble together
476// a bunch of fixes to cover up their mistakes.
477//
478// Using Nick Hauser's code as a starting point may be a lot more painful, but more flexible in the end.
479//
480// I'm completely baffled about what to do with attributes. Are they needed, is this the best way to deal
481// with them, do I care about reading them in, and if I do, why?
482//
483Proc H_HDF5Gate_WriteTest()
484
485        // create the folder structure
486        NewDataFolder/O/S root:mydata
487        NewDataFolder/O sasentry
488        NewDataFolder/O :sasentry:sasdata
489
490        // create the waves
491        Make/O :sasentry:sasdata:I0
492        Make/O :sasentry:sasdata:Q0
493
494        Make/O/N=0 Igor___folder_attributes
495        Make/O/N=0 :sasentry:Igor___folder_attributes
496        Make/O/N=0 :sasentry:sasdata:Igor___folder_attributes
497
498        // create the attributes
499        Note/K Igor___folder_attributes, "producer=IgorPro\rNX_class=NXroot"
500        Note/K :sasentry:Igor___folder_attributes, "NX_class=NXentry"
501        Note/K :sasentry:sasdata:Igor___folder_attributes, "NX_class=NXdata"
502        Note/K :sasentry:sasdata:I0, "units=1/cm\rsignal=1\rtitle=reduced intensity"
503        Note/K :sasentry:sasdata:Q0, "units=1/A\rtitle=|scattering vector|"
504
505        // create the cross-reference mapping
506        Make/O/T/N=(5,2) HDF5___xref
507        Edit/K=0 'HDF5___xref';DelayUpdate
508        HDF5___xref[0][1] = ":"
509        HDF5___xref[1][1] = ":sasentry"
510        HDF5___xref[2][1] = ":sasentry:sasdata"
511        HDF5___xref[3][1] = ":sasentry:sasdata:I0"
512        HDF5___xref[4][1] = ":sasentry:sasdata:Q0"
513        HDF5___xref[0][0] = "/"
514        HDF5___xref[1][0] = "/sasentry"
515        HDF5___xref[2][0] = "/sasentry/sasdata"
516        HDF5___xref[3][0] = "/sasentry/sasdata/I"
517        HDF5___xref[4][0] = "/sasentry/sasdata/Q"
518
519        // Check our work so far.
520        // If something prints, there was an error above.
521        print H5GW_ValidateFolder("root:mydata")
522
523        // set I0 and Q0 to your data
524
525        print H5GW_WriteHDF5("root:mydata", "mydata.h5")
526       
527        SetDataFolder root:
528End
529
530
531//
532// given a filename of a SANS data filename of the form
533// name.anything
534// returns the name as a string without the ".fbdfasga" extension
535//
536// returns the input string if a "." can't be found (maybe it wasn't there)
537//
538Function/S H_RemoveDotExtension(item)
539        String item
540        String invalid = item   //
541        Variable num=-1
542       
543        //find the "dot"
544        String runStr=""
545        Variable pos = strsearch(item,".",0)
546        if(pos == -1)
547                //"dot" not found
548                return (invalid)
549        else
550                //found, get all of the characters preceeding it
551                runStr = item[0,pos-1]
552                return (runStr)
553        Endif
554End
555
556
557//
558// Writing attributes to a group and to a dataset.
559// example from the WM documentation for HDF5SaveData
560//
561Function DemoAttributes(w)
562        Wave w
563
564        Variable result = 0     // 0 means no error
565       
566        // Create file
567        Variable fileID
568        HDF5CreateFile/P=home /O /Z fileID as "Test.h5"
569        if (V_flag != 0)
570                Print "HDF5CreateFile failed"
571                return -1
572        endif
573
574        // Write an attribute to the root group
575        Make /FREE /T /N=1 groupAttribute = "This is a group attribute"
576        HDF5SaveData /A="GroupAttribute" groupAttribute, fileID, "/"
577       
578        // Save wave as dataset
579        HDF5SaveData /O /Z w, fileID    // Uses wave name as dataset name
580        if (V_flag != 0)
581                Print "HDF5SaveData failed"
582                result = -1
583        endif
584
585        // Write an attribute to the dataset
586        Make /FREE /T /N=1 datasetAttribute = "This is a dataset attribute"
587        String datasetName = NameOfWave(w)
588        HDF5SaveData /A="DatasetAttribute" datasetAttribute, fileID, datasetName
589
590        HDF5CloseFile fileID
591       
592        return result
593End     // The attribute waves are automatically killed since they are free waves
594
595
596
597//     
598//Function H_Test_HDFWriteTrans(fname,val)
599//      String fname
600//      Variable val
601//     
602//     
603//      String str
604//      PathInfo home
605//      str = S_path
606//     
607//      H_WriteTransmissionToHeader(str+fname,val)
608//     
609//      return(0)
610//End
611//
612//Function H_WriteTransmissionToHeader(fname,trans)
613//      String fname
614//      Variable trans
615//     
616//      Make/O/D/N=1 wTmpWrite
617//      String groupName = "/Sample"    //      /Run1/Sample becomes groupName /Run1/Run1/Sample
618//      String varName = "TRNS"
619//      wTmpWrite[0] = trans //
620//
621//      variable err
622//      err = HDFWrite_Wave(fname, groupName, varName, wTmpWrite)
623//      KillWaves wTmpWrite
624//     
625//      //err not handled here
626//             
627//      return(0)
628//End
629
630
631
632Function H_Test_ListAttributes(fname,groupName)
633        String fname,groupName
634        Variable trans
635       
636//      Make/O/D/N=1 wTmpWrite
637//      String groupName = "/Sample"    //      /Run1/Sample becomes groupName /Run1/Run1/Sample
638//      String varName = "TRNS"
639//      wTmpWrite[0] = trans //
640        String str
641        PathInfo home
642        str = S_path
643       
644        variable err
645        err = H_HDF_ListAttributes(str+fname, groupName)
646       
647        //err not handled here
648               
649        return(0)
650End
651
652Function H_HDF_ListAttributes(fname, groupName)
653        String fname, groupName
654       
655        variable err=0, fileID,groupID
656        String cDF = getDataFolder(1), temp
657        String NXentry_name, attrValue=""
658       
659        STRUCT HDF5DataInfo di  // Defined in HDF5 Browser.ipf.
660        InitHDF5DataInfo(di)    // Initialize structure.
661       
662        try     
663                HDF5OpenFile /Z fileID  as fname  //open file read-write
664                if(!fileID)
665                        err = 1
666                        abort "HDF5 file does not exist"
667                endif
668               
669                HDF5OpenGroup /Z fileID , groupName, groupID
670
671        //      (QUOKKA) !! At the moment, there is no entry for sample thickness in our data file
672        //      therefore create new HDF5 group to enable write / patch command
673        //      comment out the following group creation once thickness appears in revised file
674       
675                if(!groupID)
676                        HDF5CreateGroup /Z fileID, groupName, groupID
677                        //err = 1
678                        //abort "HDF5 group does not exist"
679                else
680
681//                      HDF5AttributeInfo(fileID, "/", 1, "file_name", 0, di)
682                        HDF5AttributeInfo(fileID, "/", 1, "NeXus_version", 0, di)
683                        Print di
684
685//                      see the HDF5 Browser  for how to get the actual <value> of the attribute. See GetPreviewString in
686//        or in FillGroupAttributesList or in FillDatasetAttributesList (from FillLists)
687//                      it seems to be ridiculously complex to get such a simple bit of information - the HDF5BrowserData STRUCT
688//                      needs to be filled first. Ugh.
689                        attrValue = GetPreviewString(fileID, 1, di, "/entry", "cucumber")
690                        Print "attrValue = ",attrValue
691                       
692                       
693                        //get attributes and save them
694                        HDF5ListAttributes/TYPE=1 /Z fileID, groupName          //TYPE=1 means that we're referencing a group, not a dataset
695                        Print "S_HDF5ListAttributes = ", S_HDF5ListAttributes
696                       
697                        // passing the groupID works too, then the group name is not needed                     
698                        HDF5ListAttributes/TYPE=1 /Z groupID, "."               //TYPE=1 means that we're referencing a group, not a dataset
699                        Print "S_HDF5ListAttributes = ", S_HDF5ListAttributes
700                endif
701        catch
702
703                // catch any aborts here
704               
705        endtry
706       
707        if(groupID)
708                HDF5CloseGroup /Z groupID
709        endif
710       
711        if(fileID)
712                HDF5CloseFile /Z fileID
713        endif
714
715        setDataFolder $cDF
716        return err
717end
718
719
720/////////////// end of the testing procedures ////////////////
Note: See TracBrowser for help on using the repository browser.