Stride argument confusion in H5Sselect_hyperslab method

Hello,
I am trying to use H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op,
const hsize_t start[],
const hsize_t _stride[],
const hsize_t count[],
const hsize_t _block[]);
for the first time and i completely donno what does stride[] argument takes saw few examples but it’s not clear…if someone explains me with simple dataset it would be helpful.

Thank you

Hello!

The stride indicates the interval between values to be selected along a dimension. For example:

  • A stride of 1 or NULL indicates that every element along a dimension should be selected.
  • A stride of 2 indicates that ever other element along a dimension should be selected.
  • A stride of 3 would select every third element along the dimension

There is a tutorial topic on subsetting here:
https://portal.hdfgroup.org/display/HDF5/Reading+From+or+Writing+To+a+Subset+of+a+Dataset

The attached C examples go with this topic. You can try changing the start, stride, count, and block values to see how they affect each other. There are also examples for other languages on this page:
Examples from Learning the Basics

If you have further questions, feel free to contact the HDF Helpdesk. See:
The HDF Help Desk

-Barbara

h5_subset.c (5.0 KB)
h5_subsetbk.c (5.8 KB)