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

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

changing back detector specifications in VCALC and VSANS to be 150,150 w/1mm pixels rather than 320.

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