Changeset 15808
- Timestamp:
- Dec 13, 2007, 7:54:08 AM (18 years ago)
- Location:
- branches/eam_branch_20071212/psModules/src/detrend
- Files:
-
- 2 edited
-
pmMaskBadPixels.c (modified) (2 diffs)
-
pmMaskBadPixels.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071212/psModules/src/detrend/pmMaskBadPixels.c
r14935 r15808 81 81 82 82 psImage *pmMaskFlagSuspectPixels(psImage *out, const pmReadout *readout, float rej, 83 psMaskType maskVal, float frac, psRandom *rng)83 psMaskType maskVal, float median, float stdev) 84 84 { 85 85 PS_ASSERT_PTR_NON_NULL(readout, NULL); … … 103 103 psImage *mask = readout->mask; // Corresponding mask 104 104 105 if (rng) {106 psMemIncrRefCounter(rng);107 } else {108 rng = psRandomAlloc(PS_RANDOM_TAUS, 0);109 }110 111 // XXX note that this now will accept any of several stats options112 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);113 stats->nSubsample = frac * image->numCols * image->numRows;114 if (!psImageBackground(stats, NULL, image, mask, maskVal, rng) ||115 !isfinite(stats->robustMedian) || !isfinite(stats->robustUQ) || !isfinite(stats->robustLQ)) {116 psError(PS_ERR_UNKNOWN, false, "Unable to measure image statistics.\n");117 psFree(stats);118 psFree(rng);119 return NULL;120 }121 psFree(rng);122 123 float median = stats->robustMedian; // Median value124 float stdev = stats->robustStdev; // Estimate of the standard deviation125 psFree(stats);126 127 105 if (!out) { 128 106 out = psImageAlloc(image->numCols, image->numRows, PS_TYPE_S32); -
branches/eam_branch_20071212/psModules/src/detrend/pmMaskBadPixels.h
r12696 r15808 5 5 * @author Eugene Magnier, IfA 6 6 * 7 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $8 * @date $Date: 2007- 03-30 21:12:56$7 * @version $Revision: 1.13.20.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-12-13 17:54:08 $ 9 9 * Copyright 2004 Institute for Astronomy, University of Hawaii 10 10 */ … … 31 31 /// Find pixels outlying from the background, flagging suspect pixels 32 32 /// 33 /// Pixels more than "rej" standard deviations from the background level (in flat-fielded,34 /// background-subtracted images) have the corresponding pixel in the "suspect pixels" image incremented.35 /// After accumulating over a suitable sample of images, bad pixels should have a high value in the suspect36 /// pixels image, allowing them to be identified. The suspect pixels image is of type S32.37 psImage *pmMaskFlagSuspectPixels(psImage *out, ///< Suspected bad pixels image, or NULL33 /// Pixels more than "rej" standard deviations from the median level have the corresponding pixel in 34 /// the "suspect pixels" image incremented. After accumulating over a suitable sample of images, 35 /// bad pixels should have a high value in the suspect pixels image, allowing them to be identified. 36 /// The suspect pixels image is of type S32. This function is best applied to residual images. 37 psImage *pmMaskFlagSuspectPixels(psImage *out, ///< Suspected bad pixels image, or NULL 38 38 const pmReadout *readout, ///< Readout to inspect 39 39 float rej, ///< Rejection threshold (standard deviations) 40 40 psMaskType maskVal, ///< Mask value for statistics 41 float frac, ///< Fraction of pixels to consider42 psRandom *rng ///< Random number generator41 float median, ///< reference median for the image 42 float stdev ///< reference stdev for the image 43 43 ); 44 44
Note:
See TracChangeset
for help on using the changeset viewer.
