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

SDcreate/sfcreate

int32 SDcreate(int32 sd_id, char *name, int32 data_type, int32 rank, int32 dimsizes[])
sd_id

IN:

SD interface identifier returned from SDstart

name

IN:

ASCII string defining a variable name

data_type

IN:

Data type for the values in the dataset

rank

IN:

Number of dimensions in the dataset

dimsizes

IN:

Size of each dimension

Purpose

Creates a new dataset.

Return value

Returns the sds_id if successful and FAIL (or -1) otherwise.

Description

If name is NULL a fake name will be generated. The name will be truncated to the MAX_NC_NAME length as specified in the HDF header files.

Once a dataset has been created, it is impossible to change its name, data type, or rank. However, it is possible to create a dataset and close the file before writing any data values to it. The values can be added or modified at a future time. If you wish to add data or modify an existing dataset, use SDselect to get the sds_id.

In C, if dimsizes[0] is assigned the value SD_UNLIMITED then this dimension is considered to be an "unlimited dimension" and the user can append data to this dimension at will. In Fortran-77, dimsizes(rank) is the only dimension that can be unlimited. This is useful when the eventual size of a dataset is not known at creation time.

MAX_VAR_DIMS is the maximum rank a dataset can have.

Valid values for data_type are prefaced by DFNT_. The following are valid symbolic names and their data types:

32-bit float DFNT_FLOAT32 5
64-bit float DFNT_FLOAT64 6
8-bit signed int DFNT_INT8 20
8-bit unsigned int DFNT_UINT8 21
16-bit signed int DFNT_INT16 22
16-bit unsigned int DFNT_UINT16 23
32-bit signed int DFNT_INT32 24
32-bit unsigned int DFNT_UINT32 25
8-bit unsigned character DFNT_CHAR8 4
FORTRAN

integer function sfcreate(sd_id, name, data_type, rank, dimsizes)

character* (*) name

integer sd_id, data_type, rank, dimsizes(*)



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

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