IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25279


Ignore:
Timestamp:
Sep 7, 2009, 3:41:03 PM (17 years ago)
Author:
Paul Price
Message:

Fixing pmSubtractionKernelSolutions to work with current way of carrying solutions around.

Location:
trunk/psModules/src/imcombine
Files:
3 edited

Legend:

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

    r25120 r25279  
    957957    PS_ASSERT_FLOAT_WITHIN_RANGE(y, -1.0, 1.0, NULL);
    958958
    959     psArray *images = psArrayAlloc(solution->n - 1); // Images of each kernel to return
    960     psVector *fakeSolution = psVectorAlloc(solution->n, PS_TYPE_F64); // Fake solution vector
     959    psArray *images = psArrayAlloc(kernels->solution1->n - 1); // Images of each kernel to return
     960    psVector *fakeSolution = psVectorAlloc(kernels->solution1->n, PS_TYPE_F64); // Fake solution vector
    961961    psVectorInit(fakeSolution, 0.0);
    962962
    963     for (int i = 0; i < solution->n - 1; i++) {
    964         fakeSolution->data.F64[i] = solution->data.F64[i];
     963    for (int i = 0; i < kernels->solution1->n - 1; i++) {
     964        fakeSolution->data.F64[i] = kernels->solution1->data.F64[i];
    965965        images->data[i] = pmSubtractionKernelImage(kernels, x, y, wantDual);
    966966        fakeSolution->data.F64[i] = 0.0;
  • trunk/psModules/src/imcombine/pmSubtraction.h

    r25120 r25279  
    9393
    9494/// Generate images of the convolution kernel elements
    95 psArray *pmSubtractionKernelSolutions(const psVector *solution, ///< Solution vector
    96                                       const pmSubtractionKernels *kernels, ///< Kernel parameters
    97                                       float x, float y ///< Normalised position [-1,1] for images
     95psArray *pmSubtractionKernelSolutions(const pmSubtractionKernels *kernels, ///< Kernel parameters
     96                                      float x, float y, ///< Normalised position [-1,1] for images
     97                                      bool wantDual ///< Calculate for the dual kernel?
    9898    );
     99
    99100
    100101/// Execute a thread job to convolve a patch of the image
  • trunk/psModules/src/imcombine/pmSubtractionAnalysis.c

    r25119 r25279  
    121121    {
    122122        psMetadata *header = psMetadataAlloc(); // Header
    123         for (int i = 0; i < solution->n; i++) {
     123        for (int i = 0; i < kernels->solution1->n; i++) {
    124124            psString name = NULL;       // Header keyword
    125125            psStringAppend(&name, "SOLN%04d", i);
    126             psMetadataAddF64(header, PS_LIST_TAIL, name, 0, NULL, solution->data.F64[i]);
     126            psMetadataAddF64(header, PS_LIST_TAIL, name, 0, NULL, kernels->solution1->data.F64[i]);
    127127            psFree(name);
    128128        }
    129         psArray *kernelImages = pmSubtractionKernelSolutions(solution, kernels, 0.0, 0.0);
     129        psArray *kernelImages = pmSubtractionKernelSolutions(kernels, 0.0, 0.0, false);
    130130        psFits *kernelFile = psFitsOpen("kernels.fits", "w");
    131131        (void)psFitsWriteImageCube(kernelFile, header, kernelImages, NULL);
Note: See TracChangeset for help on using the changeset viewer.