- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑
Description:
This routine compresses an n-dimensional array by integer factors along each dimension
by summing the array values in a rectangular box. The output may be normalised to take
account of any bad values that may be present.
Invocation
CALL KPG1_CMADx( NDIM, DIMS,
INARR, COMPRS, NLIM, NORMAL, OUTARR, SUM, NUM, STATUS )
Arguments
NDIM =
INTEGER (Given)
The dimensionality of the n-dimensional array. It must be greater than
one. To handle a one-dimensional array, give it a second dummy dimension of 1.
DIMS(
NDIM ) = INTEGER (Given)
The dimensions of the input n-dimensional array.
INARR(
) = ?
(Given)
The input n-dimensional data array.
COMPRS( NDIM ) = REAL (Given)
The factors along
each dimension by which the input array is compressed to form the output array.
NLIM = INTEGER
(Given)
The minimum number of good input elements in a compression box that permits the
corresponding output array element to be good. If fewer than NLIM pixels participated in the sum,
the output pixel will be bad.
NORMAL = LOGICAL (Given)
If true, the summation is normalised
to allow for bad data, i.e. the sum with each box is multiplied by the ratio of the total number of
pixels in the box to the actual number included to yield the output pixel value. If false, the
output array element just equates to the sum of good pixels within each box.
OUTARR(
) = ? (Write)
The compressed n-dimensional array. Its dimension I must be given by DIMS( I )/COMPRS( I ).
SUM(
) = ? (Returned)
Workspace used for efficiency in computing the summations. This should have size at least equal to DIMS(
1 ).
NUM( )
= INTEGER (Returned)
Workspace used to count the number of good elements in the input box. This
should have size at least equal to DIMS( 1 ).
STATUS = INTEGER (Given and Returned).
Global
status value
Notes:
-
There is a routine for the following numeric data types: replace "
x"
in the routine name by D or R as
appropriate. The input and output data arrays plus a work space must have the data type
specified.
-
There is no protection against overflows when the absolute data values are very large.
Bugs:
{note_bugs_here}
- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑