KPG1_BLOCx

Smooths a two-dimensional image using a rectangular box filter

Description:

The routine smooths a two-dimensional image using a rectangular box filter; each pixel is replaced by the mean of those good neighbours which lie within a box of specified size.

Invocation

CALL KPG1_BLOCx( BAD, SAMBAD, VAR, NX, NY, A, IBOXX, IBOXY, NLIM, B, BADOUT, ASUM, NSUM, STATUS )

Arguments

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.
NX = INTEGER (Given)
First dimension of the image to be smoothed.
NY = INTEGER (Given)
Second dimension of the image to be smoothed.
A( NX, NY ) = ? (Given)
Input image to be smoothed.
IBOXX = INTEGER (Given)
Half-size of the smoothing box in pixels in the X direction (the actual size of the box used will be 2IBOXX+1 pixels).
IBOXY = INTEGER (Given)
Half-size of the smoothing box in pixels in the Y direction (the actual size of the box used will be 2IBOXY+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.
B( NX, NY ) = ? (Returned)
The smoothed output image.
BADOUT = LOGICAL (Returned)
Whether bad pixels are present in the output image.
ASUM( NX ) = ? (Returned)
Workspace for the pixel sums.
NSUM( NX ) = INTEGER (Returned)
Workspace for counting good pixels.
STATUS = INTEGER (Given and Returned)
The global status.

Notes: