IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19239


Ignore:
Timestamp:
Aug 27, 2008, 12:02:35 PM (18 years ago)
Author:
Paul Price
Message:

Caught an important bug: was using the wrong index in comparison.

File:
1 edited

Legend:

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

    r19207 r19239  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-08-26 02:06:44 $
     10 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2008-08-27 22:02:35 $
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
    1313 *
     
    343343                  // Convert to rejection limits --- saves doing it later.
    344344                  // Using squared rejection limit because it's cheaper than sqrts
    345                   rej *= rej;
     345                  float rej2 = PS_SQR(rej); // Rejection level squared
    346346                  for (int i = 0; i < num; i++) {
    347                       pixelVariances->data.F32[i] = rej * pixelVariances->data.F32[i] *
    348                           varFactors->data.F32[i];
     347                      pixelVariances->data.F32[i] *= rej2 * varFactors->data.F32[i];
    349348                  }
    350349              }
     
    380379                      continue;
    381380                  }
    382                   float diff = fabsf(pixelData->data.F32[j] - median); // Difference from expected
     381                  float diff = pixelData->data.F32[j] - median; // Difference from expected
    383382                  if (useVariance) {
    384383                      // Comparing squares --- cheaper than lots of sqrts
    385                       if (PS_SQR(diff) > pixelVariances->data.F32[i]) {
     384                      if (PS_SQR(diff) > pixelVariances->data.F32[j]) {
    386385                          MASK_PIXEL_FOR_INSPECTION();
    387386                      }
    388                   } else if (diff > limit) {
     387                  } else if (fabsf(diff) > limit) {
    389388                      MASK_PIXEL_FOR_INSPECTION();
    390389                  }
Note: See TracChangeset for help on using the changeset viewer.