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

3.3 The SD Scientific Data Set API

Unlike the DFSD SDS interface, the SD interface supports simultaneous access to more than one SDS in more than one HDF file. Although it is fully compatible with the DFSD data model, the SD interface also supports a more powerful and more general scientific data model; one that is very similar to the netCDF data model developed by the Unidata Program Center.

All valid operations involving an SDS can be done by calling routines in the SD interface. Except in rare instances, the physical file format used to store HDF data is transparent to HDF users.

3.3.1 SD Library Routines

All C routines in the SD scientific data library begin with the prefix "SD". The equivalent Fortran-77 functions use the prefix "sf". These routines are categorized as follows:

The SD routines are described in the following table and in the HDF Reference Guide.

TABLE 3A SD Library Routines
Category

Routine Name

Description

C

Fortran-77

Access

SDend

sfend

Closes the file and clean up memory.

SDendaccess

sfendacc

Disposes of a data set identifier, flush out metadata and order information.

SDselect

sfselect

Returns the identifier of the specified data set.

SDstart

sfstart

Initializes the SD interface.

Read and Write

SDcreate

sfcreate

Creates a new data set.

SDreaddata

sfrdata/

sfrcdata

Reads data from a chunked or non-chunked data set.

SDsetexternalfile

sfsextf

Defines the data type to be stored in an external file.

SDwritedata

sfwdata/

sfwcdata

Writes data to a chunked or non-chunked data set.

General Inquiry

SDfileinfo

sffinfo

Returns information about the contents of a file.

SDgetinfo

sfginfo

Returns information about a data set.

SDidtoref

sfid2ref

Returns a reference number for a named data set.

SDiscoordvar

sfiscvar

Distinguishes data sets from dimension scales.

SDnametoindex

sfn2index

Returns an index of a specified data set.

SDreftoindex

sfref2index

Returns the index of a data set corresponding to a given reference number.

Dimension Scales

SDdiminfo

sfgdinfo

Gets information about a dimension.

SDgetdimid

sfdimid

Retrieves the identifier of a dimension.

SDsetdimname

sfsdimname

Associates a name with a dimension.

SDgetdimscale

sfgdscale

Returns scale values for a dimension.

SDsetdimscale

sfsdscale

Defines the values of this dimension.

User-defined Attributes

SDattrinfo

sfgainfo

Gets information about an attribute.

SDfindattr

sffattr

Returns the index of the specified attribute.

SDreadattr

sfrnatt/

sfrcatt

Reads the values of the specified attribute.

SDsetattr

sfsnatt/

sfscatt

Creates and defines a new attribute.

Predefined Attributes

SDgetcal

sfgcal

Returns calibration information.

SDgetdatastrs

sfgdtstr

Returns the label, limit, format and coordinate system of a data set.

SDgetdimstrs

sfgdmstr

Returns the attribute strings for a dimension.

SDgetfillvalue

sfgfill/

sfgcfill

Reads the fill value if it exists.

SDgetrange

sfgrange

Returns the range of values of the specified data set.

SDsetcal

sfscal

Defines the calibration information.

SDsetdatastrs

sfsdtstr

Defines the attribute strings of the specified data set.

SDsetdimstrs

sfsdmstr

Defines the attribute strings of the specified dimension.

SDsetfillvalue

sfsfill/

sfscfill

Defines the fill value of the current data set.

SDsetfillmode

sfsflmd

Defines the file mode to be applied to all SDSs in the specified file.

SDsetrange

sfsrange

Defines the maximum and minimum values of the valid range.

Compression

SDsetcompress

None

Defines the compression method to be applied to data set data.

Chunking/

Tiling

SDgetchunkinfo

None

Obtains information about a chunked SDS.

SDsetchunkcache

None

Sets the size of the chunk cache.

SDsetchunk

None

Makes a non-chunked SDS a chunked SDS.

SDwritechunk

None

Writes data to a chunked SDS.

SDreadchunk

None

Reads data from a chunked SDS.

N-bit Data

Length

SDsetnbitdataset

sfsnbit

Defines the non-standard bit length of the data set data.

3.3.2 SDS Identifiers in the SD Interface

In the SD interface, scientific data sets are identified in several ways. Before a data set is accessible, it is identified by index, name and reference number. After it is opened, it is identified by a data set identifier or SDS id.

The index describes the relative position of the data set in the file. The name is a unique character string and the reference number is a unique integer which are both assigned to the data set when it is created. The index, name, and reference number are needed to obtain a data set id.

The SDS id is the data set equivalent of a file identifier and uniquely identifies an SDS data set within a file. It is created when an existing SDS is selected for use or when a new SDS is created and is thereafter used to access the SDS.

3.3.3 Tags in the SD Interface

A complete list of SDS tags and their descriptions is in Table D in the User's Guide Appendix.



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

hdfhelp@ncsa.uiuc.edu
HDF User's Guide - 06/04/97, NCSA HDF Development Group.