SMOOTH: Smooth an Image or Spectrum

 
Form: SMOOTH source [FW=f] [FWC=f] [FWR=f] [BOXCAR] [RUNMEAN] [WID=]
source
is the object being smoothed,
FW=f
sets the full width of the (Gaussian or boxcar) smoothing function to be f pixels, and
FWC= and FWR=
set the full width for the (Gaussian or boxcar) smoothing function to have a different width in rows or columns.
BOXCAR
convolve with a box function instead of a Gaussian.
RUNMEAN
convolve with a box function, but using a running-mean algorithm that is faster than the BOXCAR option. The results are identical for odd-sized boxes.
SMOOTH will smooth or convolve the 'source' object with a 2D or 1D Gaussian or boxcar. This is useful for reducing noise, enhancing low surface brightness features, or as the first step for looking for sharp features in an image (by subtracting the smoothed image from the original). Specify the full-width-half-maximum (FWHM) of the Gaussian (boxcar) in pixels with the FW keyword. If desired, you can specify differing widths in the column or row directions with the FWC or FWR keywords. To smooth the image in the column direction only, (each image row is convolved along its extent separately) just specify the width with the FWC keyword. To smooth in the row direction only, (down the columns) just specify the FWR keyword. For Gaussian, the kernel will extend to WID*FWHM, where WID=3 by default, although this can be overridden with the WID= keyword.

To convolve with a box, use the 'BOXCAR' word. Better yet, use the 'RUNMEAN' word, which gives identical results much faster for odd-sized windows, but slightly different results for even-sized smoothing windows. BOXCAR may be removed in future versions, to be supplanted by RUNMEAN.

The convolutions are done in the image domain and may be slow for large widths of the filter. Edges are handled properly. At this time, the FWHMs of the filters are limited to 33 pixel for the Gaussian and 99 pixels for the boxcar.

Examples:

SMOOTH 2 FW=8.5
Smoothes image 2 with a Gaussian having full width 8.5 pixels. The width is the same in the row and column directions.
SMOOTH 2 FWR=8.5 FWC=8.0
Smoothes image 2 with a Gaussian having full width = 8.5 rows and 8.0 columns.
SMOOTH 5 FWR=6.2
Smoothes each column individually with a Gaussian having full width 6.2 rows.
SMOOTH 2 FW=5 BOXCAR
Convolve with a box of size 5 pixels.
Since 1-D spectra are treated the same as 2-D images with only one row, use the FWC= keyword when smoothing spectra. Remember that the width of the smoothing kernel (Gaussian or Boxcar) is in units of PIXELS not Angstroms.