IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13520


Ignore:
Timestamp:
May 24, 2007, 5:43:22 PM (19 years ago)
Author:
Paul Price
Message:

Catch the case where everything is masked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStack.c

    r13495 r13520  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-05-24 02:13:17 $
     10 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-05-25 03:43:22 $
    1212 *
    1313 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    104104
    105105    // Extract the pixel and mask data
     106    int numBad = 0;                     // Number of bad pixels
    106107    for (int i = 0; i < num; i++) {
    107108        pmStackData *data = inputs->data[i]; // Stack data of interest
     
    110111        pixelData->data.F32[i] = image->data.F32[y][x];
    111112        pixelMasks->data.PS_TYPE_MASK_DATA[i] = mask->data.PS_TYPE_MASK_DATA[y][x];
    112     }
     113        if (pixelMasks->data.PS_TYPE_MASK_DATA[i] & maskVal) {
     114            numBad++;
     115        }
     116    }
     117    if (numBad == num) {
     118        // Catch the case where everything is masked
     119        image->data.F32[y][x] = NAN;
     120        mask->data.PS_TYPE_MASK_DATA[y][x] = bad;
     121        return false;
     122    }
     123
    113124    if (reject) {
    114125        for (int i = 0; i < reject->n; i++) {
Note: See TracChangeset for help on using the changeset viewer.