[Top] [Prev] [Next]

12.2 The DFSD Scientific Data Set Data Model

The scientific data set, or SDS, data model supports four primary data objects: arrays, dimensions, dimension scales, and dimension attributes. As in the multifile SD SDS model, the fundamental object of the data model is the SDS array. Unlike the SD multifile SDS model the DFSD SDS model has, in addition to dimension attributes, attributes that refer to the SDS array itself.

FIGURE 12a - The Contents of a Three-Dimensional DFSD Scientific Data Set

12.2.1 Required DFSD SDS Objects

The only required objects in the DFSD SDS model are the array and the data type of the array data. Without this information, the data set is inaccessible. Required objects are created by the library using the information supplied at the time the SDS is defined.

Descriptions of these objects are in Chapter 3, Scientific Data Sets (SD API).

12.2.1.1 Dimensions

Unlimited dimensions, supported in the multifile SD SDS model, aren't supported in the single-file DFSD SDS model.

12.2.2 Optional DFSD SDS Objects

There are two types of optional objects available for inclusion in an SDS: dimension scales and attributes. Optional objects are only created when specified by the calling program.

12.2.2.1 Dimension Scales

Conceptually, a dimension scale is a series of numbers placed along a dimension to demarcate intervals in a data set. They are assigned one per dimension. Structurally, each dimension scale is a one-dimensional array with size and name equal to its assigned dimension name and size.

12.2.2.2 Predefined Attributes

Predefined attributes are attributes that have reserved labels and in some cases predefined number types. They are described in Chapter 3, Scientific Data Sets (SD API).

12.3 The Single-File Scientific Data Set Interface

The HDF library currently contains several routines for storing scientific data sets in the HDF format. DFSDadddata, DFSDputdata, and DFSDgetdata perform data I/O and by default assume that all scientific data is uncompressed 32-bit floating-point data stored in row-major order. DFSD library routines also read and write subsets and slabs of data, set defaults, determine the number of data sets in a file, and inquire about or assigning reference numbers before reading or writing data.

12.3.1 DFSD Library Routines

The names of the C routines in the DFSD library are prefaced by "DFSD" and the names of the equivalent FORTRAN-77 functions are prefaced by "ds". They are categorized as follows:

DFSD library routines are more explicitly defined in Table A and on their respective pages in the HDF Reference Manual.

TABLE 12A - DFSD Library Routines

Category
Routine Name
Description
C
FORTRAN-77
Write
DFSDadddata dsadata Appends a data set to a file.

DFSDclear dsclear Clears all possible set values.

DFSDputdata dspdata Overwrites new data to a file.

DFSDsetdims dssdims Sets the rank and dimension for succeeding data sets.

DFSDsetNT dssnt Sets the number type for the data set.

DFSDwriteref dswref Assigns a reference number to the next data set written.

Read
DFSDgetdata dsgdata Retrieves the next data set in the file.

DFSDgetdims dsgdims Returns the number and dimensions for the next data set.

DFSDgetNT dsgnt Determines the number type for the data in the data set.

DFSDlastref dslref Returns the reference number of last data set accessed.

DFSDndatasets dsnum Returns the number of data sets in a file.

DFSDpre32sdg dsp32sd Determines if the data set was created before HDF version 3.2.

DFSDreadref dsrref Locates a data set with the specified reference number.

DFSDrestart dsfirst Sets the location of the next access operation to be the first data set in the file.

Slabs
DFSDendslab dssslab Terminates a read or write slab operation.

DFSDreadslab dsrslab Reads a slab of data from a data set.

DFSDstartslab dssslab Begins a read or write slab operation.

DFSDwriteslab dswslab Writes a slab of data to a data set.

Data Set Attribute
DFSDgetcal dsgcal Retrieves the calibration information for the data se.t

DFSDgetdatalen dsgdaln Retrieves the length of the attributes assigned to the data.

DFSDgetdatastrs dsgdast Returns the label, unit, format and coordinate system for data.

DFSDgetfillvalue dsgfill Retrieves the fill value used to complete the data set.

DFSDgetrange dsgrang Retrieves the range of values for the data set.

DFSDsetcal dsscal Sets the calibration information for the data set.

DFSDsetdatastrs dssdast Sets label, unit, format and coordinate system for data.

DFSDsetfillvalue dssfill Sets the fill value to use when completing a data set.

DFSDsetlengths dsslens Sets the length for the data set and dimension attributes.

DFSDsetrange dssrang Sets the range of values for the data set.

Dimension Attribute
DFSDgetdimlen dsgdiln Retrieves the length of the attributes assigned to the dimension.

DFSDgetdimscale dsgdisc Returns the scale for a dimension.

DFSDgetdimstrs dsgdist Returns the label, unit, and format for a dimension.

DFSDsetdimscale dssdisc Sets the scale for a dimension.

DFSDsetdimstrs dssdist Sets the label, unit and format for the dimension.

12.3.2 File Identifiers in the DFSD Interface

File identifiers are handled internally by each routine and access to a file is granted simply by providing a filename. As the file identifier is handled by the function call, the calling program need not keep track of how to open and close files.



[Top] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF User's Guide - 05/19/99, NCSA HDF Development Group.