hdf images hdf images

This web site is no longer maintained (but will remain online).
Please see The HDF Group's new Support Portal for the latest information.

HDF5 Tutorial:   Advanced Topics
Selecting Individual Points

Contents:


Description

This topic shows how to select and write to independent points in a dataset.

Programming Example

Description

The H5Sselect_elements / h5sselect_elements_f call allows you to select individual points in a dataspace. By use of it, you can read and write to individual points in a dataset.

For details on compiling an HDF5 application click here.

Remarks

File Contents

Following is the DDL for copy1.h5 and copy2.h5, as viewed with the following commands:
             h5dump copy1.h5
             h5dump copy2.h5


C:

Fig. S.1a   copy1.h5 in DDL

   HDF5 "copy1.h5" {
   GROUP "/" {
      DATASET "Copy1" {
         DATATYPE { H5T_STD_I32BE }
         DATASPACE { SIMPLE ( 3, 4 ) / ( 3, 4 ) }
         DATA {
            0, 59, 0, 53,
            0, 0, 0, 0,
            0, 0, 0, 0
         }
      }
   }
   }
Fig. S.1b   copy2.h5 in DDL
   HDF5 "copy2.h5" {
   GROUP "/" {
      DATASET "Copy2" {
         DATATYPE { H5T_STD_I32BE }
         DATASPACE { SIMPLE ( 3, 4 ) / ( 3, 4 ) }
         DATA {
            1, 59, 1, 53,
            1, 1, 1, 1,
            1, 1, 1, 1
         }
      }
   }
   }

FORTRAN:

Fig. S.2a   copy1.h5 in DDL

   HDF5 "copy1.h5" {
   GROUP "/" {
      DATASET "Copy1" {
         DATATYPE { H5T_STD_I32BE }
         DATASPACE { SIMPLE ( 4, 3 ) / ( 4, 3 ) }
         DATA {
            0, 0, 0,
            53, 0, 0,
            0, 0, 0,
            59, 0, 0
         }
      }
   }
   }
Fig. S.2b   copy2.h5 in DDL
   HDF5 "copy2.h5" {
   GROUP "/" {
      DATASET "Copy2" {
         DATATYPE { H5T_STD_I32BE }
         DATASPACE { SIMPLE ( 4, 3 ) / ( 4, 3 ) }
         DATA {
            1, 1, 1,
            53, 1, 1,
            1, 1, 1,
            59, 1, 1
         }
      }
   }
   }

- - Last modified: 21 December 2016