Programming Hints:
To use any of these functions or subroutines, you must first include the relevant include file (C) or module (Fortran) in your application.
The following line includes the HDF5 Dimension Scale package, H5DS,
in C applications:
#include "hdf5_hl.h"
This line includes the H5DS module in Fortran applications:
use h5ds
The C Interfaces:
The FORTRAN90 Interfaces:
If dimname is specified, then an attribute called NAME is created, with the value dimname.
Fails if:
If the dataset was created with the Table, Image, or Palette interface [9], it is not recommended to convert to a Dimension Scale. (These Datasets will have a CLASS Table, Image, or Palette.)
hid_t dsid; | IN: the dataset to be made a Dimension Scale |
char *dimname; | IN: the dimension name (optional), NULL if the dimension has no name. |
SUBROUTINE H5DSset_scale_f(dsid, errcode, dimname) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made ! a Dimension Scale INTEGER :: errcode ! Error code CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name END SUBROUTINE H5DSset_scale_f
Entries are created in the DIMENSION_LIST and REFERENCE_LIST attributes, as defined in section 4.2.
Fails if:
Note: The Dimension Scale dsid can be attached to the same dimension more than once, which has no effect.
hid_t did; | IN: the dataset |
hid_t dsid; | IN: the scale to be attached |
unsigned int idx; | IN: the dimension of did that dsid is associated with. |
SUBROUTINE H5DSattach_scale_f(did, dsid, idx, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER(hid_t), INTENT(in) :: dsid ! The scale to be attached INTEGER , INTENT(in) :: idx ! The dimension of did that ! dsid is associated with. INTEGER :: errcode ! Error code END SUBROUTINE H5DSattach_scale_f
Fails if:
Note that a scale may be associated with more than dimension of the same dataset. If so, the detach operation only deletes one of the associations, for did.
hid_t did; | IN: the dataset |
hid_t dsid; | IN: the scale to be detached |
unsigned int idx; | IN: the dimension of did to detach |
SUBROUTINE H5DSdetach_scale_f(did, dsid, idx, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER(hid_t), INTENT(in) :: dsid ! The scale to be detached INTEGER , INTENT(in) :: idx ! The dimension of did to detach INTEGER :: errcode ! Error code END SUBROUTINE H5DSdetach_scale_f
Fails if:
hid_t did; | IN: the dataset |
hid_t dsid; | IN: the scale to be attached |
unsigned int idx; | IN: the dimension of did that dsid is associated with. |
SUBROUTINE H5DSdetach_scale_f(did, dsid, idx, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER(hid_t), INTENT(in) :: dsid ! The scale to be detached INTEGER , INTENT(in) :: idx ! The dimension of did to detach INTEGER :: errcode ! Error code END SUBROUTINE H5DSdetach_scale_f
The operation receives the Dimension Scale dataset identifier, dsid, and the pointer to the operator data passed in to H5DDiterate_scales, visitor_data.
The return values from an operator are:
H5DSiterate_scales assumes that the scales of the dimension identified by dim remain unchanged through the iteration. If the membership changes during the iteration, the function's behavior is undefined.
hid_t did; | IN: the dataset |
unsigned dim; | IN: the dimension of dataset did |
int *idx; | IN/OUT: input the index to start iterating, output the next index to visit. If NULL, start at the first position. |
H5DS_iterate_t visitor; | IN: the visitor function |
void *visitor_data; | IN: arbitrary data to pass to the visitor function. |
Fails if:
hid_t did; | IN: the dataset |
unsigned int idx; | IN: the dimension |
char *label; | IN: the label |
SUBROUTINE H5DSset_label_f(did, idx, label, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label INTEGER :: errcode ! Error code END SUBROUTINE H5DSset_label_f
If did has no label, the return value of label is NULL.
Fails if:
hid_t did; | IN: the dataset |
unsigned int idx; | IN: the dimension |
char *label; | OUT: the label |
size_t size; | IN: the length of the label buffer. |
SUBROUTINE H5DSget_label_f(did, idx, label, size, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label INTEGER(size_t) , INTENT(inout) :: size ! The length of the label buffer INTEGER :: errcode ! Error code END SUBROUTINE H5DSget_label_f
H5DSget_scale_name
retrieves the name attribute for scale did.
Up to size
characters of the scale name are returned in name
;
additional characters, if any, are not returned to the user application.
If the length of the name, which determines the required value of size
,
is unknown, a preliminary H5DSget_scale_name
call
can be made by setting name
to NULL.
The return value of this call will be the size of the scale name;
that value plus one (1) can then be assigned to size
for a second H5DSget_scale_name
call,
which will retrieve the actual name.
(The value passed in with the parameter size
must be
one greater than size in bytes of the actual name in order to
accommodate the null terminator; if size
is set to
the exact size of the name, the last byte passed back will
contain the null terminator and the last character will be
missing from the name passed back to the calling application.)
int did; | IN: dimension scale identifier |
char *name; | OUT: buffer to contain the returned name |
size_t size; | IN: size in bytes, of the name buffer |
SUBROUTINE H5DSget_scale_name_f(did, name, size, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer INTEGER :: errcode ! Error code END SUBROUTINE H5DSget_scale_name_f
hid_t did; | IN: the data set to query |
SUBROUTINE H5DSis_scale_f(did, is_scale, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The data set to query LOGICAL , INTENT(out) :: is_scale ! Logical: ! .TRUE. if did is a Dimension Scale INTEGER :: errcode ! Error code END SUBROUTINE H5DSis_scale_f
hid_t did; | IN: the data set to query |
unsigned int idx; | IN: the dimension of did to query. |
SUBROUTINE H5DSget_num_scales_f(did, idx, num_scales, errcode) IMPLICIT NONE INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension of did to query INTEGER , INTENT(out) :: num_scales ! The number of Dimension Scales ! associated with did INTEGER :: errcode ! Error code END SUBROUTINE H5DSget_num_scales_f
The HDF Group Help Desk:
Describes HDF5 Release 1.8.18, November 2016. |
Copyright by
The HDF Group
and the Board of Trustees of the University of Illinois |