H5Scombine_hyperslab: Perform operation between an existing selection and an...

View source: R/H5S.R

H5Scombine_hyperslabR Documentation

Perform operation between an existing selection and an another hyperslab definition.

Description

Combines a hyperslab selection specified by start, stride, count and block arguments with the current selection for the dataspace represented by h5space.

Usage

H5Scombine_hyperslab(
  h5space,
  op = h5default("H5S_SELECT"),
  start = NULL,
  stride = NULL,
  count = NULL,
  block = NULL
)

Arguments

h5space

H5IdComponent object representing a dataspace.

op

Character string defined the operation used to join the two dataspaces. See h5const("H5S_SELECT") for the list of available options.

start, stride, count, block

Integer vectors, each with length equal to the rank of the dataspace. These parameters define the new hyperslab to select.

Value

An H5IdComponent object representing a new dataspace with the generated selection.

See Also

H5Scombine_select(), H5Sselect_hyperslab()

Examples


## create a 1 dimensional dataspace
sid_1 <- H5Screate_simple(dims = 20)

## select a single block of 5 points in sid_1
## this is equivalent to [11:16] in R syntax
H5Sselect_hyperslab(sid_1, start = 11, stride = 1, 
                    block = 5, count = 1)#

## combine the existing selection with a new
## selection consisting of 2 blocks each of 1 point
## equivalent to [c(3,5)] in R syntax
sid_2 <- H5Scombine_hyperslab(sid_1, op = "H5S_SELECT_OR",
                              start = 3, stride = 2, 
                              block = 1, count = 2)

## confirm we have selected 5 in our original dataspace
## and 7 points in the newly created dataspace
H5Sget_select_npoints(sid_1)
H5Sget_select_npoints(sid_2)

## tidy up
H5Sclose(sid_1)
H5Sclose(sid_2)


grimbough/rhdf5 documentation built on Sept. 14, 2024, 8:41 a.m.