IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24905


Ignore:
Timestamp:
Jul 22, 2009, 9:52:11 PM (17 years ago)
Author:
Paul Price
Message:

If statistics can't be calculated, kill entire readout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmPattern.c

    r24903 r24905  
    4848    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator
    4949    if (!psImageBackground(stats, NULL, ro->image, ro->mask, maskVal, rng)) {
    50         psWarning("Unable to calculate statistics on readout.");
     50        psWarning("Unable to calculate statistics on readout; masking entire readout.");
     51        psErrorClear();
    5152        psFree(stats);
    5253        psFree(rng);
    53         return false;
     54        psImageInit(image, NAN);
     55        if (mask) {
     56            psBinaryOp(mask, mask, "|", psScalarAlloc(maskBad, PS_TYPE_IMAGE_MASK));
     57        }
     58        if (ro->variance) {
     59            psImageInit(image, NAN);
     60        }
     61        return true;
    5462    }
    5563    float lower = stats->robustMedian - thresh * stats->robustStdev; // Lower bound for data
Note: See TracChangeset for help on using the changeset viewer.