IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 15, 2007, 2:32:43 PM (19 years ago)
Author:
Paul Price
Message:

Making the input mask optional for pmSubtractionMask --- necessary if we're convolving to a desired PSF rather than to an image.

File:
1 edited

Legend:

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

    r14513 r14515  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-08-15 23:17:56 $
     6 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-08-16 00:32:43 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    332332//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    333333
    334 psImage *pmSubtractionMask(const psImage *inMask, const psImage *refMask, psMaskType maskVal,
     334psImage *pmSubtractionMask(const psImage *refMask, const psImage *inMask, psMaskType maskVal,
    335335                           int size, int footprint)
    336336{
    337     PS_ASSERT_IMAGE_NON_NULL(inMask, NULL);
    338     PS_ASSERT_IMAGE_TYPE(inMask, PS_TYPE_MASK, NULL);
    339337    PS_ASSERT_IMAGE_NON_NULL(refMask, NULL);
    340338    PS_ASSERT_IMAGE_TYPE(refMask, PS_TYPE_MASK, NULL);
    341     PS_ASSERT_IMAGES_SIZE_EQUAL(inMask, refMask, NULL);
     339    if (inMask) {
     340        PS_ASSERT_IMAGE_NON_NULL(inMask, NULL);
     341        PS_ASSERT_IMAGE_TYPE(inMask, PS_TYPE_MASK, NULL);
     342        PS_ASSERT_IMAGES_SIZE_EQUAL(inMask, refMask, NULL);
     343    }
    342344    PS_ASSERT_INT_NONNEGATIVE(size, NULL);
    343345    PS_ASSERT_INT_NONNEGATIVE(footprint, NULL);
    344346
    345347    // Size of the images
    346     int numCols = inMask->numCols;
    347     int numRows = inMask->numRows;
     348    int numCols = refMask->numCols;
     349    int numRows = refMask->numRows;
    348350
    349351    // Worried about the masks for bad pixels and bad stamps colliding, so make our own mask
     
    353355    // Dereference for convenience
    354356    psMaskType **maskData = mask->data.PS_TYPE_MASK_DATA;
    355     psMaskType **inData = inMask->data.PS_TYPE_MASK_DATA;
     357    psMaskType **inData = NULL;
     358    if (inMask) {
     359        inData = inMask->data.PS_TYPE_MASK_DATA;
     360    }
    356361    psMaskType **refData = refMask->data.PS_TYPE_MASK_DATA;
    357362
     
    383388    for (int y = 0; y < numRows; y++) {
    384389        for (int x = 0; x < numCols; x++) {
    385             if (inData[y][x] & maskVal) {
     390            if (inData && inData[y][x] & maskVal) {
    386391                maskData[y][x] |= PM_SUBTRACTION_MASK_INPUT;
    387392                // Block out the entire stamp footprint around this pixel
Note: See TracChangeset for help on using the changeset viewer.