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
- Attaching a dimension scale to a dataset
- Detaching a dimension scale from a dataset
- Example Program: ex_ds1.c (C) ex_ds1.f90 (F90)
For more information, see the HDF5 Dimension Scale API Reference.
The API function H5DS_SET_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.
To attach a dimension scale to an HDF5 dataset, the H5DS_ATTACH_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.
To detach a dimension scale from an HDF5 dataset, the H5DS_DETACH_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.
--- Last Modified: October 22, 2020 | 01:37 PM