# Confused about output of h5dump

**URL:** <https://forum.hdfgroup.org/t/confused-about-output-of-h5dump/2824>\
**Category:** Hdf-forum archives\
**Created:** [February 20, 2013, 9:35pm UTC](https://forum.hdfgroup.org/t/confused-about-output-of-h5dump/2824 "2013-02-20T21:35:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike.jackson](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/mike.jackson/32/1734_2.png) [@mike.jackson](https://forum.hdfgroup.org/u/mike.jackson)\
**Post date:** [February 20, 2013, 9:35pm UTC](https://forum.hdfgroup.org/t/confused-about-output-of-h5dump/2824/1 "2013-02-20T21:35:04Z")

</div>

I am trying to dump a data set from one of my HDF5 files. Here is the output from my command line invocation:

503:[mjackson@mine:~]$ h5dump -d /VoxelDataContainer/CELL\_DATA/GrainIds -o /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/GrainIds.bin /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d  
HDF5 "/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d" {  
DATASET "/VoxelDataContainer/CELL\_DATA/GrainIds" {  
&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 4444713 ) / ( 4444713 ) }  
&nbsp;&nbsp;&nbsp;DATA {  
&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;ATTRIBUTE "NumComponents" {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 1 ) / ( 1 ) }  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): 1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;ATTRIBUTE "ObjectType" {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STRING {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRSIZE 19;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRPAD H5T\_STR\_NULLTERM;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CSET H5T\_CSET\_ASCII;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTYPE H5T\_C\_S1;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SCALAR  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): "DataArray\<int32\_t\>"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;}  
}  
}

Looking at the output file "GrainIds.bin" the file size is registered as 26,800,344 bytes which is confusing because if we take the DATASPACE from above and multiply by 4 (number of bytes in H5T\_STD\_I32LE) I get 17,778,852 bytes. This is on hdf5-1.8.10-patch1, compiled on OS X 10.8.2 using the latest XCode installation from Apple.

Thoughts?

> **···**
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mike Jackson Principal Software Engineer  
> BlueQuartz Software Dayton, Ohio  
> [mike.jackson@bluequartz.net](mailto:mike.jackson@bluequartz.net)[www.bluequartz.net](http://www.bluequartz.net)

---

<div class="post-metadata">

**Author:** ![mike.jackson](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/mike.jackson/32/1734_2.png) [@mike.jackson](https://forum.hdfgroup.org/u/mike.jackson)\
**Post date:** [February 20, 2013, 9:46pm UTC](https://forum.hdfgroup.org/t/confused-about-output-of-h5dump/2824/2 "2013-02-20T21:46:40Z")

</div>

I used this:

h5dump --dataset=/VoxelDataContainer/CELL\_DATA/GrainIds --output=/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/GrainIds.bin --binary=NATIVE /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d  
HDF5 "/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d" {  
DATASET "/VoxelDataContainer/CELL\_DATA/GrainIds" {  
&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 4444713 ) / ( 4444713 ) }  
&nbsp;&nbsp;&nbsp;DATA {  
&nbsp;&nbsp;&nbsp;}  
}  
}

and got what I expected. Not really sure what the difference was except the --binary=NATIVE argument but I would have thought that was implied with the -o option?

Sorry for the noise.

> **···**
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mike Jackson Principal Software Engineer  
> BlueQuartz Software Dayton, Ohio  
> mike.jackson@bluequartz.net [www.bluequartz.net](http://www.bluequartz.net)
> 
> On Feb 20, 2013, at 4:35 PM, Michael Jackson \<mike.jackson@bluequartz.net\> wrote:
> 
> > I am trying to dump a data set from one of my HDF5 files. Here is the output from my command line invocation:
> > 
> > 503:[mjackson@mine:~]$ h5dump -d /VoxelDataContainer/CELL\_DATA/GrainIds -o /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/GrainIds.bin /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d  
> > HDF5 "/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d" {  
> > DATASET "/VoxelDataContainer/CELL\_DATA/GrainIds" {  
> > &nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
> > &nbsp;&nbsp;DATASPACE SIMPLE { ( 4444713 ) / ( 4444713 ) }  
> > &nbsp;&nbsp;DATA {  
> > &nbsp;&nbsp;}  
> > &nbsp;&nbsp;ATTRIBUTE "NumComponents" {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 1 ) / ( 1 ) }  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): 1  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;}  
> > &nbsp;&nbsp;ATTRIBUTE "ObjectType" {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STRING {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRSIZE 19;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRPAD H5T\_STR\_NULLTERM;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CSET H5T\_CSET\_ASCII;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTYPE H5T\_C\_S1;  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SCALAR  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): "DataArray\<int32\_t\>"  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;}  
> > }  
> > }
> > 
> > Looking at the output file "GrainIds.bin" the file size is registered as 26,800,344 bytes which is confusing because if we take the DATASPACE from above and multiply by 4 (number of bytes in H5T\_STD\_I32LE) I get 17,778,852 bytes. This is on hdf5-1.8.10-patch1, compiled on OS X 10.8.2 using the latest XCode installation from Apple.
> > 
> > Thoughts?  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Mike Jackson Principal Software Engineer  
> > BlueQuartz Software Dayton, Ohio  
> > mike.jackson@bluequartz.net [www.bluequartz.net](http://www.bluequartz.net)

---

<div class="post-metadata">

**Author:** ![Peter\_Cao](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Peter\_Cao](https://forum.hdfgroup.org/u/Peter_Cao)\
**Post date:** [February 20, 2013, 9:57pm UTC](https://forum.hdfgroup.org/t/confused-about-output-of-h5dump/2824/3 "2013-02-20T21:57:48Z")

</div>

use -binary will dump the data to binary format. so you will get the exact size.  
just using -o will dump the data to text format, which contains extra information  
(index, delimiters, etc). the size will be different.

> **···**
>
> On 2/20/2013 3:46 PM, Michael Jackson wrote:
> 
> > I used this:
> > 
> > h5dump --dataset=/VoxelDataContainer/CELL\_DATA/GrainIds --output=/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/GrainIds.bin --binary=NATIVE /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d  
> > HDF5 "/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d" {  
> > DATASET "/VoxelDataContainer/CELL\_DATA/GrainIds" {  
> > &nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
> > &nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 4444713 ) / ( 4444713 ) }  
> > &nbsp;&nbsp;&nbsp;&nbsp;DATA {  
> > &nbsp;&nbsp;&nbsp;&nbsp;}  
> > }
> > 
> > and got what I expected. Not really sure what the difference was except the --binary=NATIVE argument but I would have thought that was implied with the -o option?
> > 
> > Sorry for the noise.  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Mike Jackson Principal Software Engineer  
> > BlueQuartz Software Dayton, Ohio  
> > mike.jackson@bluequartz.net [www.bluequartz.net](http://www.bluequartz.net)
> > 
> > On Feb 20, 2013, at 4:35 PM, Michael Jackson \<mike.jackson@bluequartz.net\> wrote:
> > 
> > > I am trying to dump a data set from one of my HDF5 files. Here is the output from my command line invocation:
> > > 
> > > 503:[mjackson@mine:~]$ h5dump -d /VoxelDataContainer/CELL\_DATA/GrainIds -o /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/GrainIds.bin /Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d  
> > > HDF5 "/Users/Shared/Data/Ang\_Data/Small\_IN100\_Output/Small\_IN100.dream3d" {  
> > > DATASET "/VoxelDataContainer/CELL\_DATA/GrainIds" {  
> > > &nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
> > > &nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 4444713 ) / ( 4444713 ) }  
> > > &nbsp;&nbsp;&nbsp;DATA {  
> > > &nbsp;&nbsp;&nbsp;}  
> > > &nbsp;&nbsp;&nbsp;ATTRIBUTE "NumComponents" {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STD\_I32LE  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SIMPLE { ( 1 ) / ( 1 ) }  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): 1  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > > &nbsp;&nbsp;&nbsp;}  
> > > &nbsp;&nbsp;&nbsp;ATTRIBUTE "ObjectType" {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATATYPE H5T\_STRING {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRSIZE 19;  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STRPAD H5T\_STR\_NULLTERM;  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CSET H5T\_CSET\_ASCII;  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CTYPE H5T\_C\_S1;  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATASPACE SCALAR  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(0): "DataArray\<int32\_t\>"  
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
> > > &nbsp;&nbsp;&nbsp;}  
> > > }
> > > 
> > > Looking at the output file "GrainIds.bin" the file size is registered as 26,800,344 bytes which is confusing because if we take the DATASPACE from above and multiply by 4 (number of bytes in H5T\_STD\_I32LE) I get 17,778,852 bytes. This is on hdf5-1.8.10-patch1, compiled on OS X 10.8.2 using the latest XCode installation from Apple.
> > > 
> > > Thoughts?  
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Mike Jackson Principal Software Engineer  
> > > BlueQuartz Software Dayton, Ohio  
> > > mike.jackson@bluequartz.net [www.bluequartz.net](http://www.bluequartz.net)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > 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)
