next up previous 237
Next: THE NDF_ LIBRARY C INTERFACE
Up: FORTRAN ROUTINE DESCRIPTIONS
Previous: NDF_ZDELT - Create a compressed copy of an NDF using DELTA compression


NDF_ZSCAL - Create a compressed copy of an NDF using SCALE compression

Description:
The routine creates a new NDF holding a compressed copy of the supplied NDF. The compression is performed by scaling the DATA and VARIANCE arrays using a simple linear scaling, and then casting the scaled values into the specified data type. The amount of compression, and the amount of information lost, is thus determined by the input and output data types. For instance, if the input NDF is of type _DOUBLE (eight bytes) and the output is of type _WORD (two bytes), the compression ratio for each array component will be four to one.

Invocation:
CALL NDF_ZSCAL( INDF1, TYPE, SCALE, ZERO, PLACE, INDF2, STATUS )

Arguments:

INDF1 = INTEGER (Given)
Identifier for the input NDF.
TYPE = CHARACTER $*$ ( $*$ ) (Given)
Numeric type of the output NDF's DATA component (e.g. '_REAL' or '_INTEGER').
SCALE( 2 ) = DOUBLE PRECISION (Given and Returned)
The scale factors to use when compressing the array components in the supplied NDF. The DATA array will be scaled using SCALE( 1 ) and the VARIANCE array - if present - will be scaled using SCALE( 2 ). If either of these is set to VAL__BADD, then a suitable value will be found automatically by inspecting the supplied array values. The values actually used will be returned on exit. See "Notes:" below. On exit, any supplied values will be rounded to values that can be represented accurately in the data type of the input NDF.
ZERO( 2 ) = DOUBLE PRECISION (Given and Returned)
The zero offsets to use when compressing the array components in the supplied NDF. The DATA array will be offset using ZERO( 1 ) and the VARIANCE array - if present - will be offset using ZERO( 2 ). If either of these is set to VAL__BADD, then a suitable value will be found automatically by inspecting the supplied array values. The values actually used will be returned on exit. See "Notes:" below. On exit, any supplied values will be rounded to values that can be represented accurately in the data type of the input NDF.
PLACE = INTEGER (Given and Returned)
An NDF placeholder (e.g. generated by the NDF_PLACE routine) which indicates the position in the data system where the new NDF will reside. The placeholder is annulled by this routine, and a value of NDF__NOPL will be returned (as defined in the include file NDF_PAR).
INDF2 = INTEGER (Returned)
Identifier for the new NDF.
STATUS = INTEGER (Given and Returned)
The global status.

Notes:



next up previous 237
Next: THE NDF_ LIBRARY C INTERFACE
Up: FORTRAN ROUTINE DESCRIPTIONS
Previous: NDF_ZDELT - Create a compressed copy of an NDF using DELTA compression

NDF [1ex
Starlink User Note 33
R.F. Warren-Smith & D.S. Berry
16th July 2012
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council