Smooths an NDF using an n-dimensional rectangular box filter. BLOCK
This application smooths an n-dimensional NDF using a rectangular box filter, whose dimensionality is the same as that of the NDF being smoothed. Each output pixel is either the mean or the median of the input pixels within the filter box. The mean estimator provides one of the fastest methods of smoothing an image and is often useful as a general-purpose smoothing algorithm when the exact form of the smoothing point-spread function is not important.
It is possible to smooth in selected dimensions by setting the boxsize to 1 for the dimensions not requiring smoothing. For example you can apply two-dimensional smoothing to the planes of a three-dimensional NDF (see Parameter BOX). If it has three dimensions, then the filter is applied in turn to each plane in the cube and the result written to the corresponding plane in the output cube.
1
indicates no smoothing along that axis. Thus, for example,
BOX=[3,3,1]
for a three-dimensional NDF would apply a 3x3-pixel filter to all its planes
independently.
If fewer values are supplied than the number of dimensions of the NDF, then the final value will be duplicated for the missing dimensions.
The values given will be rounded up to positive odd integers, if necessary, to retain symmetry.
"Mean"
or "Median"
. ["Mean"]
[!]
By default, a null (!
) value is used for WLIM, which causes the pattern of bad pixels to be propagated
from the input image to the output image unchanged. In this case, smoothed output values are only
calculated for those pixels which are not bad in the input image.
If a numerical value is given for WLIM, then it specifies the minimum fraction of good pixels which
must be present in the smoothing box in order to generate a good output pixel. If this specified
minimum fraction of good input pixels is not present, then a bad output pixel will result, otherwise a
smoothed output value will be calculated. The value of this parameter should lie between 0.0 and 1.0
(the actual number used will be rounded up if necessary to correspond to at least one pixel). [!]
"Smoothed spectrum"
. The median estimator is much slower than the mean estimator, and is heavily dependent on the smoothing box size.
This routine correctly processes the AXIS, DATA, QUALITY, LABEL, TITLE, UNITS, WCS, and HISTORY components of the input NDF and propagates all extensions. In addition, if the mean estimator is used, the VARIANCE component is also processed. If the median estimator is used, then the output NDF will have no VARIANCE component, even if there is a VARIANCE component in the input NDF.
Processing of bad pixels and automatic quality masking are supported. The bad-pixel flag is also written for the data and variance arrays.
All non-complex numeric data types can be handled. Arithmetic is performed using single-precision floating point, or double precision if appropriate.
Huge NDFs are supported.