 ←Prev
 AST
A Library for Handling
World Coordinate Systems
in Astronomy  Next→
 TOC ↑
Description:
This is
a fictitious routine which does not actually exist. Instead, this description constitutes a
template so that you may implement a routine with this interface for yourself (and give it
any name you wish). Such a routine may be passed via the FINTERP argument of the
AST_RESAMPLE$<$X$>$
functions (q.v.) in order to supply a 1dimensional interpolation kernel to the algorithm which performs
subpixel interpolation during resampling of gridded data (you must also set the INTERP argument of
AST_RESAMPLE
$<$X
$>$
to the value AST__UKERN1). This allows you to use your own interpolation kernel in addition to
those which are predefined.
The routine calculates the value of a 1dimensional subpixel interpolation kernel. This
determines how the weight given to neighbouring pixels in calculating an interpolated value
depends on the pixel’
s offset from the interpolation point. In more than one dimension,
the weight assigned to a pixel is formed by evaluating this 1dimensional kernel using
the offset along each dimension in turn. The product of the returned values is then used
as the pixel weight.
Invocation
CALL AST_UKERN1( OFFSET, PARAMS, FLAGS, VALUE,
STATUS )
Arguments
OFFSET = DOUBLE PRECISION (Given)
This will be the offset of
the pixel from the interpolation point, measured in pixels. This value may be positive or
negative, but for most practical interpolation schemes its sign should be ignored.
PARAMS(
$\ast $ ) =
DOUBLE PRECISION (Given)
This will be the same array as was given via the PARAMS argument of
AST_RESAMPLE$<$X$>$.
You may use this to pass any additional parameter values required by your kernel,
but note that PARAMS(1) will already have been used to specify the number of
neighbouring pixels which contribute to the interpolated value.
FLAGS = INTEGER
(Given)
This will be the same value as was given via the FLAGS argument of
AST_RESAMPLE$<$X$>$.
You may test this value to provide additional control over the operation of your routine.
Note that the special flag values AST__URESAMP1, 2, 3 & 4 are reserved for you to
use for your own purposes and will not clash with other predefined flag values (see
AST_RESAMPLE$<$X$>$).
VALUE = DOUBLE PRECISION (Returned)
The calculated kernel value, which may be positive
or negative.
STATUS = INTEGER (Given and Returned)
The global status.
Notes:

Not all functions make good interpolation kernels. In general, acceptable kernels tend to be
symmetrical about zero, to have a positive peak (usually unity) at zero, and to evaluate to zero
whenever the pixel offset has any other integral value (this ensures that the interpolated values pass
through the original data). An interpolation kernel may or may not have regions with negative values.
You should consult a good book on image processing for more details.

If an error occurs within this routine, it should set the STATUS argument
to an error value before returning. This will cause an immediate return from
AST_RESAMPLE$<$X$>$.
The error value AST__UK1ER is available for this purpose, but other values may also be used (e.g. if
you wish to distinguish different types of error). The AST__UK1ER error value is defined in the
AST_ERR include file.
Copyright (C) 2021 East Asian Observatory
 ←Prev
 AST
A Library for Handling
World Coordinate
Systems
in Astronomy  Next→
 TOC ↑