The features described in this topic are obsolete
and should not be used in new IDL code.
HDF_DFSD_SETINFO
This routine is obsolete and should not be used in new IDL code.
The HDF_DFSD_SETINFO procedure controls information associated with an HDF 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:
or
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:
is the same as:
HDF_DFSD_SETINFO, LABEL='hi', UNIT='', FORMAT='', COORDSYS='' HDF_DFSD_SETINFO, LABEL='', UNIT='ergs', FORMAT='', COORDSYS=''
Syntax
HDF_DFSD_SETINFO [, CALDATA=structure] [, /CLEAR] [, COORDSYS=string] [, DIMS=vector] [, /BYTE | , /DOUBLE | , /FLOAT, | , /INT | , /LONG] [, FORMAT=string] [, LABEL=string] [, LEN_LABEL=value] [, LEN_UNIT=value] [, LEN_FORMAT=value] [, LEN_COORDSYS=value] [, RANGE=[max, min]] [, /RESTART] [, UNIT=string]
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 uncalib.data.
Some typical values for the Num_Type field include:
For byte data:
For integer data:
For long-integer data:
For floating-point data:
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:
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:
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'