IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2008, 11:39:43 AM (18 years ago)
Author:
Paul Price
Message:

Reject an entire image if the fraction of rejected pixels exceeds a recipe-defined limit. Cleared out old recipe inputs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackLoop.c

    r16999 r17006  
    183183
    184184    float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution
     185    float imageRej = psMetadataLookupF32(NULL, config->arguments, "IMAGE.REJ"); // Maximum fraction of image to reject before rejecting entire image
    185186
    186187    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics
     
    472473                                             subKernels->data[i]); // Pixels to reject
    473474            psFree(inspect);
    474             psTrace("ppStack", 5, "%ld pixels rejected from image %d", reject->n, i);
     475            float frac = reject->n / (float)(ro->image->numCols * ro->image->numRows); // Pixel fraction
     476            psTrace("ppStack", 5, "%ld pixels rejected from image %d (%.1f%%)", reject->n, i, frac * 100.0);
     477            if (frac > imageRej) {
     478                psWarning("Image %d rejected completely because rejection fraction (%.3f) "
     479                          "exceeds limit (%.3f)", i, frac, imageRej);
     480                psFree(reject);
     481                // reject == NULL means reject image completely
     482                reject = NULL;
     483            }
    475484            rejected->data[i] = reject;
    476485        }
     
    484493            psTrace("ppStack", 2, "Final stack of chunk %d....\n", numChunk);
    485494            for (int i = 0; i < num; i++) {
     495                if (!rejected->data[i]) {
     496                    continue;
     497                }
    486498                pmReadout *readout = readouts->data[i];
    487499                assert(readout);
Note: See TracChangeset for help on using the changeset viewer.