Changeset 14282 for trunk/psModules/src/imcombine/pmStack.c
- Timestamp:
- Jul 17, 2007, 5:54:01 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStack.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStack.c
r14277 r14282 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $11 * @date $Date: 2007-07-18 0 2:16:46$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-07-18 03:54:01 $ 12 12 * 13 13 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 114 114 // Generate a standard deviation for the combination 115 115 // Not using psVectorStats because it has additional allocations which slow things down 116 static bool combinationStdev(float *stdev, // Mean value, to return 116 static bool combinationStdev(float *median, // Median value, to return 117 float *stdev, // Standard deviation value, to return 117 118 const psVector *values, // Values to combine 118 119 const psVector *masks, // Mask to apply … … 137 138 return false; 138 139 } 140 *median = num % 2 ? (sortBuffer->data.F32[num / 2] + sortBuffer->data.F32[num / 2 + 1]) / 2.0 : 141 sortBuffer->data.F32[num / 2]; 139 142 *stdev = 0.74 * (sortBuffer->data.F32[(int)(0.75 * num)] - sortBuffer->data.F32[(int)(0.25 * num)]); 140 143 … … 269 272 psMaskType ignore = maskVal | bad; // Ignore values with this mask value 270 273 for (int i = 0; i < numIter && numClipped > 0; i++) { 271 float stdev; // Standard deviationof the combination, for rejection274 float median, stdev; // Median and stdev of the combination, for rejection 272 275 // Only get the mean if it's not the first iteration (because we got the mean earlier) 273 if ((i != 0 && !combinationMean(&mean, pixelData, weights, pixelMasks, maskVal)) || 274 !combinationStdev(&stdev, pixelData, pixelMasks, maskVal, sort)) { 276 if (!combinationStdev(&median, &stdev, pixelData, pixelMasks, maskVal, sort)) { 275 277 image->data.F32[y][x] = NAN; 276 278 mask->data.PS_TYPE_MASK_DATA[y][x] = bad; … … 285 287 continue; 286 288 } 287 float diff = pixelData->data.F32[j] - me an;289 float diff = pixelData->data.F32[j] - median; 288 290 if (fabsf(diff) > limit) { 289 291 // Add the pixel as one to inspect
Note:
See TracChangeset
for help on using the changeset viewer.
