00001 /** @file pmMaskBadPixels.h 00002 * 00003 * @brief Given an input image, a bad pixel mask, a corresponding value in the bad pixel mask to mask, a 00004 * saturation level, and a growing radius, mask in the input image those pixels in the bad pixel mask that 00005 * match the value to mask. 00006 * 00007 * Given an input image, in, a bad pixel mask, a corresponding value in the bad pixel mask to mask in the 00008 * input image, maskVal, a saturation level, and a growing radius, pmMaskBadPixels shall mask in the input 00009 * image those pixels in the bad pixel mask that match the value to mask. Note that the input image, in, is 00010 * modified in-place. All pixels in the mask which satisfy the maskVal shall have their corresponding pixels 00011 * masked in the input image, in. All pixels which satisfy the growVal shall have their corresponding 00012 * pixels, along with all pixels within the grow radius masked. Pixels which have flux greater than sat shall 00013 * also be masked, but not grown. Note that the input image, in, and the mask need not be the same size, 00014 * since the input image may already have been trimmed (following overscan subtraction), but the function 00015 * shall use the offsets in the image (in->x0 and in->y0) to determine the appropriate offsets to obtain the 00016 * correct pixel on the mask. In the event that the mask image is too small (i.e., pixels on the input image 00017 * refer to pixels outside the range of the mask image), the function shall generate an error. 00018 * 00019 * @author Ross Harman, MHPCC 00020 * 00021 * @version $Revision: 1.1.1.1 $ $Name: $ 00022 * @date $Date: 2005/09/14 21:09:15 $ 00023 * 00024 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 00025 */ 00026 00027 #include "pslib.h" 00028 #include "pmAstrometry.h" 00029 00030 /** Mask values */ 00031 typedef enum { 00032 PM_MASK_TRAP = 0x0001, ///< The pixel is a charge trap. 00033 PM_MASK_BADCOL = 0x0002, ///< The pixel is a bad column. 00034 PM_MASK_SAT = 0x0004, ///< The pixel is saturated. 00035 PM_MASK_FLAT = 0x0008 ///< The pixel is non-positive in the flat-field. 00036 } pmMaskValue; 00037 00038 /** Macro to find maximum of two numbers */ 00039 #define MAX(A,B)((A)>=(B)?(A):(B)) 00040 00041 /** Macro to find minimum of two numbers */ 00042 #define MIN(A,B)((A)<=(B)?(A):(B)) 00043 00044 00045 /** Execute bad pixels module. 00046 * 00047 * Given an input image, a bad pixel mask, a corresponding value in the bad pixel mask to mask, a 00048 * saturation level, and a growing radius, mask in the input image those pixels in the bad pixel mask that 00049 * match the value to mask. 00050 * 00051 * @return bool: True or false for success or failure 00052 */ 00053 bool pmMaskBadPixels( 00054 pmReadout *in, ///< Readout containing input image data. 00055 const psImage *mask, ///< Mask data to be added to readout mask data. 00056 unsigned int maskVal, ///< Mask value to determine what to add to input mask. 00057 float sat, ///< Saturation limit to mask bad pixels. 00058 unsigned int growVal, ///< Mask data to determine if a circurlar area should be masked. 00059 int grow ///< Radius of mask to apply around pixel. 00060 ); 00061
1.4.2