The routine
smooths an n-dimensional array using an n-dimensional box filter; each pixel is replaced by the mean
of those good neighbours which lie within a box of specified size.
CALL KPG_BLONx(
BAD, SAMBAD, VAR, NDIM, DIMS, A, IBOX, NLIM, WDIM, B, BADOUT, ASUM, NSUM, STATUS )
BAD = LOGICAL (Given)
Whether it is necessary to check for bad pixels in the input
image.
SAMBAD = LOGICAL (Given)
If a .TRUE. value is given for this argument, then
bad input pixels will be propagated to the output image unchanged (a smoothed output
value will be calculated for all other pixels). If a .FALSE. value is given, then the NLIM
argument determines whether an output pixel is good or bad. The value of SAMBAD is
not relevant if BAD is .FALSE..
VAR = LOGICAL (Given)
If a .FALSE. value is given
for this argument, then the smoothing applied will be appropriate to a data image. If a
.TRUE. value is given, then the smoothing will be appropriate to an image containing
variance values. In the latter case the output values will be (on average) smaller than the
input values to take account of the variance-reducing effect which smoothing produces.
NDIM = INTEGER (Given)
The number of dimensions of the array to be smoothed.
DIMS( NDIM ) = INTEGER (Given)
The dimensions of the array to be smoothed.
A(
) = ? (Given)
Input array to be smoothed. Its dimensions are given by argument DIMS.
IBOX( NDIM ) = INTEGER (Given)
Half-size of the smoothing box in pixels along eeach axis (the actual size of the ith axis’
s box used will be
2IBOX(i)1
pixels).
NLIM = INTEGER (Given)
Minimum number of good pixels which must be
present in the smoothing box in order to calculate a smoothed output pixel. If this minimum
number is not satisfied, then a bad output pixel will result. A value between 1 and the
total number of pixels in the smoothing box should be supplied.
WDIM = INTEGER
(Given)
The dimension of the ASUM and NSUM workspaces. It must be at least 1
DIMS( 1 ) for a two-dimensional
array , and at least 1
( DIMS(1) ... ( 1
DIMS(NDIM-1)
) ... ) for an NDIM-dimensional array. For example a 20x16x27-element array would need WLIM not fewer than
1(20(116)=341
elements.
B( )
= ? (Returned)
The smoothed output array. It has the same dimensions as A.
BADOUT =
LOGICAL (Returned)
Whether bad pixels are present in the output image.
ASUM(
) = ? (Returned)
Workspace
for the pixel sums.
NSUM(
) = INTEGER (Returned)
Workspace for counting good pixels.
STATUS = INTEGER (Given and
Returned)
The global status.