hdf images hdf images

HDF5 Tutorial: HDF5 Dimension Scale (H5DS)

An HDF5 Dimension Scale (DS) is an HDF5 dataset that is associated with a dimension of another HDF5 dataset. A common case is a 2-dimensional array that has spatial information, such as latitude and longitude, associated with it.

 


Converting a dataset to a dimension scale

The API function H5DSset_scale converts an existing dataset to a dimension scale:

   H5DSset_scale (did, dimname);

This function accepts a parameter did, obtained from the HDF5 library function H5Dopen, that identifies the dataset, and dimname, an optional name for the dimension scale. Internally, the function creates a set of attributes that identify the dataset as a dimension scale for the dimension scale API.


Attaching a dimension scale to a dataset

To attach a dimension scale to an HDF5 dataset, the H5DSattach_scale function is used:

   
   H5DSattach_scale (did, ds_id, index);

This function accepts a parameter did, obtained from the HDF5 library function H5Dopen, that identifies the dataset that the dimension scale is to be associated with, ds_id, the identifier of the dimension scale dataset, and index, the dimension of the dataset the dimension scale is to be associated with.


Detaching a dimension scale from a dataset

To detach a dimension scale from an HDF5 dataset, the H5DSdetach_scale function is used:

   H5DSdetach_scale (did, ds_id, index);

This function accepts a parameter did, obtained from the HDF5 library function H5Dopen, that identifies the dataset that the dimension scale is to be detached from, ds_id, the identifier of the dimension scale dataset, and index, the dimension of the dataset the dimension scale is to be detached from.


 For more information, see the HDF5 Dimension Scale API Reference.


- - Last modified: 21 December 2016