IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16691


Ignore:
Timestamp:
Feb 27, 2008, 3:15:35 PM (18 years ago)
Author:
Paul Price
Message:

Major difference is that not reallocating the pixel list for the
second combination --- it was destroying the list of pixels used in
scans after the first.
Removed stats specification in combinationBuffer.
Fixing asserts.
Only mask both in 2-pixel combinations if rejection is specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStack.c

    r16689 r16691  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-02-28 00:15:03 $
     10 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2008-02-28 01:15:35 $
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
    1313 *
     
    6060}
    6161
    62 static combineBuffer *combineBufferAlloc(long numImages, // Number of images that will be combined
    63                                          psStatsOptions stat // Statistic to use
     62static combineBuffer *combineBufferAlloc(long numImages // Number of images that will be combined
    6463    )
    6564{
     
    231230    assert(inputs);
    232231    assert(numIter >= 0);
    233     assert(rej > 0);
    234232    assert(buffer);
    235233    assert((useVariance && variance) || !useVariance);
     
    311309              }
    312310          }
    313           if (useVariance && safe) {
     311          if (useVariance && safe && numIter > 0) {
    314312              // Use variance to check that the two are consistent
    315313              float diff = pixelData->data.F32[0] - pixelData->data.F32[1];
     
    542540    PS_ASSERT_INT_NONNEGATIVE(numIter, false);
    543541    if (isnan(rej)) {
    544         PS_ASSERT_INT_EQUAL(numIter, 0);
     542        PS_ASSERT_INT_EQUAL(numIter, 0, false);
    545543    } else {
    546544        PS_ASSERT_FLOAT_LARGER_THAN(rej, 0.0, false);
     
    598596
    599597    // 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);
    602599
    603600    if (havePixels) {
     
    615612            }
    616613            pixels = psPixelsConcatenate(pixels, data->pixels);
    617             data->pixels = psPixelsRealloc(data->pixels, PIXEL_LIST_BUFFER); // Just in case more rejection
    618614        }
    619615        for (int i = 0; i < pixels->n; i++) {
     
    627623                          maskVal, bad, numIter, rej, useVariance, safe, buffer);
    628624        }
    629         psTrace("psModules.imcombine", 5, "Additional %ld pixels fixed.\n", pixels->n);
    630625        psFree(pixels);
    631626        psFree(pixelMap);
Note: See TracChangeset for help on using the changeset viewer.