IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 27, 2009, 3:08:33 PM (17 years ago)
Author:
Paul Price
Message:

Ensure we can reject pixels when combining images without convolution.

File:
1 edited

Legend:

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

    r23576 r23577  
    150150
    151151    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, kernelSize, iter,
    152                         combineRej, combineSys, combineDiscard, true, useVariance, safe)) {
     152                        combineRej, combineSys, combineDiscard, true, useVariance, safe, false)) {
    153153        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
    154154        psFree(stack);
     
    196196
    197197    bool mdok;                          // Status of MD lookup
     198    int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations
     199    float combineRej = psMetadataLookupF32(NULL, recipe, "COMBINE.REJ"); // Combination threshold
     200    float combineSys = psMetadataLookupF32(NULL, recipe, "COMBINE.SYS"); // Combination systematic error
     201    float combineDiscard = psMetadataLookupF32(NULL, recipe, "COMBINE.DISCARD"); // Olympic discard fraction
    198202    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
     203    bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
    199204
    200205    psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in
     
    206211    psArray *stack = psArrayAlloc(num); // Array for stacking
    207212
    208     bool entire = (rejected ? false : true); // Combine entire image?
     213    bool entire = true;                 // Combine entire image?
     214    if (rejected) {
     215        // We have rejection from a previous combination: combine without flagging pixels to inspect
     216        entire = false;
     217        safe = false;
     218        iter = 0;
     219        combineRej = NAN;
     220        combineSys = NAN;
     221    }
     222
    209223    for (int i = 0; i < num; i++) {
    210224        pmReadout *ro = readouts->data[i];
     
    240254    }
    241255
    242     if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, 0, 0, NAN, NAN, NAN,
    243                         entire, useVariance, false)) {
     256    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, 0,
     257                        iter, combineRej, combineSys, combineDiscard,
     258                        entire, useVariance, safe, !rejected)) {
    244259        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    245260        psFree(stack);
Note: See TracChangeset for help on using the changeset viewer.