PRO image_gaussian_smooth, imdata, bpmdata, fwhm, status ; Description: This module smooths an image "imdata" by convolving the image with a Gaussian ; kernel of FWHM "fwhm" pixels. The bad pixels in the bad pixel mask "bpmdata" ; are grown appropriately. ; ; Input Parameters: ; ; imdata - FLOAT/DOUBLE ARRAY - An image array to be smoothed by the Gaussian kernel. ; bpmdata - BYTE/INTEGER/LONG ARRAY - A bad pixel mask array of the same size as "imdata" ; which flags bad pixels with a value of "0" and good ; pixels with a value of "1". If this array does not ; have the same dimensions as "imdata", then all image ; pixels will be considered good, and "bpmdata" will ; be set to an array of the same dimensions as "imdata" ; with all values equal to "1". ; fwhm - FLOAT/DOUBLE - The full-width half-maximum of the Gaussian kernel to be used to ; smooth the image data (pix). This parameter must be positive, otherwise ; no image smoothing will be performed. ; ; Output Parameters: ; ; imdata - DOUBLE ARRAY - The image array after smoothing by the Gaussian kernel. ; bpmdata - INTEGER ARRAY - The bad pixel mask array after the original set of bad pixels ; have been grown by the pixel array size of the Gaussian kernel. ; Good and bad pixels are still flagged with values of "1" and ; "0", respectively. ; status - INTEGER - If the image "imdata" was smoothed successfully, then "status" is set to ; "1". Otherwise, if the image "imdata" was not smoothed successfully, then ; "status" is set to "0". ; ; Author: Dan Bramich (dmb@ing.iac.es) ; ; History: ; ; 14/08/2008 - Module created (dmb) ;Check that "imdata" is an image of the correct number type ;If "bpmdata" is not an image of the correct number type and dimensions, then assume that all ;image pixels are good ;Check that the parameter "fwhm" is a number of the correct type and that it is positive ;Set up the Gaussian convolution kernel in preparation for image smoothing ;Convolve the image with the Gaussian convolution kernel, growing bad pixels by the pixel ;array size of the Gaussian kernel ;Set the "status" parameter to "1"