Perform sub-pixel interpolation on a grid of data astUinterp
"
finterp"
parameter of the
astResampleX
functions (q.v.) in order to perform sub-pixel interpolation during
resampling of gridded data (you must also set the "
interp"
parameter of
astResampleX
to the value AST__UINTERP). This allows you to use your own interpolation algorithm in
addition to those which are pre-defined.
The function interpolates an input grid of data (and, optionally, processes associated statistical variance estimates) at a specified set of points.
"
ndim_in"
elements,
containing the coordinates of the centre of the first pixel in the input grid along
each dimension. "
ndim_in"
elements,
containing the coordinates of the centre of the last pixel in the input grid along each
dimension.
Note that "
lbnd_in"
and "
ubnd_in"
together define the shape, size
and coordinate system of the input grid in the same way as they do in
astResampleX.
"
in"
parameter. The numerical type of this array should match that of the data
being processed. "
in"
array. If given, this will contain the set of variance values
associated with the input data and will be the same array as was passed to
astResampleX
via the "
in_var"
parameter.
If no variance values are being processed, this will be a NULL pointer.
"
npoint"
elements. For each
interpolation point, this will contain the zero-based index in the "
out"
(and "
out_var"
) array(s) at which the interpolated value (and its variance, if required)
should be stored. For example, the interpolated value for point number "
point"
should
be stored in "
out[offset[point]]"
(assuming the index "
point"
is zero-based). "
ndim_in"
elements. Element "
coords[coord]"
will point at the first element of an array of double (with "
npoint"
elements) which contains the values of coordinate number "
coord"
for each
interpolation point. The value of coordinate number "
coord"
for interpolation point
number "
point"
is therefore given by "
coords[coord][point]"
(assuming both indices
are zero-based).
If any interpolation point has any of its coordinates equal to the value AST__BAD (as
defined in the "
ast.h"
header file), then the corresponding output data (and variance)
should either be set to the value given by "
badval"
, or left unchanged, depending on
whether the AST__NOBAD flag is specified by "
flags"
.
"
params"
parameter of
astResampleX.
You may use this to pass any additional parameter values required by your interpolation
algorithm. "
flags"
parameter of
astResampleX.
You may test this value to provide additional control over the operation of your resampling
algorithm. 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 pre-defined flag values (see
astResampleX).
"
badval"
parameter of
astResampleX,
and will have the same numerical type as the data being processed (i.e. as elements
of the "
in"
array). It should be used to test for bad pixels in the input
grid (but only if the AST__USEBAD flag is set via the "
flags"
parameter) and
(unless the AST__NOBAD flag is set in "
flags"
) for identifying bad output
values in the "
out"
(and "
out_var"
) array(s). "
in"
array, into which the interpolated
data values should be returned. Note that details of the storage order and
number of dimensions of this array are not required, since the "
offset"
array
contains all necessary information about where each returned value should be
stored.
In general, not all elements of this array (or the "
out_var"
array below) may be used
in any particular invocation of the function. Those which are not used should be
returned unchanged.
"
out"
array, into which variance estimates for the resampled values should
be returned. This array will only be given if the "
in_var"
array has also been
given.
If given, it is addressed in exactly the same way (via the "
offset"
array) as the "
out"
array. The values returned should be estimates of the statistical variance of the
corresponding values in the "
out"
array, on the assumption that all errors in input
data values are statistically independent and that their variance estimates may simply
be summed (with appropriate weighting factors).
If no output variance estimates are required, a NULL pointer will be given.
"
npoint"
, and the minimum is zero (indicating that all output values were
successfully obtained). The data type Xtype indicates the numerical type of the data being processed, as for astResampleX.
This function will typically be invoked more than once for each invocation of astResampleX.
If an error occurs within this function, it should use astSetStatus to set the AST error status to an error value. This will cause an immediate return from astResampleX. The error value AST__UINER is available for this purpose, but other values may also be used (e.g. if you wish to distinguish different types of error).