00001 /* @file pmMaskBadPixels.h 00002 * @brief Mask bad pixels 00003 * 00004 * @author Ross Harman, MHPCC 00005 * @author Eugene Magnier, IfA 00006 * 00007 * @version $Revision: 1.12 $ $Name: $ 00008 * @date $Date: 2007/01/24 02:54:15 $ 00009 * Copyright 2004 Institute for Astronomy, University of Hawaii 00010 */ 00011 00012 #ifndef PM_MASK_BAD_PIXELS_H 00013 #define PM_MASK_BAD_PIXELS_H 00014 00015 /// @addtogroup detrend Detrend Creation and Application 00016 /// @{ 00017 00018 #include <pslib.h> 00019 #include "pmFPA.h" 00020 00021 /// Applies the bad pixel mask to the input 00022 /// 00023 /// Pixels marked as bad within the mask are marked as bad within the input image's mask. If maskVal is 00024 /// non-zero, all pixels in the mask have any of the same bits sets as maskVal shall have the corresponding 00025 /// bits raised. If maskVal is zero, any zero pixels in the mask are OR-ed with PM_MASK_BAD. Position 00026 /// offsets (such as due to trimming) between the input and mask are applied so that the same pixels are 00027 /// referred to. The science readout must already have a supplied mask element (use eg. pmReadoutSetMask). 00028 /// The supplied mask image must be of MASK type 00029 bool pmMaskBadPixels(pmReadout *input, ///< Input science image 00030 const pmReadout *mask, ///< Mask image to apply 00031 psMaskType maskVal ///< Mask value to apply 00032 ); 00033 00034 /// Find pixels outlying from the background, flagging suspect pixels 00035 /// 00036 /// Pixels more than "rej" standard deviations from the background level (in flat-fielded, 00037 /// background-subtracted images) have the corresponding pixel in the "suspect pixels" image incremented. 00038 /// After accumulating over a suitable sample of images, bad pixels should have a high value in the suspect 00039 /// pixels image, allowing them to be identified. The suspect pixels image is of type S32. 00040 psImage *pmMaskFlagSuspectPixels(psImage *out, ///< Suspected bad pixels image, or NULL 00041 const pmReadout *readout, ///< Readout to inspect 00042 float rej, ///< Rejection threshold (standard deviations) 00043 psMaskType maskVal, ///< Mask value for statistics 00044 float frac, ///< Fraction of pixels to consider 00045 psRandom *rng ///< Random number generator 00046 ); 00047 00048 /// Identify bad pixels from the suspect pixels image 00049 /// 00050 /// Bad pixels are identified from the suspect pixels image (accumulated over a large number of images). 00051 /// Pixels marked as suspect in more than "thresh" standard deviations from the mean are identified as bad 00052 /// pixels (output image). If "thresh" is negative, a Poisson is assumed. 00053 psImage *pmMaskIdentifyBadPixels(const psImage *suspects, ///< Accumulated suspect pixels image 00054 float thresh, ///< Threshold for bad pixel (standard deviations) 00055 psMaskType maskVal ///< Value to set for bad pixels 00056 ); 00057 /// @} 00058 #endif
1.5.1