IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15808


Ignore:
Timestamp:
Dec 13, 2007, 7:54:08 AM (18 years ago)
Author:
eugene
Message:

working on new masking api

Location:
branches/eam_branch_20071212/psModules/src/detrend
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071212/psModules/src/detrend/pmMaskBadPixels.c

    r14935 r15808  
    8181
    8282psImage *pmMaskFlagSuspectPixels(psImage *out, const pmReadout *readout, float rej,
    83                                  psMaskType maskVal, float frac, psRandom *rng)
     83                                 psMaskType maskVal, float median, float stdev)
    8484{
    8585    PS_ASSERT_PTR_NON_NULL(readout, NULL);
     
    103103    psImage *mask = readout->mask;      // Corresponding mask
    104104
    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 options
    112     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 value
    124     float stdev = stats->robustStdev; // Estimate of the standard deviation
    125     psFree(stats);
    126 
    127105    if (!out) {
    128106        out = psImageAlloc(image->numCols, image->numRows, PS_TYPE_S32);
  • branches/eam_branch_20071212/psModules/src/detrend/pmMaskBadPixels.h

    r12696 r15808  
    55 * @author Eugene Magnier, IfA
    66 *
    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 $
    99 * Copyright 2004 Institute for Astronomy, University of Hawaii
    1010 */
     
    3131/// Find pixels outlying from the background, flagging suspect pixels
    3232///
    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 suspect
    36 /// 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 NULL
     33/// 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.
     37psImage *pmMaskFlagSuspectPixels(psImage *out,    ///< Suspected bad pixels image, or NULL
    3838                                 const pmReadout *readout, ///< Readout to inspect
    3939                                 float rej, ///< Rejection threshold (standard deviations)
    4040                                 psMaskType maskVal, ///< Mask value for statistics
    41                                  float frac, ///< Fraction of pixels to consider
    42                                  psRandom *rng ///< Random number generator
     41                                 float median, ///< reference median for the image
     42                                 float stdev ///< reference stdev for the image
    4343                                );
    4444
Note: See TracChangeset for help on using the changeset viewer.