IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19478


Ignore:
Timestamp:
Sep 10, 2008, 5:35:30 PM (18 years ago)
Author:
Paul Price
Message:

Variance factors weren't being folded in properly. They should only
be in there when we're rejecting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080908/psModules/src/imcombine/pmStack.c

    r19454 r19478  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.38.2.2 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-09-10 18:17:54 $
     10 *  @version $Revision: 1.38.2.3 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2008-09-11 03:35:30 $
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
    1313 *
     
    265265        pixelData->data.F32[num] = image->data.F32[yIn][xIn];
    266266        if (variance) {
    267             pixelVariances->data.F32[num] = variance->data.F32[yIn][xIn] * varFactors->data.F32[i];
     267            pixelVariances->data.F32[num] = variance->data.F32[yIn][xIn];
    268268        }
    269269        pixelWeights->data.F32[num] = data->weight;
     
    312312              // Use variance to check that the two are consistent
    313313              float diff = pixelData->data.F32[0] - pixelData->data.F32[1];
    314               float sigma2 = pixelVariances->data.F32[0] + pixelVariances->data.F32[1];
     314              float sigma2 = pixelVariances->data.F32[0] * varFactors->data.F32[pixelSources->data.U16[0]] +
     315                  pixelVariances->data.F32[1] * varFactors->data.F32[pixelSources->data.U16[1]];
    315316              if (PS_SQR(diff) > PS_SQR(rej) * sigma2) {
    316317                  // Not consistent: mark both for inspection
     
    341342                  float rej2 = PS_SQR(rej); // Rejection level squared
    342343                  for (int i = 0; i < num; i++) {
    343                       pixelVariances->data.F32[i] *= rej2;
     344                      pixelVariances->data.F32[i] *= rej2 * varFactors->data.F32[pixelSources->data.U16[i]];;
    344345                  }
    345346              }
     
    377378                  if (useVariance) {
    378379                      // Comparing squares --- cheaper than lots of sqrts
    379                       if (PS_SQR(diff) > rej2 * pixelVariances->data.F32[j]) {
     380                      // pixelVariances includes the variance factor and the rejection limit, from above
     381                      if (PS_SQR(diff) > pixelVariances->data.F32[j]) {
    380382                          MASK_PIXEL_FOR_INSPECTION();
    381383                      }
Note: See TracChangeset for help on using the changeset viewer.