Changeset 10172
- Timestamp:
- Nov 22, 2006, 7:29:35 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotImageMedian.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotImageMedian.c
r10133 r10172 10 10 psRegion region; 11 11 int MAX_SAMPLE_PIXELS; 12 static char *defaultStatsName = "FITTED_MEAN"; 12 13 13 14 pmReadout *model = NULL; … … 35 36 if (!status) { 36 37 SKY_BIAS = 0; 38 } 39 40 // supply the sky background statistic name: 41 char *statsName = psMetadataLookupStr (&status, recipe, "SKY_STAT"); 42 if (statsName == NULL) { 43 statsName = defaultStatsName; 44 } 45 psStatsOptions statsOption = psStatsOptionFromString (statsName); 46 if (!(statsOption & (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_MEDIAN | PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_QUARTILE | PS_STAT_CLIPPED_MEAN | PS_STAT_FITTED_MEAN))) { 47 statsOption = PS_STAT_FITTED_MEAN; 37 48 } 38 49 … … 105 116 106 117 // XXX the value of the upper and lower cuts probably should be studied... 107 psStats *stats = psImageBackground(subset, submask, 0xff, 0.25, 0.75, MAX_SAMPLE_PIXELS, rng); 108 modelData[iy][ix] = stats->robustMedian + SKY_BIAS; 118 psStats *stats = psImageBackground(subset, submask, 0xff, 0.25, 0.75, MAX_SAMPLE_PIXELS, statsOption, rng); 119 if (stats->options & PS_STAT_ROBUST_QUARTILE) { 120 modelData[iy][ix] = stats->robustMedian + SKY_BIAS; 121 } else { 122 modelData[iy][ix] = psStatsGetValue (stats, statsOption) + SKY_BIAS; 123 } 109 124 110 125 psFree (stats);
Note:
See TracChangeset
for help on using the changeset viewer.
