HDF5 Issues When Trying to Open and load it through the program

I was planning to open an HDF5 File which had two groups and load there data whatever format they are available.

I want to use it to automate the task of the HDF5 Browser. But I am Facing the basic HDF5LoadGroup, HDF5LoadData Problems. 

From experience I can say that these operations do work ;)

Could you elaborate or show what you tried already? If you are just starting with Igor it is a good idea to take the guided tour.

In reply to by thomas_braun

thomas_braun wrote:

From experience I can say that these operations do work ;)

Could you elaborate or show what you tried already? If you are just starting with Igor it is a good idea to take the guided tour.

#pragma rt=3

#pragma versionno=0.05

Menu "Macros"

 "GraphCoordination",GraphCoordination()

End

Function GraphCoordination()

    Print"Successfully called GraphCoordination Function"

    Variable FileID

    HDF5OpenFile /I/Z FileID as ""

    String Q,File_Path

    Q= S_fileName

    File_Path= S_Path

    Print Q

   Print File_Path

   String fileLocation

   fileLocation=File_Path

   if(V_Flag==0)

       Print "The File is successfully Loaded "

    Endif

HDF5ListGroup /F/R/Type=1/Z FileID,"/"

PrintV_Flag

String GroupList

GroupList= S_HDF5ListGroup

HDF5OpenGroup /Z fileLocation,FileID

print V_Flag     

End

this is what I had done.

 

In reply to by coltblaze

That is a good start already. I've fixed the HDF5OpenGroup call and now have

 

Function GraphCoordination()

    Print"Successfully called GraphCoordination Function"

    Variable FileID

    HDF5OpenFile /I/Z FileID as ""

    String Q,File_Path

    Q= S_fileName

    File_Path= S_Path

    Print Q

    Print File_Path

    String fileLocation

    fileLocation=File_Path

    if(V_Flag==0)
        Print "The File is successfully Loaded."
    else
        printf "Error %d on file load\r", v_flag
        return NaN
    Endif

    HDF5ListGroup /F/R/Type=1/Z FileID,"/"

    Print V_Flag

    String GroupList

    GroupList= S_HDF5ListGroup
   
    variable groupID

    HDF5OpenGroup /Z FileID, "/", groupID

    print V_Flag
End

 

so now you just need to add a HDF5LoadData call.

sir my LoadData is also not working

HDF5LoadData /IGOR=-1/O/Q/T=1/TYPE=1/VAR=0/Z GroupID,S_HDF5ListGroup
Print V_Flag

this is what I had written next in the above code.

 

I do not know why you are addressing me directly in this post where I have not commented, but OK. I am not sure you realize what for a huge standard HDF5 is. It's almost it's own file system. Nobody can guess your specific file contents, arrangement in groups or data types. At least now you have linked a screenshot of the HDF browser, so we now know a bit what we are talking about.

You are appending all kinds of optional flags to the HDF5LoadData command, which are probably not really relevant to your problem (but may not cause an error either). Have you read the documentation for HDF5LoadData? I assume just passing S_HDF5ListGroup is the culprit here, since you seem to have 2 groups and a string list is not in the right format anyway to be passed as the name string for the group to load (even if only for the semicolon at the end). You need to pass the correct name of the group you want to load here. What is the content of S_HDF5ListGroup list at the time of calling?

Here is a copy of the relevant part of the documentation for HDF5LoadData:

nameStr is a string containing the name of the dataset to be loaded or, if /A=attributeNameStr  is supplied, the name of the group, dataset or named datatype which owns the attribute. When loading an attribute attached to a group or named datatype, you must use the /TYPE flag to specify the type of object that nameStr refers to.

nameStr  can contain a simple name ("RocketData"), a full path ("/GroupA/RocketData") or a partial path relative to locationID ("GroupA/RocketData").

I guess your command needs to be more along the lines of (already some time has passed since I last used this stuff so I might be off):

HDF5LoadData GroupID, "Image Data"

Another problem could be that your HDF5OpenGroup command is already off. You could also try yourself to alternatively use HDF5LoadGroup instead of HDF5OpenGroup+HDF5LoadData. I hope that helps a bit.

P.S.: I mean no offense, but please, please try to describe precisely what you want to achieve (not "I want to load data", but "I want to load content X of file type Y, the data is arranged in the following format Z, and I want to get this part of it with the command ABC...") and where something is not working, what you have tried and what exact errors you get for your particular Igor version and operating system (which?). Otherwise you cannot expect anybody to be able to help you quickly and accurately.

I would also like to add that it is not reasonable to expect that we have all read other threads you have posted. If we have read them, we don't necessarily connect them together. If you feel that another thread is relevant to the present topic, you should provide at least a link to the other thread. We are not magical, we cannot read minds :)