HDF_DFSD_SETINFO

The HDF_DFSD_SETINFO procedure controls information associated with a Hierarchical Data Format file. Because of the manner in which the underlying HDF library was written, it is necessary to set the dimensions and data type of a scientific data set the first time that HDF_DFSD_SETINFO is called.

This procedure has many options, controlled by keywords. The order in which the keywords are specified is unimportant as the routine insures the order of operation for any given call to it. CLEAR and RESTART requests are performed first, followed by type and dimension setting, followed by length setting, followed by the remaining keyword requests.

If you are not writing any ancillary information, you can call HDF_DFSD_ADDDATA with the SET_TYPE and/or SET_DIMS keywords.

Data string lengths should be set before, or at the same time as, writing the corresponding data string. For example:

HDF_DFSD_SETINFO, LEN_FORMAT=10, FORMAT='12.3F'

or

HDF_DFSD_SETINFO, LEN_FORMAT=10

HDF_DFSD_SETINFO, FORMAT='12.3F'

Due to the underlying C routines, it is necessary to set all four data strings at the same time, or the unspecified strings are treated as `' (null strings). For example:

HDF_DFSD_SETINFO, LABEL = 'hi'

HDF_DFSD_SETINFO, UNIT = 'ergs'

is the same as:

HDF_DFSD_SETINFO, LABEL='hi', UNIT='', FORMAT='', COORDSYS=''

HDF_DFSD_SETINFO, LABEL='', UNIT='ergs', FORMAT='', COORDSYS=''

Calling Sequence

HDF_DFSD_SETINFO

Arguments

None.

Keywords

BYTE

Set this keyword to make the SDS data type DFNT_UINT8 (1-byte unsigned integer).

CALDATA

Set this keyword to a structure containing calibration information. The structure should contain five tags, the first four of which are double-precision floating-point, and fifth of which should be long integer. For example:

caldata = { Cal:          1.0d $ ; Calibration factor.

            Cal_Err:      0.1d $ ; Calibration error.

            Offset:       2.5d $ ; Uncalibrated offset.

            Offset_Err:   0.1d $ ; Uncalibrated offset error.

            Num_Type:     5L   $ ; Number type of uncalibrated

} ; data.

Some typical values for the Num_Type field include:

For byte data:

3L     (DFNT_UCHAR8)

21L    (DFNT_UINT8)

For integer data:

22L    (DNFT_INT16)

For long-integer data:

24L    (DFNT_INT32)

For floating-point data:

5L     (DFNT_FLOAT32)

6L     (DFNT_FLOAT64)

There are other types, but they are not native to IDL. They can be found in the hdf.h header file for the HDF library.

CLEAR

Set this keyword to reset all possible set values to their default value.

COORDSYS

A string for the data coordinate system description.

DIMS

Set this keyword to a vector of dimensions to be used in writing the next SDS. For example:

HDF_DFSD_SETINFO, DIMS = [10, 20, 30]

DOUBLE

Set this keyword to make the SDS data type DFNT_FLOAT64 (8-byte floating point).

FLOAT

Set this keyword to make the SDS data type DFNT_FLOAT32 (4-byte floating point).

FORMAT

A string for the data format description.

INT

Set this keyword to make the SDS data type DFNT_INT16 (2-byte signed integer).

LABEL

A string for the data label description.

LEN_LABEL

The label string length (default is 255).

LEN_UNIT

The unit string length (default is 255).

LEN_FORMAT

The format string length (default is 255).

LEN_COORDSYS

The format coordinate system string length (default is 255).

LONG

Set this keyword to make the SDS data type DFNT_INT32 (4-byte signed integer).

RANGE

The minimum and maximum range, represented as a 2-element vector of the same data type as the data to be written. The first element is the maximum, the second is the minimum. For example:

HDF_DFSD_SETINFO, RANGE = [10,0]

RESTART

Set this keyword to make the get (HDF_DFSD_GETSLICE) routine read from the first SDS in the file.

UNIT

A string for the data unit description.

Example

Write a 100x50 array of longs:

data = LONARR(100, 50)

HDF_DFSD_SETINFO, /CLEAR, /LONG, DIMS=[100,50], $

              RANGE=[MAX(data), MIN(data)], $

              LABEL='pressure', UNIT='pascals', $

              FORMAT='F10.0'