# h5dump: what am I doing wrong?

**URL:** <https://forum.hdfgroup.org/t/h5dump-what-am-i-doing-wrong/2455>\
**Category:** Hdf-forum archives\
**Created:** [February 3, 2012, 3:44pm UTC](https://forum.hdfgroup.org/t/h5dump-what-am-i-doing-wrong/2455 "2012-02-03T15:44:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Knutson](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@John\_Knutson](https://forum.hdfgroup.org/u/John_Knutson)\
**Post date:** [February 3, 2012, 3:44pm UTC](https://forum.hdfgroup.org/t/h5dump-what-am-i-doing-wrong/2455/1 "2012-02-03T15:44:16Z")

</div>

I'm once again puzzled by the behavior of h5dump. In this case I have the following dataset:  
&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 288, 2, 32, 1 ) / ( 288, H5S\_UNLIMITED, H5S\_UNLIMITED, H5S\_UNLIMITED ) }

and I was trying to dump the first "row" (i.e. all elements with the 1st dimension = 0). I tried  
h5dump -d dataset-name -s "0,0,0,0" -k "1,2,32,1" somefile.h5

but the results were not at all what I expected. Here's a brief listing of just the coordinates h5dump prints out:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,0,0): {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,1,0): {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,2,0): {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,3,0): {  
...  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,31,0): {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,1,0,0): {

what's more, the elements at each coordinate are completely different. The first 0,0,1,0 matches the fill data, while the second 0,0,1,0 has data in it.

Now, I was doing this in an attempt to verify what hdfdump (2.7) was telling me, which was that 0,0,0,0 was exactly the same as 0,1,0,0 which shouldn't be the case unless I have a bug in my software. h5dump doesn't really confirm this but both hdfview and h5dump appear to be displaying things incorrectly, certainly inconsistently.

I'm using a modified (for iRODS support) HDF5 1.8.8 snap 6.

---

<div class="post-metadata">

**Author:** ![John\_Knutson](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@John\_Knutson](https://forum.hdfgroup.org/u/John_Knutson)\
**Post date:** [February 3, 2012, 3:52pm UTC](https://forum.hdfgroup.org/t/h5dump-what-am-i-doing-wrong/2455/2 "2012-02-03T15:52:33Z")

</div>

Ok so after I posted that I remembered having gone through this once already. Using -c instead of -k works, and verifies that what hdfview was displaying was incorrect (which has also been double-checked using my own code).

> **···**
>
> On 02/03/12 09:44, John Knutson wrote:
> 
> > I'm once again puzzled by the behavior of h5dump. In this case I have  
> > the following dataset:  
> > &nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 288, 2, 32, 1 ) / ( 288, H5S\_UNLIMITED,  
> > H5S\_UNLIMITED, H5S\_UNLIMITED ) }
> > 
> > and I was trying to dump the first "row" (i.e. all elements with the  
> > 1st dimension = 0). I tried  
> > h5dump -d dataset-name -s "0,0,0,0" -k "1,2,32,1" somefile.h5
> > 
> > but the results were not at all what I expected. Here's a brief  
> > listing of just the coordinates h5dump prints out:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,0,0): {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,1,0): {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,2,0): {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,3,0): {  
> > ...  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,31,0): {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,1,0,0): {
> > 
> > what's more, the elements at each coordinate are completely  
> > different. The first 0,0,1,0 matches the fill data, while the second  
> > 0,0,1,0 has data in it.
> > 
> > Now, I was doing this in an attempt to verify what hdfdump (2.7) was  
> > telling me, which was that 0,0,0,0 was exactly the same as 0,1,0,0  
> > which shouldn't be the case unless I have a bug in my software.  
> > h5dump doesn't really confirm this but both hdfview and h5dump appear  
> > to be displaying things incorrectly, certainly inconsistently.
> > 
> > I'm using a modified (for iRODS support) HDF5 1.8.8 snap 6.
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)

---

<div class="post-metadata">

**Author:** ![daniel.a.kahn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@daniel.a.kahn](https://forum.hdfgroup.org/u/daniel.a.kahn)\
**Post date:** [February 6, 2012, 4:33pm UTC](https://forum.hdfgroup.org/t/h5dump-what-am-i-doing-wrong/2455/3 "2012-02-06T16:33:16Z")

</div>

John,

There is a bug in HDFView version 1.8 which causes incorrect values to be displayed in ImageView using Show Value. You don't indicate if that is your failure mode, but a patch for this was released and is available from the hdfgroups anonymous FTP server, which can also be accessed from their web site:

&nbsp;&nbsp;[http://www.hdfgroup.org/ftp/HDF5/hdf-java/patches/p1/](http://www.hdfgroup.org/ftp/HDF5/hdf-java/patches/p1/)

--dan

John Knutson wrote:

> **···**
>
> > Ok so after I posted that I remembered having gone through this once already. Using -c instead of -k works, and verifies that what hdfview was displaying was incorrect (which has also been double-checked using my own code).
> > 
> > On 02/03/12 09:44, John Knutson wrote:
> > 
> > > I'm once again puzzled by the behavior of h5dump. In this case I have  
> > > the following dataset:  
> > > &nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 288, 2, 32, 1 ) / ( 288, H5S\_UNLIMITED,  
> > > H5S\_UNLIMITED, H5S\_UNLIMITED ) }
> > > 
> > > and I was trying to dump the first "row" (i.e. all elements with the  
> > > 1st dimension = 0). I tried  
> > > h5dump -d dataset-name -s "0,0,0,0" -k "1,2,32,1" somefile.h5
> > > 
> > > but the results were not at all what I expected. Here's a brief  
> > > listing of just the coordinates h5dump prints out:  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,0,0): {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,1,0): {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,2,0): {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,3,0): {  
> > > ...  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,0,31,0): {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0,1,0,0): {
> > > 
> > > what's more, the elements at each coordinate are completely  
> > > different. The first 0,0,1,0 matches the fill data, while the second  
> > > 0,0,1,0 has data in it.
> > > 
> > > Now, I was doing this in an attempt to verify what hdfdump (2.7) was  
> > > telling me, which was that 0,0,0,0 was exactly the same as 0,1,0,0  
> > > which shouldn't be the case unless I have a bug in my software.  
> > > h5dump doesn't really confirm this but both hdfview and h5dump appear  
> > > to be displaying things incorrectly, certainly inconsistently.
> > > 
> > > I'm using a modified (for iRODS support) HDF5 1.8.8 snap 6.
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Hdf-forum is for HDF software users discussion.  
> > > Hdf-forum@hdfgroup.org  
> > > [http://mail.hdfgroup.org/mailman/listinfo/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](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
> 
> --  
> Daniel Kahn  
> Science Systems and Applications Inc.  
> 301-867-2162
