IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2010, 12:12:38 PM (16 years ago)
Author:
eugene
Message:

ensure masked pixels are NAN in output; flag detections with bright pos image neighbors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubBackground.c

    r26982 r29003  
    6767    for (int y = 0; y < numRows; y++) {
    6868        for (int x = 0; x < numCols; x++) {
     69            // special case 1: NAN the masked pixels
    6970            if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) {
    70                 image->data.F32[y][x] = 0.0;
    71             } else {
    72                 float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelImage, binning); // Background value
    73                 if (!isfinite(value)) {
    74                     image->data.F32[y][x] = NAN;
    75                     mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskBad;
    76                 } else {
    77                     image->data.F32[y][x] -= value;
    78                 }
    79             }
     71                image->data.F32[y][x] = NAN;
     72                continue;
     73            }
     74            // special case 1: NAN & mask pixels without a valid background model
     75            float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelImage, binning); // Background value
     76            if (!isfinite(value)) {
     77              image->data.F32[y][x] = NAN;
     78              mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskBad;
     79              continue;
     80            }
     81            image->data.F32[y][x] -= value;
    8082        }
    8183    }
Note: See TracChangeset for help on using the changeset viewer.