IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 27, 2009, 1:26:55 PM (17 years ago)
Author:
Paul Price
Message:

Can now combine images without convolving, but it doesn't apply any rejection yet.

File:
1 edited

Legend:

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

    r23346 r23576  
    185185    assert(outRO);
    186186    assert(readouts);
    187     assert(rejected);
    188     assert(readouts->n == rejected->n);
     187    assert(!rejected || readouts->n == rejected->n);
    189188    assert(mask && mask->n == readouts->n && mask->type.type == PS_TYPE_VECTOR_MASK);
    190189    assert(weightings && weightings->n == readouts->n && weightings->type.type == PS_TYPE_F32);
     
    207206    psArray *stack = psArrayAlloc(num); // Array for stacking
    208207
    209     int numGood = num;                  // Number of good inputs: images that haven't been completely rejected
     208    bool entire = (rejected ? false : true); // Combine entire image?
    210209    for (int i = 0; i < num; i++) {
    211210        pmReadout *ro = readouts->data[i];
    212         if (!ro || !rejected->data[i] || mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    213             // Image completely rejected
    214             numGood--;
     211        if (mask->data.U8[i] & (PPSTACK_MASK_REJECT | PPSTACK_MASK_BAD)) {
     212            // Image completely rejected since previous combination
     213            entire = true;
     214            continue;
     215        } else if (mask->data.U8[i]) {
     216            // Image completely rejected before original combination
    215217            continue;
    216218        }
     
    234236        pmStackData *data = pmStackDataAlloc(ro, weightings->data.F32[i],
    235237                                             addVariance ? addVariance->data.F32[i] : NAN);
    236         data->reject = psMemIncrRefCounter(rejected->data[i]);
     238        data->reject = rejected ? psMemIncrRefCounter(rejected->data[i]) : NULL;
    237239        stack->data[i] = data;
    238240    }
    239241
    240242    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, 0, 0, NAN, NAN, NAN,
    241                         numGood != num, useVariance, false)) {
     243                        entire, useVariance, false)) {
    242244        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    243245        psFree(stack);
Note: See TracChangeset for help on using the changeset viewer.