In this six weeks we will finish up several milestones for this quarter and
calendar year.
We will have a more integrated set of tools for manipulating HDF5, and
converting to an from other formats. The h5dump utility,
h5toh5 utility, and H5gen tool will all interoperate, with the
H5view tool providing a unified graphical interface.
The H5view will have the following features:
The H5view tool will call the H5gen classes to read the XML
file and create an HDF5 file. Then H5view will open the HDF5 file,
and view or edit it.
This feature can be used for various purposes:
The H5view will output a description of the HDF5 file as
XML. The XML output of h5dump -xml and H5view will be as
identical as can be achieved. This feature can be used for any HDF5 file.
The H5view edits HDF5 files. With the new features, it will
support automatic conversion of XML to HDF5 (and then editing, etc. the HDF5)
and automatic conversion of the HDF5 to XML. Note that the H5View
will not view or edit the XML directly, it converts to and from HDF5, and
edits only the HDF5.
The input conversion (from XML to HDF5) will use the same code as the H5gen tool, so it will produce identical results as using the H5gen tool separately.
The output conversion will produce the same output as the h5dump -xml command, as nearly as can be achieved.
Thus, these tools will all work together seamlessly. Theoretically, the transformations will be completely lossless and reversible.
XML1 --> HDF5 --> XML2 <=> XML1 == XML2
HDF51 --> XML --> HDF52 <=> HDF51 == HDF52
We propose to make the H5View tool ingest HDF4 files, via the
h4toh5 conversion tool/library. The H5view would detect an
HDF4 file, and convert it to HDF5, and then open the HDF5 file.
In this way, the H5View can be used as an easy visual interface for converting from HDF4 to HDF5. This has the advantage of showing the conversion result immediately, and allowing editing of the converted file. The latter will be helpful in the case where the default conversion needs to be cleaned up or modified in a simple way, such as deleting unneeded attributes.
If this is successful, we may migrate most features of the JHV tool to
the H5view tool, and phase out the JHV. This remains to be
seen.
The h4toh5 conversion is available as a standalone command line
utility. The H5View can launch this utility to convert a file, but
would prefer to use library calls (wrapped in Java). So there will be a
two-phase approach.
Phase 1 will use the h4toh5 utility, launched as a separate program in the background. The main challenge with this is the necessary packaging and install support, which must assure the h4toh5 utility is available to run. (The H5View is self-contained, and does not require the HDF5 distribution to be on the system.)
Phase 2 will use the h4toh5 library API when it becomes available and when it is wrapped with Java. The library will be bound in with the rest of the Java support library, so the packing issues will be simplified.
Figure 2. Phase 2 HDF4 support
Both phases will work the same way, and users will probably not notice the
change in the implementations.
With a stable suite of HDF5 XML tools, we can explore some of the
powerful features of XML. At the top of the list of proposed experiments
is netcdf/HDF5 conversions.
Netcdf has an XML DTD, and netcdf <-> XML tools (written in C?). xncgen creates netcdf from XML, xncdump dumps XML from netcdf.
Theoretically, we should be able to create XSL style sheets to convert a netcdf XML description to HDF5 XML description, and some HDF5 XML descriptions to netcdf XML descriptions.
If so, then we can convert from netcdf to HDF5 by converting netcdf -> XML -> XML -> HDF5. And similarly, perhaps, the other way (at least for HDF5 files that can be conceptually mapped to netcdf.)
Figure 3. Netcdf to HDF5 conversion, using XML