DS_GET_DATA_SCALING(3)

EXPERIMENTAL_FUNC
ds_get_data_scaling - Get the scale and offset for a data element in a packet.

SYNOPSIS
#include <karma_ds.h>

flag ds_get_data_scaling

(CONST char *elem_name, CONST packet_desc *pack_desc, CONST char *packet, double *scale, double *offset)

DESCRIPTION
This routine will determine the scale and offset for data in a packet. This may be important when a floating-point array has been converted to an integer array to save space. Scaling information should be attached to the array so that the original data values may be reconstructed (aside from quantisation effects). The following expression may be used to convert scaled values to real values: (output = input * scale + offset). The scaling and offset values should previously have been attached to the array using an appropriate routine. No low-level routine currently exists to do this, but higher-level support is given by the <-iarray_set_data_scaling-> routine.

elem_name
    The name of the element.

pack_desc
    The packet descriptor.

packet
    The packet.

scale
    The scaling value will be written here. The name of the scaling value is constructed by appending "__SCALE" to the element name. If no scaling value is found, 1.0 is written here. As a fallback, if the FITS-style "BSCALE" keyword is found and is appropriate, this is used.

offset
    The offset value will be written here. The name of the offset value is constructed by appending "__OFFSET" to the element name. If no offset value is found, 0.0 is written here. As a fallback, if the FITS-style "BZERO" keyword is found and is appropriate, this is used.

RETURN VALUE
TRUE if either the scaling or offset value were found, else FALSE

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/