Update h5toh4 utility: Project Goals

January,Feburary 2003

Overview

The h5toh4 tool (http://hdf.ncsa.uiuc.edu/HDF5/doc/Tools.html#Tools-H5toh4) is utility that converts certain HDF5 objects form an HDF5 file into equivalent HDF4 objects in and HDF4 file. This tool needs to be brought up to date, to conform with the HDF4 to HDF5 Mapping Specification (http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/H4toH5Mapping.pdf), and to use new features such as HDF5 images.

The overall goal is to update and clean up the h4toh5 utility. Several features will be added. During this process, the code will be reviewed and cleaned up.  We will investigate the "reversibility" of the h5toh4 and h4toh5 tools, and make them as compatible as resources permit.

Desired Features

The following features will be implemented in the h5toh4 utility:

Omit the root group

Every HDF5 file has a root group, but most HDF4 files do not have a single root.  The h5oh4 utility currently creates a Vgroup for the root, and makes all Vgroups descend from that Vgroup. The desired default behavior is to omit the Vgroup for the HDF5 root, unless specifically requested.

Images

The h5toh4 utility should recognize HDF5 images (http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/ImageSpec.html) and convert them to the appropriate HDF4 Raster Image.

Tables

The h5toh4 utility should recognize HDF5 Tables (http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5tb_spec.html) and convert them to appropriate HDF4 Vdata tables.

Other Updates

In general, the h5toh4 utility and the Mapping specification should be reviewed and corrected.  In addition to the features about, other updates may include:
In addition, we will investigate the "reversibility" of h4toh5 and h5toh4.  In  particular, any file translated by h4toh5 should be translated back to HDF4 by h5toh4.  This should, for example, recognize the special attributes used to represent HDF4 global attributes.  See the Mapping Specification.

Update the Mapping Specification

The h5toh4 conversion will be completely documents.  The Mapping Specification will be modified and updated as needed to reflect the changes.




Ideas about what needs to be done


Simple changes to current tool:

1. Groups:

a) Root group is special.
i)  add command option to omit root group
ii)  Root group may have attributes that should be made into annotations, global attrs.
These chould be written to the appropriate HDF4 objects.
b) Special groups omit from HDF4
  HDF4_DIMSCALES, HDF4_PALETTES, etc.
c) Other groups: include attributes of the groups as HDF4 attributes

2. Datasets

a) if CLASS=PALLET -- need to figure out how to create correct palettes, don't duplicate, etc.
b) if CLASS=IMAGE -- make GR image if possible, include palettes
c) if CLASS=Table -- make Vdata if possible
d) datasets in group HDF4_DIMGROUP --make dimensions?  how?
e) else:  include
i) attributes
ii)  dimension scales
iii) storage properties?

3. Other
a) what about softlinks?
b) what about other datatypes?:  H5T_ARRAY, H5T_ENUM, etc.
c) convert H5 object references to HDF4 tag/ref in attribute?
d) partial I/O

Documentation:

Update the tool page.

Will need to update the HDF4 to HDF5 Mapping document.