Aligns a pair of two-dimensional NDFs by minimising the residuals between them.
where (${X}_{\text{in}}$,${Y}_{\text{in}}$) are pixel co-ordinates in the input NDF, and (${X}_{\text{ref}}$,${Y}_{\text{ref}}$) are pixel co-ordinates in the reference NDF. The coefficient values (${C}_{1}$–${C}_{6}$) are determined by doing a least-squares fit that minimises the sum of the squared residuals between the reference NDF and the transformed input NDF. If variance information is present in either NDF, it is used to determine the SNR of each pixel which is used to weight the residuals within the fit, so that noisy data values have less effect on the fit. The best fit coefficients are displayed on the screen and written to an output parameter. Optionally, the transformation may be applied to the input NDF to create an output NDF (see Parameter OUT). It is possible to restrict the transformation in order to prevent shear, rotation, scaling, etc. (see Parameter FORM).
It is possible to exclude from the fitting process areas of the input NDF that are poorly correlated with the corresponding areas in the reference NDF (e.g. flat background areas that contain only noise). See Parameter CORLIMIT.
[5]
TRUE
, then the output pixel values will be scaled in such a way as to
preserve the total data value in a feature on the sky. The scaling factor is the ratio of the
output pixel size to the input pixel size. This option can only be used if the Mapping is
successfully approximated by one or more linear transformations. Thus an error will be
reported if it used when the TOL parameter is set to zero (which stops the use of linear
approximations), or if the Mapping is too non-linear to be approximated by a piece-wise linear
transformation. The ratio of output to input pixel size is evaluated once for each panel of
the piece-wise linear approximation to the Mapping, and is assumed to be constant for
all output pixels in the panel. This parameter is ignored if the NORM parameter is set
FALSE
. [TRUE]
!
), each pixel in the
input image is checked to see if the pixel values in its locality are well correlated with the
corresponding locality in the reference image. The input pixel is excluded from the fitting process
if the local correlation is below CORLIMIT. The supplied value should be between zero
and 1.0. The size of the locality used around each input pixel is given by Parameter BOX.
[!]
In addition, if a value is supplied for CORLIMIT, the input and reference pixel values that pass the
above check are scaled so that they have a mean value of zero and a standard deviation of unity
before being used in the fitting process. [!]
TRUE
, the
fitting process will adjust the scale and offset of the input data values, in addition to the
geometric position of the the input values, in order to minimise the sum of the squared
residuals. [FALSE]
0
— full unrestricted six-coefficient fit;
1
— shift, rotation and a common X/Y scale but no shear;
2
— shift and rotation but no scale or shear; or
3
— shift but not rotation, scale or shear.
[0]
"Linear"
— When resampling, the output pixel values are calculated by bi-linear interpolation among
the four nearest pixels values in the input NDF. When rebinning, the input pixel value is divided
bi-linearly between the four nearest output pixels. Produces smoother output NDFs than the
nearest-neighbour scheme, but is marginally slower.
"Nearest"
— When resampling, the output pixel values are assigned the value of the single nearest
input pixel. When rebinning, the input pixel value is assigned completely to the single nearest output
pixel.
"Sinc"
— Uses the $\mathrm{\text{sinc}}\left(\pi x\right)$
kernel, where $x$
is the pixel offset from the interpolation point (resampling) or transformed input pixel centre (rebinning),
and $\mathrm{\text{sinc}}\left(z\right)=sin\left(z\right)/z$.
Use of this scheme is not recommended.
"SincSinc"
— Uses the $\mathrm{\text{sinc}}\left(\pi x\right)\mathrm{\text{sinc}}\left(k\pi x\right)$
A valuable general-purpose scheme, intermediate in its visual effect on NDFs between the bi-linear
and nearest-neighbour schemes.
"SincCos"
— Uses the $\mathrm{\text{sinc}}\left(\pi x\right)cos\left(k\pi x\right)$
kernel. Gives similar results to the "SincSinc"
scheme.
"SincGauss"
— Uses the $\mathrm{\text{sinc}}\left(\pi x\right){e}^{-k{x}^{2}}$
kernel. Good results can be obtained by matching the FWHM of the envelope function to the
point-spread function of the input data (see Parameter PARAMS).
"Somb"
— Uses the $\mathrm{\text{somb}}\left(\pi x\right)$
kernel, where $x$
is the pixel offset from the interpolation point (resampling), or transformed input pixel centre (rebinning),
and $\mathrm{\text{somb}}\left(z\right)=2\ast {J}_{1}\left(z\right)/z$.
${J}_{1}$ is the
first-order Bessel function of the first kind. This scheme is similar to the "Sinc"
scheme.
"SombCos"
— Uses the $\mathrm{\text{somb}}\left(\pi x\right)cos\left(k\pi x\right)$
kernel. This scheme is similar to the "SincCos"
scheme.
"Gauss"
— Uses the ${e}^{-k{x}^{2}}$
kernel. The FWHM of the Gaussian is given by Parameter PARAMS(2), and the point at which to
truncate the Gaussian to zero is given by Parameter PARAMS(1).
"BlockAve"
— Block averaging over all pixels in the surrounding
$N$-dimensional
cube. This option is only available when resampling (i.e. if REBIN is set to FALSE
).
All methods propagate variances from input to output, but the variance estimates produced by
interpolation schemes other than nearest neighbour need to be treated with care since the spatial
smoothing produced by these methods introduces correlations in the variance estimates. Also, the
degree of smoothing produced varies across the NDF. This is because a sample taken at a pixel centre
will have no contributions from the neighbouring pixels, whereas a sample taken at the corner of a
pixel will have equal contributions from all four neighbouring pixels, resulting in greater
smoothing and lower noise. This effect can produce complex Moiré patterns in the output
variance estimates, resulting from the interference of the spatial frequencies in the sample
positions and in the pixel-centre positions. For these reasons, if you want to use the output
variances, you are generally safer using nearest-neighbour interpolation. The initial default is
"Nearest"
. [
current value]
TRUE
(the default),
then each output value is normalised by dividing it by the number of contributing input
pixels, resulting in each output value being the weighted mean of the contributing input
values. However, if NORM is set FALSE
, this normalisation is not applied. See also Parameter
CONSERVE. [TRUE]
!
) is supplied. If FITVALS is TRUE
, the
output data values will be scaled so that they have the same normalisation as the reference
values. PARAMS( 1 ) is required by all the above schemes. It is used to specify how many pixels are to
contribute to the interpolated result on either side of the interpolation or binning point in each
dimension. Typically, a value of 2
is appropriate and the minimum allowed value is 1
(i.e. one pixel on
each side). A value of zero or fewer indicates that a suitable number of pixels should be calculated
automatically. [0]
PARAMS( 2 ) is required only by the SombCos, Gauss, SincSinc, SincCos, and SincGauss schemes. For
the SombCos, SincSinc, and SincCos schemes, it specifies the number of pixels at which the envelope
of the function goes to zero. The minimum value is 1.0
, and the run-time default value is
2.0
. For the Gauss and SincGauss scheme, it specifies the full-width at half-maximum
(FWHM) of the Gaussian envelope measured in output pixels. The minimum value is 0.1
,
and the run-time default is 1.0
. On astronomical images and spectra, good results are
often obtained by approximately matching the FWHM of the envelope function, given by
PARAMS( 2 ), to the point-spread function of the input data. []
TRUE
value
is given, a rebinning algorithm is used. Otherwise, a resampling algorithm is used. See
the “Choice of Algorithm” topic below. [
current value]
[0.05]
TRUE
. It specifies the minimum number of good pixels which must contribute to an
output pixel for the output pixel to be valid. Note, fractional values are allowed. A null (!
)
value causes a very small positive value to be used resulting in output pixels being set
bad only if they receive no significant contribution from any input pixel. [!]
TRUE
,
then this will include the scale and offset (written to the seventh and eighth entries). The resampling algorithm steps through every pixel in the output image, sampling the input image at the corresponding position and storing the sampled input value in the output pixel. The method used for sampling the input image is determined by the METHOD parameter. The rebinning algorithm steps through every pixel in the input image, dividing the input pixel value between a group of neighbouring output pixels, incrementing these output pixel values by their allocated share of the input pixel value, and finally normalising each output value by the total number of contributing input values. The way in which the input sample is divided between the output pixels is determined by the METHOD parameter.
Both algorithms produce an output in which the each pixel value is the weighted mean of the near-by
input values, and so do not alter the mean pixel values associated with a source, even if the
pixel size changes. Thus the total data sum in a source will change if the input and output
pixel sizes differ. However, if the CONSERVE parameter is set TRUE
, the output values are
scaled by the ratio of the output to input pixel size, so that the total data sum in a source is
preserved.
A difference between resampling and rebinning is that resampling guarantees to fill the output image with good pixel values (assuming the input image is filled with good input pixel values), whereas holes can be left by the rebinning algorithm if the output image has smaller pixels than the input image. Such holes occur at output pixels which receive no contributions from any input pixels, and will be filled with the value zero in the output image. If this problem occurs the solution is probably to change the width of the pixel spreading function by assigning a larger value to PARAMS(1) and/or PARAMS(2) (depending on the specific METHOD value being used).
Both algorithms have the capability to introduce artefacts into the output image. These have various causes described below.
Particularly sharp features in the input can cause rings around the corresponding features in the output image. This can be minimised by suitable settings for the METHOD and PARAMS parameters. In general such rings can be minimised by using a wider interpolation kernel (if resampling) or spreading function (if rebinning), at the cost of degraded resolution.
The approximation of the Mapping using a piece-wise linear transformation (controlled by Parameter
TOL) can produce artefacts at the joints between the panels of the approximation. These can
occur when using the rebinning algorithm, or when using the resampling algorithm with
CONSERVE set to TRUE
. They are caused by the discontinuities between the adjacent panels of the
approximation, and can be minimised by reducing the value assigned to the TOL parameter.