[Top] [Prev] [Next] [Bottom]

DFSDgetdata/dsgdata

intn DFSDgetdata(char *filename, intn rank, int32 dimsizes[], VOIDP data)
filename

IN:

Name of the file

rank

IN:

Number of dimensions

dimsizes

IN:

Dimensions of the data buffer

data

OUT:

Buffer for the data

Purpose

Reads the next dataset in the file.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

If the values of rank or dimsizes aren't known, DFSDgetdims must be called to retrieve them and then use them to determine the buffer space needed for the array data. If the data type of the data in a scientific dataset isn't know, DFSDgetNT must be called to retrieve it. Subsequent calls to DFSDgetdata (or to DFSDgetdims and DFSDgetdata)will sequentially read scientific datasets from the file. For example, if DFSDgetdata is called three times in succession, the third call reads data from the third scientific dataset in the file.

If DFSDgetdims or DFSDgetdata is called and there are no more scientific datasets left in the file, an error code is returned and nothing is read. DFSDrestart can be used to override this convention.

Example

The following code reads an array whose dimensions are known to be 100 x 200, and whose data type is known to be int16.

     #include "hdf.h"
     unit16 density[100][200];
     int32 sizes[2], ret;

     sizes[0] = 100;
     sizes[1] = 200;
     ret = DFSDgetdata ("myfile.hdf", 2, sizes, density);
 
FORTRAN

integer function dsgdata(filename, rank, dimsizes, data)

character* (*) filename

integer rank

integer dimsizes(*), data(*)



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.