H5Screate
(H5S_class_t type
)
H5Screate
creates a new dataspace of a particular
type
.
The types currently supported are H5S_SCALAR
,
H5S_SIMPLE
, and H5S_NONE
;
others are planned to be added later. The H5S_NONE
dataspace can only hold a selection, not an extent.
type
H5Screate_simple
(int rank
,
const hsize_t * dims
,
const hsize_t * maxdims
)
H5Screate_simple
creates a new simple data space
and opens it for access. The rank
is the number of
dimensions used in the dataspace.
The dims
argument is the size
of the simple dataset and the maxdims
argument is
the upper limit on the size of the dataset. maxdims
may be the null pointer in which case the upper limit is the
same as dims
. If an element of maxdims
is zero then the corresponding dimension is unlimited, otherwise
no element of maxdims
should be smaller than the
corresponding element of dims
. The dataspace
identifier returned from this function should be released with
H5Sclose
or resource leaks will occur.
rank
dims
maxdims
H5Scopy
(hid_t space_id
)
H5Scopy
creates a new dataspace which is an exact
copy of the dataspace identified by space_id
.
The dataspace identifier returned from this function should be
released with H5Sclose
or resource leaks will occur.
space_id
H5Sselect_elements
(hid_t space_id
,
dh5s_selopt_t op
,
const size_t num_elements
,
const hssize_t *coord
[ ]
)
H5Sselect_elements
selects array elements to be
included in the selection for the space_id
dataspace. The number of elements selected must be set with
the num_elements
. The coord
array
is a two-dimensional array of size dataspace rank
by num_elements
(ie. a list of coordinates in
the array). The order of the element coordinates in the
coord
array also specifies the order in which
the array elements are iterated through when I/O is performed.
Duplicate coordinate locations are not checked for.
The selection operator op
determines how the
new selection is to be combined with the previously existing
selection for the dataspace. Currently, only the
H5S_SELECT_SET
operator is supported, which
replaces the existing selection with the parameters from
this call. When operators other than H5S_SELECT_SET
are used to combine a new selection with an existing selection,
the selection ordering is reset to 'C' array ordering.
space_id
op
num_elements
coord
[ ]
H5Sextent_npoints
(hid_t space_id
)
H5Sextent_npoints
determines the number of elements
in a dataspace. For example, a simple 3-dimensional dataspace
with dimensions 2, 3, and 4 would have 24 elements.
space_id
H5Sselect_npoints
(hid_t space_id
)
H5Sselect_npoints
determines the number of elements
in the current selection of a dataspace.
space_id
H5Sextent_ndims
(hid_t space_id
)
H5Sextent_ndims
determines the dimensionality (or rank)
of a dataspace.
space_id
H5Sextent_dims
(hid_t space_id
,
hsize_t *dims
,
hsize_t *maxdims
)
H5Sextent_dims
returns the size and maximum sizes
of each dimension of a dataspace through the dims
and maxdims
parameters.
space_id
dims
maxdims
H5S_set_extent_simple
(hid_t space_id
,
int rank
,
const hsize_t *current_size
,
const hsize_t *maximum_size
)
H5S_set_extent_simple
sets or resets the size of
an existing dataspace.
rank
is the dimensionality, or number of
dimensions, of the dataspace.
current_size
is an array of size rank
which contains the new size of each dimension in the dataspace.
maximum_size
is an array of size rank
which contains the maximum size of each dimension in the
dataspace.
Any previous extent is removed from the dataspace, the dataspace
type is set to H5S_SIMPLE
, and the extent is set as
specified.
space_id
rank
current_size
maximum_size
H5Sis_simple
(hid_t space_id
)
H5Sis_simple
determines whether a dataspace is
a simple dataspace. [Currently, all dataspace objects are simple
dataspaces, complex dataspace support will be added in the future]
space_id
H5Sextent_class
(hid_t space_id
)
H5Sextent_class
queries a dataspace to determine the
current class of a dataspace.
The function returns a class name, one of the following:
H5S_SCALAR
,
H5S_SIMPLE
.
space_id
H5Sselect_hyperslab
(hid_t space_id
,
h5s_selopt_top
,
const hssize_t *start
,
const hsize_t *stride
const hsize_t *count
,
const hsize_t *block
)
H5Sselect_hyperslab
selects a hyperslab region
to add to the current selected region for the dataspace
specified by space_id
.
The start
, stride
, count
,
and block
arrays must be the same size as the rank
of the dataspace.
The selection operator op
determines how the new
selection is to be combined with the already existing selection
for the dataspace.
Currently, only the H5S_SELECT_SET
operator is
supported; it replaces the existing selection with the
parameters from this call. Overlapping blocks are not
supported with the H5S_SELECT_SET
operator.
The start
array determines the starting coordinates
of the hyperslab
to select.
The stride
array chooses array locations
from the dataspace
with each value in the stride
array determining how
many elements to move
in each dimension. Setting a value in the stride
array to 1 moves to
each element in that dimension of the dataspace; setting a value of 2 in a
location in the stride
array moves to every other
element in that
dimension of the dataspace. In other words, the stride
determines the
number of elements to move from the start
location
in each dimension.
Stride values of 0 are not allowed. If the stride
parameter is NULL
,
a contiguous hyperslab is selected (as if each value in the
stride
array
was set to all 1's).
The count
array determines how many blocks to
select from the dataspace, in each dimension.
The block
array determines
the size of the element block selected from the dataspace.
If the block
parameter is set to NULL
, the block size defaults
to a single element
in each dimension (as if the block
array was set to all 1's).
For example, in a 2-dimensional dataspace, setting
start
to [1,1],
stride
to [4,4], count
to [3,7], and
block
to [2,2] selects
21 2x2 blocks of array elements starting with location (1,1) and selecting
blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.
Regions selected with this function call default to C order iteration when I/O is performed.
space_id
op
start
count
stride
block
H5Sclose
(hid_t space_id
)
H5Sclose
releases a dataspace.
Further access through the dataspace identifier is illegal.
Failure to release a dataspace with this call will
result in resource leaks.
space_id