next up previous 62
Next: [VARIANT] = `SPACED'
Up: ARRAYStructure
Previous: [VARIANT] = `SIMPLE'

[VARIANT] = `SCALED'

A scaled $<$ARRAY$>$ is sometimes referred to as block floating point. When dealing with large-format data, disk space is a major consideration; significant space may be saved by storing data in a 16-bit form via the block floating-point format. Scaling may also be used as a means of implementing global scalar changes in the array's values without the need to change the array, or to move to a more expensive storage type (e.g. to $<$float$>$ from $<$_WORD$>$) in order to work with very small or very large values.


Table: Components of $<$ARRAY$>$ Structure, [VARIANT] = `SCALED'
Component Name TYPE Brief Description
[VARIANT] $<$_CHAR$>$ `SCALED'
[ORIGIN(NAXIS)] $<$integer$>$ origin of the data array
[DATA] $<$narray$>$ scaled numeric value at every pixel
[SCALE] $<$numeric$>$ scale factor
[ZERO] $<$numeric$>$ zero point

General-purpose applications will process the scaled variant. However, users may notice extra delays while the array is converted to $<$narray$>$ for processing and rescaled for storage at the end of each application. In such cases, they may prefer the alternative strategy of first running a utility application to convert the data to primitive floating point in a new container file, then performing their processing, and finally running another utility to convert the data back to the scaled-array form.

The numeric value of a pixel is:

         ZERO + DATA element * SCALE.

NAXIS
The number of axes in the array being represented.
[ORIGIN]
The pixel origin in each dimension. If this object is not present, each origin is assumed to be 1.
[DATA]
The array stored in scaled (block-floating-point) format. Mandatory.
[SCALE]
A positive scale factor used to convert the element of [DATA] to its unscaled $<$numeric$>$ form. If it is not present, or is negative, or is bad, an error condition results. It is evaluated as follows:
      SCALE = (MAX - MIN)/(TMAX<T> - TMIN<T>)
where MAX, MIN are the maximum and minimum valid (i.e. not bad) data values respectively, and TMAX<T>, TMIN<T> are the largest and smallest valid values for the primitive type of [DATA], represented by token <T>.
[ZERO]
The zero point used to convert the element of [DATA] to its unscaled $<$numeric$>$ form. If it is not present, or is undefined, a value of zero is assumed. It is evaluated as follows:
      ZERO = TMIN<T> - SCALE * MIN

The equivalent primitive type is the TYPE of [ZERO] or, if [ZERO] is absent, the TYPE of [SCALE]. If both [ZERO] and [SCALE] are missing the equivalent $<$numeric$>$ array defaults to TYPE $<$_REAL$>$.



next up previous 62
Next: [VARIANT] = `SPACED'
Up: ARRAYStructure
Previous: [VARIANT] = `SIMPLE'

Starlink Standard Data Structures
Starlink General Paper 38
Malcolm J Currie, P T Wallace &
R F Warren-Smith
1989 January 20
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council