[Back to Interface] [Prev] [Next]

DFSDgetcal/dsgcal

int32 DFSDgetcal(float64 *cal, float64 *cal_err, float64 *offset, float64 *offset_err, int32 *data_type)

cal OUT:

Calibration factor

cal_err OUT:

Calibration error

offset OUT:

Uncalibrated offset

offset_err OUT:

Uncalibrated offset error

data_type OUT:

Data type of uncalibrated data

Purpose

Retrieves the calibration record, if there is one, attached to a scientific dataset.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

A calibration record contains four 64-bit floating point values followed by a 32-bit integer.

The relationship between a value iy stored in a dataset and the actual value y is defined as:

y = cal * (iy - offset)

The variable offset_err contains a potential error of offset, and cal_err contains a potential error of cal. Currently the calibration record is provided for information only. The SD interface performs no operations on the data based on the calibration tag.

As an example, suppose the values in the calibrated dataset iy[] are the following integers:

iy[6] = {2, 4, 5, 11, 26, 81}

By defining cal = 0.50 and offset = -200.0 and applying the calibration formula, the calibrated dataset iy[] returns to its original form as a floating point array:

y[6] = {1001.0, 1002.0, 1002.5, 1005.5, 1013.0,1040.5}

FORTRAN

integer function dsgcal(cal, cal_err, offset, offset_err, data_type)

real cal, cal_err, offset, offset_err

integer data_type



[Back to Interface] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.