The HDF_SD_SETINFO procedure sets information about an SD dataset.
CAUTION: Setting a label, unit, format, or coordinate system string that has more than 256 characters can have unpredictable results.
Set this keyword to a two dimensional array that contains the minimum and maximum values of the SD dataset.
Set this keyword to a structure that contains the calibration data. This structure must contain five tags as shown below. The first four tags are of double-precision floating-point type. The fifth tag should be a long integer that specifies the HDF number type. The structure should have the following form:
CALDATA={ Cal: 0.0D $ ; Calibration Factor
Cal_Err: 0.0D $ ; Calibration Error
Offset: 0.0D $ ; Uncalibrated Offset
Offset_Err: 0.0D $ ; Uncalibrated Offset Error
Num_Type: 0L } ; Number Type of Uncalibrated Data
The relationship between HDF and IDL number types is illustrated by the following table:
The relationship between the calibrated data (CD) and the uncalibrated data (UD) is given by the equation:
CD = Cal * (UD - Offset) ; Cal and Offset are the values of the Cal; and Offset; structure fields described above.
sd_id = HDF_SD_START('demo.hdf', /RDWR)
;
Open an HDF file.
sds_id = HDF_SD_CREATE(sd_id, 'variable1', [10, 20], /DOUBLE)
;
Define a new dataset for the file.
CAL={Cal:1.0D, Cal_Err:0.1D, Offset:2.5D, Offset_Err:0.1D, $
Num_Type:6L} ; Create a calibration data structure.
HDF_SD_SETINFO, sds_id, LABEL='label1', unit='unit1', $
format='format1', coordsys='coord1', $
FILL=999.991, RANGE=[99.99,-78], caldata=CAL
;
Set information about the dataset.
HDF_SD_GETINFO, sds_id, LABEL=l, UNIT=u, FORMAT=f, $
COORDSYS=c, FILL=fill, RANGE=r, CALDATA=cd, $
NDIMS=ndims, DIMS=dims, TYPE=ty
;
Retrieve the information.
HELP, l, u, f, c, fill, r, cd, ndims, dims, ty
;
Print information about the returned variables.
CD STRUCT = -> < Anonymous > Array(1)
PRINT, cd ; Print the calibration data.
{ 1.0000000 0.10000000 2.5000000 0.10000000 6}
PRINT, dims ; Print the dimensions.
HDF_SD_END , HDF_SD_ENDACCESS , HDF_SD_GETINFO , HDF_SD_START