- Timestamp:
- Dec 13, 2007, 7:54:08 AM (19 years ago)
- File:
-
- 1 edited
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);
Note:
See TracChangeset
for help on using the changeset viewer.
