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/ppStackReadout.c

    r16987 r17006  
    6666    }
    6767
    68     if (!pmStackCombine(outRO, stack, maskBad, maskBlank, kernelSize, iter, combineRej, useVariance, safe)) {
     68    if (!pmStackCombine(outRO, stack, maskBad, maskBlank, kernelSize, iter, combineRej, true,
     69                        useVariance, safe)) {
    6970        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
    7071        psFree(stack);
     
    8586    for (int i = 0; i < stack->n; i++) {
    8687        pmStackData *data = stack->data[i]; // Data for this image
    87         psImage *inspected = psPixelsToMask(NULL, data->pixels,
     88        psImage *inspected = psPixelsToMask(NULL, data->inspect,
    8889                                            psRegionSet(0, outRO->image->numCols - 1,
    8990                                                        0, outRO->image->numRows - 1),
     
    105106        psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, PPSTACK_INSPECT_PIXELS,
    106107                         PS_DATA_PIXELS | PS_META_DUPLICATE_OK, "Pixels to inspect from initial combination",
    107                          data->pixels);
    108     }
    109 
     108                         data->inspect);
     109    }
    110110    psFree(stack);
    111111
     
    144144    psList *fpaList = psListAlloc(NULL); // List of input FPAs, for concept averaging
    145145    psList *cellList = psListAlloc(NULL); // List of input cells, for concept averaging
     146    int numGood = num;                  // Number of good inputs: images that haven't been completely rejected
    146147    for (int i = 0; i < num; i++) {
     148        if (!rejected->data[i]) {
     149            // Image completely rejected
     150            numGood--;
     151            continue;
     152        }
     153
    147154        pmReadout *ro = readouts->data[i];
    148155        assert(ro);
     
    201208
    202209        pmStackData *data = pmStackDataAlloc(ro, weighting);
    203         data->pixels = psMemIncrRefCounter(rejected->data[i]);
     210        data->reject = psMemIncrRefCounter(rejected->data[i]);
    204211        stack->data[i] = data;
    205212    }
     
    212219                continue;
    213220            }
    214             psImage *reject = psPixelsToMask(NULL, data->pixels,
     221            psImage *reject = psPixelsToMask(NULL, data->reject,
    215222                                             psRegionSet(0, outRO->image->numCols - 1,
    216223                                                         0, outRO->image->numRows - 1),
     
    227234#endif
    228235
    229     if (!pmStackCombine(outRO, stack, maskBad, maskBlank, 0, 0, NAN, useVariance, false)) {
     236    if (!pmStackCombine(outRO, stack, maskBad, maskBlank, 0, 0, NAN, numGood != num, useVariance, false)) {
    230237        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    231238        psFree(fpaList);
Note: See TracChangeset for help on using the changeset viewer.