Changeset 16691
- Timestamp:
- Feb 27, 2008, 3:15:35 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStack.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStack.c
r16689 r16691 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2008-02-28 0 0:15:03$10 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2008-02-28 01:15:35 $ 12 12 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii 13 13 * … … 60 60 } 61 61 62 static combineBuffer *combineBufferAlloc(long numImages, // Number of images that will be combined 63 psStatsOptions stat // Statistic to use 62 static combineBuffer *combineBufferAlloc(long numImages // Number of images that will be combined 64 63 ) 65 64 { … … 231 230 assert(inputs); 232 231 assert(numIter >= 0); 233 assert(rej > 0);234 232 assert(buffer); 235 233 assert((useVariance && variance) || !useVariance); … … 311 309 } 312 310 } 313 if (useVariance && safe ) {311 if (useVariance && safe && numIter > 0) { 314 312 // Use variance to check that the two are consistent 315 313 float diff = pixelData->data.F32[0] - pixelData->data.F32[1]; … … 542 540 PS_ASSERT_INT_NONNEGATIVE(numIter, false); 543 541 if (isnan(rej)) { 544 PS_ASSERT_INT_EQUAL(numIter, 0 );542 PS_ASSERT_INT_EQUAL(numIter, 0, false); 545 543 } else { 546 544 PS_ASSERT_FLOAT_LARGER_THAN(rej, 0.0, false); … … 598 596 599 597 // Buffer for combination 600 combineBuffer *buffer = combineBufferAlloc(num, numIter == 0 ? PS_STAT_SAMPLE_MEAN : 601 PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_MEDIAN); 598 combineBuffer *buffer = combineBufferAlloc(num); 602 599 603 600 if (havePixels) { … … 615 612 } 616 613 pixels = psPixelsConcatenate(pixels, data->pixels); 617 data->pixels = psPixelsRealloc(data->pixels, PIXEL_LIST_BUFFER); // Just in case more rejection618 614 } 619 615 for (int i = 0; i < pixels->n; i++) { … … 627 623 maskVal, bad, numIter, rej, useVariance, safe, buffer); 628 624 } 629 psTrace("psModules.imcombine", 5, "Additional %ld pixels fixed.\n", pixels->n);630 625 psFree(pixels); 631 626 psFree(pixelMap);
Note:
See TracChangeset
for help on using the changeset viewer.
