IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2008, 12:16:38 PM (18 years ago)
Author:
Paul Price
Message:

Changing use of psDB* to pmConfig* so that the database handle only has to be set up when required.

File:
1 edited

Legend:

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

    r18043 r18163  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-06-10 02:43:01 $
     6 *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-06-17 22:16:38 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    627627}
    628628
     629
     630float pmSubtractionVarianceFactor(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
     631{
     632    PM_ASSERT_SUBTRACTION_KERNELS_NON_NULL(kernels, NAN);
     633    PM_ASSERT_SUBTRACTION_KERNELS_SOLUTION(kernels, NAN);
     634    PS_ASSERT_FLOAT_WITHIN_RANGE(x, -1.0, 1.0, NAN);
     635    PS_ASSERT_FLOAT_WITHIN_RANGE(y, -1.0, 1.0, NAN);
     636
     637    // Precalulate polynomial values
     638    psImage *polyValues = p_pmSubtractionPolynomial(NULL, kernels->spatialOrder, x, y);
     639
     640    psKernel *kernel = solvedKernel(NULL, kernels, polyValues, wantDual); // The appropriate kernel
     641    psFree(polyValues);
     642
     643    double sumKernel2 = 0.0;            // Sum of the kernel squared
     644    for (int y = kernel->yMin; y <= kernel->yMax; y++) {
     645        for (int x = kernel->xMin; x <= kernel->xMax; x++) {
     646            sumKernel2 += PS_SQR(kernel->kernel[y][x]);
     647        }
     648    }
     649
     650    psFree(kernel);
     651
     652    return sumKernel2;
     653}
     654
    629655#if 0
    630656psArray *pmSubtractionKernelSolutions(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
Note: See TracChangeset for help on using the changeset viewer.