Changeset 23989 for trunk/psModules/src/imcombine
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- Location:
- trunk/psModules/src/imcombine
- Files:
-
- 4 edited
-
pmImageCombine.c (modified) (3 diffs)
-
pmReadoutCombine.c (modified) (1 diff)
-
pmSubtraction.c (modified) (1 diff)
-
pmSubtractionMatch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmImageCombine.c
r21183 r23989 132 132 // Combine all the pixels, using the specified stat. 133 133 if (!psVectorStats(stats, pixelData, pixelErrors, pixelMasks, 0xff)) { 134 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 135 return false; 136 } 137 if (isnan(stats->sampleMean)) { 134 138 combine->data.F32[y][x] = NAN; 135 139 psFree(buffer); … … 137 141 } 138 142 float combinedPixel = stats->sampleMean; // Value of the combination 139 143 140 144 if (iter == 0) { 141 145 // Save the value produced with no rejection, since it may be useful later … … 364 368 // Get the median 365 369 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 366 psVectorStats(stats, pixels, NULL, mask, 1); 370 if (!psVectorStats(stats, pixels, NULL, mask, 1)) { 371 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 372 } 367 373 float median = stats->sampleMedian; 368 374 psFree(stats); -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r21363 r23989 384 384 // Combination 385 385 if (!psVectorStats(stats, pixels, errors, mask, 1)) { 386 // Can't do much about it, but it's not worth worrying about 387 psErrorClear(); 386 psError(PS_ERR_UNKNOWN, false, "error in pixel stats"); 387 return false; 388 } 389 390 outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine); 391 392 if (isnan(outputImage[yOut][xOut])) { 388 393 outputImage[yOut][xOut] = NAN; 389 394 outputMask[yOut][xOut] = params->blank; 395 sigma->data.F32[yOut][xOut] = NAN; 390 396 if (params->variances) { 391 397 outputVariance[yOut][xOut] = NAN; 392 398 } 393 sigma->data.F32[yOut][xOut] = NAN; 394 } else { 395 outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine); 396 outputMask[yOut][xOut] = isfinite(outputImage[yOut][xOut]) ? 0 : params->blank; 397 if (params->variances) { 398 float stdev = psStatsGetValue(stats, combineStdev); 399 outputVariance[yOut][xOut] = PS_SQR(stdev); // Variance 400 // XXXX this is not the correct formal error. 401 // also, the weighted mean is not obviously the correct thing here 402 } 403 sigma->data.F32[yOut][xOut] = psStatsGetValue(stats, combineStdev); 404 } 399 continue; 400 } 401 outputMask[yOut][xOut] = 0; 402 sigma->data.F32[yOut][xOut] = psStatsGetValue(stats, combineStdev); 403 if (params->variances) { 404 float stdev = psStatsGetValue(stats, combineStdev); 405 outputVariance[yOut][xOut] = PS_SQR(stdev); // Variance 406 // XXXX this is not the correct formal error. 407 // also, the weighted mean is not obviously the correct thing here 408 } 405 409 } 406 410 } -
trunk/psModules/src/imcombine/pmSubtraction.c
r23839 r23989 822 822 psFree(mask); 823 823 824 // XXX raise an error? 825 if (isnan(stats->sampleMean)) { 826 psFree(stats); 827 return -1; 828 } 829 824 830 double mean, rms; // Mean and RMS of deviations 825 831 if (numStamps < MIN_SAMPLE_STATS) { -
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r23944 r23989 830 830 psFree(mask); 831 831 832 // XXX raise an error here or not? 833 if (isnan(stats->robustMedian)) { 834 psFree(stats); 835 return PM_SUBTRACTION_MODE_ERR; 836 } 837 832 838 psLogMsg("psModules.imcombine", PS_LOG_INFO, "Median width ratio: %lf", stats->robustMedian); 833 839 pmSubtractionMode mode = (stats->robustMedian <= 1.0 ? PM_SUBTRACTION_MODE_1 : PM_SUBTRACTION_MODE_2); 834 840 psFree(stats); 835 841 836 // XXX EAM : I think Paul left some test code in here. I've commented these lines out837 // return PM_SUBTRACTION_MODE_2;838 // exit(1);839 840 842 return mode; 841 843 }
Note:
See TracChangeset
for help on using the changeset viewer.
