c_stget - Reads a specified data item associated with a given node

SYNTAX

#include "statio.h"

FUNCTION c_stget (fd, data_type, ic, is, shape, buf)

     long               *fd;
     char               *data_type;
     long               *ic;
     long               *is;
     long                shape[9];
     unsigned char      *buf;

PARAMETERS

fd (input, integer)

File descriptor of an opened statistics file. The file descriptor is set by c_stopen() and should not be altered.

data_type (input, character, length(1:26))

The data type to read. This is the name of the statistical data item. Some examples are: "NBANDS," "HISTOGRAM," "MEAN_VECTOR," "POLYGON," etc.

ic (input, integer)

The index of the class to be read from. Class numbers have the range 1 - 256. Zero can be given to specify that image level data is to be read and the number of classes are returned. In that case, is must also be zero.

is (input, integer)

The index of the site to be read from. Site numbers have the range 1 - 256. If zero is given and ic s also zero, then class level data for that class is read and the number of sites for that class are returned.

shape (output, integer array)

The shape vector for the data. Shape is an array of nine elements. The first element specifies the data type. Permissible values are:

          = EBYTE:     byte data
          = EWORD:     16-bit integer
          = ELONG:     32-bit integer
          = EREAL:     single-precision floating point number
          = EDOUBLE:   double-precision floating point number
          = ECOMP:     single-precision complex number
          = EDCOMP:    double-precision complex number
The second element is the number of indices associated with the data. For example, if the data is a matrix, then specify 2. The range for this element is 1 -7.

The remaining seven elements are the ranges of the indices.

buf (output, array)

The buffer to read data into. This should be large enough to hold the data. The data type will be returned in the shape array.

DESCRIPTION

The c_stget() routine locates the node indicated by ic and is and looks for the data type at that level. If found, the shape and data are read and returned to the calling program.

RETURN VALUE

c_stget() returns

     E_SUCC  (0) --> successful read
     E_NOCL  (2) --> class ic not found (no message)
     E_NOSI  (3) --> site is not found (no message)
     E_NODT  (4) --> datatype not found (no message)
     E_GNLIO (1) --> general I/O error (no message)