Saving your data in HDF5

This tutorial shows how to save data in HDF5 format. The example programs, sample files and a Visual C++ project are available for download.

FileDescription
DataProject.zipC programs that save netCDF and HDF5 files

Converting MODB data

This example converts data from the Mediterranean Oceanic Data Base (MODB). The C program modb2hdf5.c reads a file in MODB format (an ASCII text file) and saves it as HDF5. The data holds salinity and temperature measurements for 34 layers of the Mediterranean Sea.

The image shows HDF Explorer's map of one layer. MODB fill values were converted to HDF5 fill values and appear in grey. The output file is modb.h5.

MODB layer in HDF Explorer
Click for a larger image.

More examples

C fileHDF5 fileWhat it creates
hdf5data.chdf5data.h5Several types of HDF5 data, covering all dataset classes: float, integer, compound, bitfield, opaque, string, enumerated, variable length and array.
hdf5images.chdf5images.h5HDF5 images and palettes. The palettes are read from ASCII PAL files and attached to one 8-bit image. Use Select Palette… in HDF Explorer to choose one.