[Back to Interface] [Prev] [Next]

SDreaddata/sfrdata/sfrcdata

intn SDreaddata(int32 sds_id, int32 start[], int32 stride[], int32 edge[], VOIDP buffer)

sds_id IN:

Data set identifier returned by SDcreate or SDselect

start IN:

Array specifying the starting location from where data is read

stride IN:

Array specifying the interval between the values that will be read along each dimension

edge IN:

Array specifying the number of values to be read along each dimension

buffer OUT:

Buffer to store the data read

Purpose

Reads a subsample of data from a data set or coordinate variable.

Return value

Returns SUCCEED (or 0) if successful or if the data set or coordinate variable contains no data and FAIL (or -1) otherwise.

Description

SDreaddata reads the specified subsample of data from the data set or coordinate variable identified by the parameter sds_id. The read data is stored in the buffer buffer. The subsample is defined by the parameters start, stride and edge.

The array start specifies the starting position from where the subsample will be read. Valid values of each element in the array start are from 0 to the size of the corresponding dimension of the data set - 1. The dimension sizes are returned by SDgetinfo.

The array edge specifies the number of values to read along each data set dimension.

The array stride specifies the reading pattern along each dimension. For example, if one of the elements of the array stride is 1, then every element along the corresponding dimension of the data set will be read. If one of the elements of the array stride is 2, then every other element along the corresponding dimension of the data set will be read, and so on. Specifying stride value of NULL in the C interface or setting all values of the array stride to 1 in either interface specifies the contiguous reading of data. If all values in the array stride are set to 0, SDreaddata returns FAIL (or -1). No matter what stride value is provided, data is always placed contiguously in the buffer.

When reading data from a "chunked" data set using SDreaddata, consideration should be given to the issues presented in the section on chunking in Chapter 3 of the HDF User's Manual, titled Scientific Data Sets (SD API) and Chapter 13 of the HDF User's Manual, titled HDF Performance Issues.

Note that there are two FORTRAN-77 versions of this routine; sfrdata and sfrcdata. The sfrdata routine reads numeric scientific data and sfrcdata reads character scientific data.

FORTRAN

integer function sfrdata(sds_id, start, stride, edge, buffer)

integer sds_id, start(*), stride(*), edge(*)

<valid numeric data type> buffer(*)

integer function sfrcdata(sds_id, start, stride, edge, buffer)

integer sds_id, start(*), stride(*), edge(*)

character*(*) buffer



[Back to Interface] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.