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.
| File | Description |
|---|---|
| DataProject.zip | C 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.

More examples
| C file | HDF5 file | What it creates |
|---|---|---|
| hdf5data.c | hdf5data.h5 | Several types of HDF5 data, covering all dataset classes: float, integer, compound, bitfield, opaque, string, enumerated, variable length and array. |
| hdf5images.c | hdf5images.h5 | HDF5 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. |