IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 1, 2014, 4:02:29 PM (12 years ago)
Author:
mhuber
Message:

adhoc extra blank masking of final stack border, default is 0 pixels

File:
1 edited

Legend:

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

    r33093 r36717  
    33// This is the doomsday switch.
    44// #define TESTING                         // Enable test output
     5
     6//MEH -- adhoc addition to blank mask border of final stack since rejection different/none on order of KERNEL.SIZE with overlap in CombineInitial
     7static void stackBorderMask(psImage *image, // Image to mark as blank
     8                            psImage *mask, // Mask to mark as blank (or NULL)
     9                            psImage *variance, // Weight map to mark as blank (or NULL)
     10                            int numCols, int numRows, // Size of image
     11                            int size, // Size to mark blank
     12                            psImageMaskType blank // Blank mask value
     13    )
     14{
     15    for (int y = size; y < numRows - size; y++) {
     16        for (int x = 0; x < size; x++) {
     17            image->data.F32[y][x] = NAN;
     18            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     19            variance->data.F32[y][x] = NAN;
     20        }
     21        for (int x = numCols - size; x < numCols; x++) {
     22            image->data.F32[y][x] = NAN;
     23            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     24            variance->data.F32[y][x] = NAN;
     25        }
     26    }
     27    for (int y = 0; y < size; y++) {
     28        for (int x = 0; x < numCols; x++) {
     29            image->data.F32[y][x] = NAN;
     30            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     31            variance->data.F32[y][x] = NAN;
     32        }
     33    }
     34    for (int y = numRows - size; y < numRows; y++) {
     35        for (int x = 0; x < numCols; x++) {
     36            image->data.F32[y][x] = NAN;
     37            mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = blank;
     38            variance->data.F32[y][x] = NAN;
     39        }
     40    }
     41    return;
     42}
     43
    544
    645bool ppStackCombineFinal(ppStackThreadData *stack, psArray *covariances, ppStackOptions *options,
     
    2059    psAssert(recipe, "We've thrown an error on this before.");
    2160    float poorFrac = psMetadataLookupF32(NULL, recipe, "POOR.FRACTION"); // Fraction for "poor"
     61
     62    int sizeBlank = psMetadataLookupS32(NULL, recipe, "MASK.BLANKBORDER"); // Pixels to mask BLANK from edge
     63    psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
    2264
    2365    // Grow the list of rejected pixels, if desired
     
    109151#endif
    110152
     153    //MEH blank mask/manual reject border on final stack --
     154    if (sizeBlank > 0) {
     155        stackBorderMask(outRO->image,outRO->mask,outRO->variance,numCols,numRows,sizeBlank,maskBlank);
     156        stackBorderMask(expRO->image,expRO->mask,expRO->variance,numCols,numRows,sizeBlank,0);
     157    }
     158
    111159    if (options->stats) {
    112160        // only add the timer if it has not been set (convolved stack)
Note: See TracChangeset for help on using the changeset viewer.