Create a compressed copy of an NDF using DELTA compression


The routine creates a copy of the supplied NDF, and then compresses selected array components within the copy using delta compression. This compression is lossless, but only operates on arrays holding integer values. It assumes that adjacent integer values in each input array tend to be close in value, and so differences between adjacent values can be represented in fewer bits than the absolute values themselves. The differences are taken along a nominated pixel axis within the supplied array (specified by argument ZAXIS). Any input value that differs from its earlier neighbour by more than the data range of the selected data type is stored explicitly using the data type of the input array.

Further compression is achieved by replacing runs of equal input values by a single occurrence of the value with a correspsonding repetition count.

It should be noted that the degree of compression achieved is dependent on the nature of the data, and it is possible for a compressed array to occupy more space than the uncompressed array. The mean compression factor actually achieved is returned in argument ZRATIO (the ratio of the supplied NDF size to the compressed NDF size).




Identifier for the input NDF.
COMP = CHARACTER ( ) (Given)
A comma-separated list of component names to be compressed. These may be selected from DATA, VARIANCE or QUALITY. Additionally, if is supplied all three components will be compressed.
The minimum allowed compression ratio for an array (the ratio of the supplied array size to the compressed array size). If compressing an array results in a compression ratio smaller than or equal to MINRAT, then the array is left uncompressed in the returned NDF. If the supplied value is zero or negative, then each array will be compressed regardless of the compression ratio.
The index of the pixel axis along which differences are to be taken. If this is zero, a default value will be selected for each array that gives the greatest compression. An error will be reported if a value less than zero or greater than the number of axes in the input array is supplied.
TYPE = CHARACTER ( ) (Given)
The data type in which to store the differences between adjacent array values. This must be one of _BYTE, _WORD or _INTEGER. Additionally, a blank string may be supplied in which case a default value will be selected for each array that gives the greatest compression.
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.
ZRATIO = _REAL (Returned)
The mean compression ratio actually achieved for the array components specified by COMP. The compression ratio for an array is the ratio of the number of bytes needed to hold the numerical values in the supplied array, to the number of bytes needed to hold the numerical values in the compressed array. It does not include the small overheads associated with the extra labels, etc, needed to store compressed data, and so may be inaccurate for small arrays. Additionally, this ratio only takes the specified array components into account. If the NDF contains significant quantities of data in other components, then the overall compression of the whole NDF will be less.
STATUS = INTEGER (Given and Returned)
The global status.