comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: No HDF5 info type functions?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: No HDF5 info type functions? [message #44602] Tue, 05 July 2005 10:30 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
ellips@yahoo.com wrote:
> I'm trying to find the names and numbers of HDF5 groups/datasets
> in IDL. This was done for HDF 4 files with functions like
> hdf_sd_fileinfo. I don't see any equivalent types of functions
> for the HDF5 interface. It seems you need to know the group/dataset
> names before you can access them. I want to be very general and
> rely on the file contents to tell me what's in the file.
>
> I'd like to query the HDF5 file for the number of top level groups,
> loop through them to get their names and go on down the tree.
> How do you get the name of the top level group?

Note: everything I say below is based upon reading the built-in IDL
documentation and HDF5 documentation from
<http://hdf.ncsa.uiuc.edu/HDF5/doc/>. None of it represents actual
experience with using those functions, as I have no HDF5 files to test
with, nor time to perform the tests.

HDF5 groups have a naming structure similar to that of UNIX file
systems. Therefore, the top level group is always named '/'. All of the
other group names can be obtained from that one, by iterating over the
group members, and if a group member is itself a group, recursively
iterating over it's members.

Once you've opened a given group, the number of members of that group
can be found by using H5G_Get_Nmembers(). That will allow you to
iterate over the members by number to get their names by calling
H5G_Get_Member_Name(). Use the member name to determine the object type
with H5G_Get_Objinfo(). If the object type is itself a group,
recursively iterate over the members of that group. If the object type
is a dataset, Call H5D_Get_Type() to determine it's data type.

> The IDL docs show many functions taking loc_id to be a file OR group id.

When providing a file ID, the group name must be an absolute name, such
as /Data/Cdata. However, if you provide a group ID, you can use a name
relative to that group. For instance, you can open /Data/Cdata using
the groupID for "/Data", and a relative group name of "Cdata".
[Message index]
 
Read Message
Read Message
Previous Topic: DICOM updater
Next Topic: Fortran IDL interfaces

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:38:48 PDT 2025

Total time taken to generate the page: 0.00425 seconds