IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30219


Ignore:
Timestamp:
Jan 7, 2011, 1:53:19 PM (15 years ago)
Author:
eugene
Message:

covarFactor here was inconsistent with the value calculated in psphotSignificanceImage; now they both rescale by sum2 of the kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psphot/src/psphotEfficiency.c

    r29936 r30219  
    3131    assert(covarFactor);
    3232
     33    // apply the amplitude of kernel^2 to the covarFactor (why?)
     34    // XXX this is simply undoing the scale scalculate in psImageCovarianceCalculateFactor
     35    // if this is the right solution, make this extra calculation optional (and explain...)
    3336    psKernel *kernel = psImageSmoothKernel(smoothSigma, smoothNsigma); // Kernel used for smoothing
    34     *covarFactor = psImageCovarianceCalculateFactor(kernel, ro->covariance);
     37    double sum2 = 0.0;                                               // Sum of kernel squared
     38    for (int y = kernel->yMin; y <= kernel->yMax; y++) {
     39        for (int x = kernel->xMin; x <= kernel->xMax; x++) {
     40            sum2 += PS_SQR(kernel->kernel[y][x]);
     41        }
     42    }
     43    *covarFactor = sum2 * psImageCovarianceCalculateFactor(kernel, ro->covariance);
    3544    psFree(kernel);
    3645
     
    7079    float fluxLim = 2.0 * *norm * peakLim; // Limiting flux in original
    7180    *magLim = -2.5 * log10f(fluxLim);
     81    psTrace("psphot.fake", 1, "Covar Factor:  %f\n", *covarFactor);
    7282    psTrace("psphot.fake", 1, "Limiting peak: %f\n", peakLim);
    7383    psTrace("psphot.fake", 1, "Limiting flux: %f\n", fluxLim);
Note: See TracChangeset for help on using the changeset viewer.