IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21293


Ignore:
Timestamp:
Feb 4, 2009, 12:26:42 PM (17 years ago)
Author:
Paul Price
Message:

Adding function to return a convolution kernel.

Location:
branches/pap_branch_20090128/psModules/src/imcombine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/imcombine/pmSubtraction.c

    r21211 r21293  
    915915}
    916916
    917 psImage *pmSubtractionKernelImage(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
     917psKernel *pmSubtractionKernel(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
    918918{
    919919    PM_ASSERT_SUBTRACTION_KERNELS_NON_NULL(kernels, NULL);
     
    922922    PS_ASSERT_FLOAT_WITHIN_RANGE(y, -1.0, 1.0, NULL);
    923923
    924     // Precalulate polynomial values
    925     psImage *polyValues = p_pmSubtractionPolynomial(NULL, kernels->spatialOrder, x, y);
    926 
    927     // The appropriate kernel
    928     psKernel *kernel = solvedKernel(NULL, kernels, polyValues, wantDual);
    929 
     924    psImage *polyValues = p_pmSubtractionPolynomial(NULL, kernels->spatialOrder, x, y); // Solved polynomial
     925    psKernel *kernel = solvedKernel(NULL, kernels, polyValues, wantDual); // The appropriate kernel
    930926    psFree(polyValues);
    931927
     928    return kernel;
     929}
     930
     931psImage *pmSubtractionKernelImage(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
     932{
     933    PM_ASSERT_SUBTRACTION_KERNELS_NON_NULL(kernels, NULL);
     934    PM_ASSERT_SUBTRACTION_KERNELS_SOLUTION(kernels, NULL);
     935    PS_ASSERT_FLOAT_WITHIN_RANGE(x, -1.0, 1.0, NULL);
     936    PS_ASSERT_FLOAT_WITHIN_RANGE(y, -1.0, 1.0, NULL);
     937
     938    psKernel *kernel = pmSubtractionKernel(kernels, x, y, wantDual); // Convolution kernel
    932939    psImage *image = psMemIncrRefCounter(kernel->image); // Image of the kernel
    933940    psFree(kernel);
  • branches/pap_branch_20090128/psModules/src/imcombine/pmSubtraction.h

    r21183 r21293  
    66 * @author GLG, MHPCC
    77 *
    8  * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2009-01-27 06:39:38 $
     8 * @version $Revision: 1.35.2.1 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-02-04 22:26:42 $
    1010 * Copyright 2004-207 Institute for Astronomy, University of Hawaii
    1111 */
     
    7070                              float sigmaRej, ///< Number of RMS deviations above zero at which to reject
    7171                              int footprint ///< Half-size of stamp
     72    );
     73
     74/// Generate the convolution kernel
     75psKernel *pmSubtractionKernel(const pmSubtractionKernels *kernels, ///< Kernel parameters
     76                              float x, float y, ///< Normalised position [-1,1] for which to generate image
     77                              bool wantDual ///< Calculate for the dual kernel?
    7278    );
    7379
Note: See TracChangeset for help on using the changeset viewer.