IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18190


Ignore:
Timestamp:
Jun 18, 2008, 5:03:53 PM (18 years ago)
Author:
Paul Price
Message:

Need to correct for the non-unity scaling of the kernel.

File:
1 edited

Legend:

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

    r18163 r18190  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-06-17 22:16:38 $
     6 *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-06-19 03:03:53 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    642642
    643643    double sumKernel2 = 0.0;            // Sum of the kernel squared
     644    double sumKernel = 0.0;             // Sum of the kernel
    644645    for (int y = kernel->yMin; y <= kernel->yMax; y++) {
    645646        for (int x = kernel->xMin; x <= kernel->xMax; x++) {
     647            sumKernel += kernel->kernel[y][x];
    646648            sumKernel2 += PS_SQR(kernel->kernel[y][x]);
    647649        }
     
    650652    psFree(kernel);
    651653
    652     return sumKernel2;
     654    return sumKernel2 / PS_SQR(sumKernel);
    653655}
    654656
Note: See TracChangeset for help on using the changeset viewer.