Page tree

The license could not be verified: License Certificate has expired!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following command displays a list of the objects in the file OMI-Aura.he5 (an HDF-EOS5 file):

 

h5dump -n OMI-Aura.he5

 

As shown in the output below, the objects (groups, datasets) are listed to the left, followed by their names. You can see that this file contains two root groups, HDFEOS and HDFEOS INFORMATION:

 

HDF5 "OMI-Aura.he5" {
FILE_CONTENTS {
 group      /
 group      /HDFEOS
 group      /HDFEOS/ADDITIONAL
 group      /HDFEOS/ADDITIONAL/FILE_ATTRIBUTES
 group      /HDFEOS/GRIDS
 group      /HDFEOS/GRIDS/OMI Column Amount O3
 group      /HDFEOS/GRIDS/OMI Column Amount O3/Data Fields
 dataset    /HDFEOS/GRIDS/OMI Column Amount O3/Data Fields/ColumnAmountO3
 dataset    /HDFEOS/GRIDS/OMI Column Amount O3/Data Fields/RadiativeCloudFraction
 dataset    /HDFEOS/GRIDS/OMI Column Amount O3/Data Fields/SolarZenithAngle
 dataset    /HDFEOS/GRIDS/OMI Column Amount O3/Data Fields/ViewingZenithAngle
 group      /HDFEOS INFORMATION
 dataset    /HDFEOS INFORMATION/StructMetadata.0
 }
}

...

The file structure of the OMI-Aura.he5 file can be seen with the following command. The -A 0 option suppresses the display of attributes:

 

h5dump -H -A 0 OMI-Aura.he5

...

Output of this command is shown below:

 

HDF5 "OMI-Aura.he5" {
GROUP "/" {
   GROUP "HDFEOS" {
      GROUP "ADDITIONAL" {
         GROUP "FILE_ATTRIBUTES" {
         }
      }
      GROUP "GRIDS" {
         GROUP "OMI Column Amount O3" {
            GROUP "Data Fields" {
               DATASET "ColumnAmountO3" {
                  DATATYPE  H5T_IEEE_F32LE
                  DATASPACE  SIMPLE { ( 720, 1440 ) / ( 720, 1440 ) }
               }
               DATASET "RadiativeCloudFraction" {
                  DATATYPE  H5T_IEEE_F32LE
                  DATASPACE  SIMPLE { ( 720, 1440 ) / ( 720, 1440 ) }
               }
               DATASET "SolarZenithAngle" {
                  DATATYPE  H5T_IEEE_F32LE
                  DATASPACE  SIMPLE { ( 720, 1440 ) / ( 720, 1440 ) }
               }
               DATASET "ViewingZenithAngle" {
                  DATATYPE  H5T_IEEE_F32LE
                  DATASPACE  SIMPLE { ( 720, 1440 ) / ( 720, 1440 ) }
               }
            }
         }
      }
   }
   GROUP "HDFEOS INFORMATION" {
      DATASET "StructMetadata.0" {
         DATATYPE  H5T_STRING {
            STRSIZE 32000;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
         DATASPACE  SCALAR
      }
   }
}
}

...

The h5ls tool by default just displays the objects in the root group. It will not display items in groups beneath the root group unless specified. Useful h5ls options for viewing file content and structure are:

 

OptionDescriptionComment
-r
Lists all groups and objects recursivelySee  Example 3
-v
Generates verbose output (lists dataset properties, attributes 
and attribute values, but no dataset values)
 

...

The following command shows the contents of the HDF-EOS5 file OMI-Aura.he5. The output is similar to h5dump, except that h5ls also shows dataspace information for each dataset:

 

 h5ls -r OMI-Aura.he5

 

The output is shown below:

...

Useful h5dump options for examining specific datasets include:

 

OptionDescriptionComment
 -d D, --dataset=D
Displays dataset DSee  Example 4
 -H, --header
Displays header information onlySee  Example 4
 -p, --properties
Displays dataset filters, storage layout, and fill value propertiesSee  Example 5
 -A 0, --onlyattr=0
Suppresses the display of attributesSee  Example 2
-N P, --any_path=P
Displays any object or attribute that matches path PSee  Example 6

...

The following example uses the groups.h5 file that is created by the HDF5 Introductory Tutorial example h5_crtgrpar.c. To display  dset1  in the groups.h5 file below, specify dataset  /MyGroup/dset1 . The -H option is used to suppress printing of the data values:

 

Contents of groups.h5Display dataset "dset1"
   $ h5dump -n groups.h5
   HDF5 "groups.h5" {
   FILE_CONTENTS {
    group      /
    group      /MyGroup
    group      /MyGroup/Group_A
    dataset    /MyGroup/Group_A/dset2
    group      /MyGroup/Group_B
    dataset    /MyGroup/dset1
    }
   }
   $ h5dump -d "/MyGroup/dset1" -H groups.h5
   HDF5 "groups.h5" {
   DATASET "/MyGroup/dset1" {
      DATATYPE  H5T_STD_I32BE
      DATASPACE  SIMPLE { ( 3, 3 ) / ( 3, 3 ) }
   }
   }



...

In the file shown below the dataset  /DS1  is both chunked and compressed:

 

   $ h5dump -H -p -d "/DS1" h5ex_d_gzip.h5
   HDF5 "h5ex_d_gzip.h5" {
   DATASET "/DS1" {
      DATATYPE  H5T_STD_I32LE
      DATASPACE  SIMPLE { ( 32, 64 ) / ( 32, 64 ) }
      STORAGE_LAYOUT {
         CHUNKED ( 4, 8 )
         SIZE 5278 (1.552:1 COMPRESSION)
      }
      FILTERS {
         COMPRESSION DEFLATE { LEVEL 9 }
      }
      FILLVALUE {
         FILL_TIME H5D_FILL_TIME_IFSET
         VALUE  0
      }
      ALLOCATION_TIME {
         H5D_ALLOC_TIME_INCR
      }
   }
   }

...