KPG1_BILNR

Performs bi-linear interpolation checking for bad values

Description:

An imaginary pixel is centred on the supplied interpolation position. The area of the overlap between this imaginary pixel and each of the four surrounding real pixels is found, and used as the weight for the corresponding pixel value. The returned interpolated value is the weighted mean of the four surrounding pixel values. A bad value is returned if any of these four pixels lie outside the image or have a bad value.

The associated variance value is also returned if input variances are supplied.

Invocation

CALL KPG1_BILNR( X, Y, XLO, XHI, YLO, YHI, USEVAR, DATA, VAR, INTERP, INTERV, STATUS )

Arguments

X = REAL (Given)
The pixel X co-ordinate at which to perform the interpolation.
Y = REAL (Given)
The pixel Y co-ordinate at which to perform the interpolation.
XLO = INTEGER (Given)
The lower bound on the array X axis.
XHI = INTEGER (Given)
The upper bound on the array X axis.
YLO = INTEGER (Given)
The lower bound on the array Y axis.
YHI = INTEGER (Given)
The upper bound on the array Y axis.
USEVAR = LOGICAL (Given)
Should a variance be returned?
DATA( XLO:XHI, YLO:YHI ) = REAL (Given)
The data array to be interpolated.
VAR( XLO:XHI, YLO:YHI ) = REAL (Given)
The variance array (only accessed if USEVAR is .TRUE.).
INTERP = REAL (Returned)
The interpolated data value.
INTERV = REAL (Returned)
The interpolated variance value.
STATUS = INTEGER (Given and Returned)
The global status.