IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 26, 2008, 4:03:24 PM (18 years ago)
Author:
Paul Price
Message:

Two major changes. 1. Optimising ISIS kernels: instead of doing an FFT convolution, they're separable. 2. Trying to make the convolved weight map account for systematic errors in the convolution kernel by assuming a relative error in each kernel pixel (currently hardwired with a #define, but we can turn it into a recipe value later, or get an estimate from the data) and propagating that into the variance map. The effect is to increase the variance near the bright stars, which is hopefully sufficient to decrease the number of false sources detected in bad subtractions.

File:
1 edited

Legend:

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

    r19532 r19765  
    758758        calculatePenalty(sumVector, kernels);
    759759
     760#ifdef TESTING
     761        {
     762            psImage *inverse = psMatrixInvert(NULL, sumMatrix, NULL);
     763            psFits *fits = psFitsOpen("matrixInv.fits", "w");
     764            psFitsWriteImage(fits, NULL, inverse, 0, NULL);
     765            psFitsClose(fits);
     766            psFree(inverse);
     767        }
     768        {
     769            psImage *X = psMatrixInvert(NULL, sumMatrix, NULL);
     770            psImage *Xt = psMatrixTranspose(NULL, X);
     771            psImage *XtX = psMatrixMultiply(NULL, Xt, X);
     772            psFits *fits = psFitsOpen("matrixErr.fits", "w");
     773            psFitsWriteImage(fits, NULL, XtX, 0, NULL);
     774            psFitsClose(fits);
     775            psFree(X);
     776            psFree(Xt);
     777            psFree(XtX);
     778        }
     779#endif
     780
    760781        psVector *permutation = NULL;       // Permutation vector, required for LU decomposition
    761782        psImage *luMatrix = psMatrixLUD(NULL, &permutation, sumMatrix);
     
    769790        }
    770791        kernels->solution1 = psMatrixLUSolve(kernels->solution1, luMatrix, sumVector, permutation);
     792
    771793        psFree(sumVector);
    772794        psFree(luMatrix);
     
    806828        calculatePenalty(sumVector2, kernels);
    807829
    808 #if 0
    809         // Apply weighting to maximise the difference between solution coefficients for the same functions
    810         double fudge = PS_SQR(2 * stamps->footprint + 1); // Fudge factor
    811         for (int i = 0; i < kernels->num; i++) {
    812             sumMatrix1->data.F64[i][i] -= fudge;
    813             sumMatrix2->data.F64[i][i] += fudge;
    814         }
    815 #endif
    816 
    817830        // Pure matrix operations
    818831
     
    941954#endif
    942955
     956#ifdef TESTING
    943957        {
    944958            psFits *fits = psFitsOpen("sumMatrix1.fits", "w");
     
    961975            psFitsClose(fits);
    962976        }
    963 
     977#endif
    964978
    965979        kernels->solution1 = a;
Note: See TracChangeset for help on using the changeset viewer.