IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2009, 12:20:59 PM (17 years ago)
Author:
eugene
Message:

add code to calculate norm separately from kernel coeffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmSubtractionVisual.c

    r26318 r26332  
    263263static psImage *targetImage      = NULL;
    264264static psImage *residualImage    = NULL;
     265static psImage *fresidualImage   = NULL;
    265266static psImage *differenceImage  = NULL;
    266267static psImage *convolutionImage = NULL;
     
    289290    targetImage      = psImageAlloc (NXpix, NYpix, PS_TYPE_F32);
    290291    residualImage    = psImageAlloc (NXpix, NYpix, PS_TYPE_F32);
     292    fresidualImage   = psImageAlloc (NXpix, NYpix, PS_TYPE_F32);
    291293    differenceImage  = psImageAlloc (NXpix, NYpix, PS_TYPE_F32);
    292294    convolutionImage = psImageAlloc (NXpix, NYpix, PS_TYPE_F32);
     
    295297    psImageInit (targetImage,      0.0);
    296298    psImageInit (residualImage,    0.0);
     299    psImageInit (fresidualImage,   0.0);
    297300    psImageInit (differenceImage,  0.0);
    298301    psImageInit (convolutionImage, 0.0);
     
    343346        for (int x = -footprint; x <= footprint; x++) {
    344347            residualImage->data.F32[y + NYpix][x + NXpix] = target->kernel[y][x] - background - source->kernel[y][x] * norm + convolution->kernel[y][x];
     348        }
     349    }
     350
     351    // insert the (fresidual) kernel into the (fresidual) image:
     352    for (int y = -footprint; y <= footprint; y++) {
     353        for (int x = -footprint; x <= footprint; x++) {
     354            fresidualImage->data.F32[y + NYpix][x + NXpix] = residualImage->data.F32[y + NYpix][x + NXpix] / target->kernel[y][x];
    345355        }
    346356    }
     
    358368    pmVisualScaleImage(kapa1, convolutionImage, "Convolution Stamps", 2, true);
    359369
     370    // pmVisualScaleImage(kapa2, fresidualImage, "Frac Residual Stamps", 2, true);
     371    pmVisualScaleImage(kapa2, residualImage, "Residual Stamps", 1, true);
    360372    pmVisualScaleImage(kapa2, differenceImage, "Difference Stamps", 0, true);
    361     pmVisualScaleImage(kapa2, residualImage, "Residual Stamps", 1, true);
    362373    pmVisualAskUser(NULL);
    363374
     
    367378    psFree(differenceImage);
    368379    psFree(residualImage);
     380    psFree(fresidualImage);
    369381
    370382    targetImage = NULL;
     
    373385    differenceImage = NULL;
    374386    residualImage = NULL;
     387    fresidualImage = NULL;
    375388
    376389    return true;
Note: See TracChangeset for help on using the changeset viewer.