how to use H5File/H5Group?

I am having some real difficulties using H5File and H5Group in Java, I
guess because some of the class documentation doesn't make sense to me,
& was wondering if any of you could provide guidance.

I have a very simple example. I want to:

1) create an HDF5 file (e.g. foo.hdf5)
2) create a group with a specified path in the HDF5 file (e.g.
"/bar/baz/quux")
3) close the group
4) close the file
5) open the HDF5 file
6) open the group with the specified path ("/bar/baz/quux")

I am not getting very far here. Why isn't H5File.createInstance() a
static method? Do I just do

   H5File f = new H5File().createInstance("/my/path/foo.hdf5",
H5File.FILE_CREATE_DELETE);

to create a group with a given path, what's the easiest way to do it?
createGroup() seems to only like non-hierarchical paths, and what I want
to do is use an existing group if one already exists.

--Jason

···

_________________________________________________________________________________________

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

I am having some real difficulties using H5File and H5Group in Java, I
guess because some of the class documentation doesn't make sense to me,
& was wondering if any of you could provide guidance.

I have a very simple example. I want to:

1) create an HDF5 file (e.g. foo.hdf5)
2) create a group with a specified path in the HDF5 file (e.g.
"/bar/baz/quux")
3) close the group
4) close the file
5) open the HDF5 file
6) open the group with the specified path ("/bar/baz/quux")

I am not getting very far here. Why isn't H5File.createInstance() a
static method? Do I just do

H5File f = new H5File().createInstance("/my/path/foo.hdf5",
H5File.FILE_CREATE_DELETE);

to create a group with a given path, what's the easiest way to do it?
createGroup() seems to only like non-hierarchical paths, and what I want
to do is use an existing group if one already exists.

--Jason

Hi Jason, Did you see all the examples at
http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.html

···

On Tue, Jul 7, 2009 at 2:58 PM, Jason Sachs<jsachs@dekaresearch.com> wrote:

_________________________________________________________________________________________

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Those examples seem to use the raw JHI5 layer, which is in practice an
one-to-one mapping to native functions and, as such, quite "non-Javaish" to
use. There's also a "HDF Object Package" which is definitely easier to use,
although less flexible. Some examples for it can be found here:
http://www.hdfgroup.org/hdf-java-html/hdf-object/use.html

Best Regards,
Joonas

···

2009/7/9 Peter Alexander <vel.accel@gmail.com>

On Tue, Jul 7, 2009 at 2:58 PM, Jason Sachs<jsachs@dekaresearch.com> > wrote:
> I am having some real difficulties using H5File and H5Group in Java, I
> guess because some of the class documentation doesn't make sense to me,
> & was wondering if any of you could provide guidance.
>
> I have a very simple example. I want to:
>
> 1) create an HDF5 file (e.g. foo.hdf5)
> 2) create a group with a specified path in the HDF5 file (e.g.
> "/bar/baz/quux")
> 3) close the group
> 4) close the file
> 5) open the HDF5 file
> 6) open the group with the specified path ("/bar/baz/quux")
>
> I am not getting very far here. Why isn't H5File.createInstance() a
> static method? Do I just do
>
> H5File f = new H5File().createInstance("/my/path/foo.hdf5",
> H5File.FILE_CREATE_DELETE);
>
> to create a group with a given path, what's the easiest way to do it?
> createGroup() seems to only like non-hierarchical paths, and what I want
> to do is use an existing group if one already exists.
>
> --Jason
>
>

Hi Jason, Did you see all the examples at
http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.html

> Hi Jason, Did you see all the examples at
>

http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.html

>

<http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.htm

Those examples seem to use the raw JHI5 layer, which is in
practice an one-to-one mapping to native functions and, as such,
quite "non-Javaish" to use. There's also a "HDF Object Package"
which is definitely easier to use, although less flexible. Some
examples for it can be found here:
http://www.hdfgroup.org/hdf-java-html/hdf-object/use.html

Best Regards,
Joonas

Thanks, I hadn't seen that page. Unfortunately, those examples are
somewhat lacking in breadth and depth. I just spent about 25 minutes
looking around the docs for a H5File.openGroup() function to complement
the createGroup() function, and finally came upon FileFormat.get(String
path) which does what I need. It would be incredibly useful to have a
set of examples that utilizes the library fully enough so that it is
clear what functions to use in most foreseeable situations. I was about
30 seconds from just abandoning the high-level library and writing my
own high-level wrapper library instead; may still do this as I took a
similar approach with C++ and it worked fine for me.

···

_________________________________________________________________________________________

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

True - I also ended up writing my own high-level wrappers, even though it
was easier to get started with the object package. The reason was that the
documentation at http://www.hdfgroup.org/HDF5/doc/ is decent (compared to
object package's documentation) and applies as is to JHI5 too (mostly).

I hope there'll be a good, authoritative, comprehensive HDF5 documentation
someday.

Best Regards,
Joonas

···

2009/7/13 Jason Sachs <jsachs@dekaresearch.com>

> > Hi Jason, Did you see all the examples at
> >
http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.html

> >
<http://www.hdfgroup.uiuc.edu/UserSupport/examples-by-api/api16-java.htm
>
>
> Those examples seem to use the raw JHI5 layer, which is in
> practice an one-to-one mapping to native functions and, as such,
> quite "non-Javaish" to use. There's also a "HDF Object Package"
> which is definitely easier to use, although less flexible. Some
> examples for it can be found here:
> http://www.hdfgroup.org/hdf-java-html/hdf-object/use.html
>
> Best Regards,
> Joonas

Thanks, I hadn't seen that page. Unfortunately, those examples are
somewhat lacking in breadth and depth. I just spent about 25 minutes
looking around the docs for a H5File.openGroup() function to complement
the createGroup() function, and finally came upon FileFormat.get(String
path) which does what I need. It would be incredibly useful to have a
set of examples that utilizes the library fully enough so that it is
clear what functions to use in most foreseeable situations. I was about
30 seconds from just abandoning the high-level library and writing my
own high-level wrapper library instead; may still do this as I took a
similar approach with C++ and it worked fine for me.