IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 9, 2009, 12:13:16 PM (17 years ago)
Author:
Paul Price
Message:

Weighted Olympic mean wasn't working as intended: high pixels weren't being discarded correctly.

File:
1 edited

Legend:

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

    r23577 r23773  
    3333#define NUM_DIRECT_STDEV 5              // For less than this number of values, measure stdev directly
    3434
    35 //#define TESTING                         // Enable test output
    36 //#define TEST_X 2318                     // x coordinate to examine
    37 //#define TEST_Y 2306                     // y coordinate to examine
     35#define TESTING                         // Enable test output
     36#define TEST_X 1085                     // x coordinate to examine
     37#define TEST_Y 3371                     // y coordinate to examine
    3838
    3939
     
    265265
    266266    int numBad = frac * numGood + 0.5;  // Number of bad values
    267     int low = numBad / 2, high = low + numGood; // Indices (modulo masked pixels) delimiting range of interest
     267    int low = numBad / 2, high = low + numGood - numBad; // Indices (modulo masked pixels)
    268268
    269269    sortBuffer = psVectorSortIndex(sortBuffer, values);
     
    536536#ifdef TESTING
    537537                  if (x == TEST_X && y == TEST_Y) {
    538                       fprintf(stderr, "Rejection limit: %f\n", limit);
     538                      fprintf(stderr, "Rejecting without variance; rejection limit: %f\n", limit);
    539539                  }
    540540#endif
    541541              } else {
     542#ifdef TESTING
     543                  if (x == TEST_X && y == TEST_Y) {
     544                      fprintf(stderr, "Rejecting with variance...\n");
     545                  }
     546#endif
    542547                  median = combinationWeightedOlympic(pixelData, pixelWeights, pixelMasks, discard, sort);
    543548              }
Note: See TracChangeset for help on using the changeset viewer.