IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20878


Ignore:
Timestamp:
Dec 3, 2008, 1:38:29 PM (17 years ago)
Author:
eugene
Message:

soften by adding to the variance, not the error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceSize.c

    r20867 r20878  
    100100        // Compare the central pixel with those on either side, for the four possible lines through it.
    101101
     102        // Soften weights (add systematic error)
     103        float softening = soft * PS_SQR(source->peak->flux); // Softening for weights
     104
    102105        // Across the middle: y = 0
    103106        float cX = 2*resid[yPeak][xPeak]   - resid[yPeak+0][xPeak-1]  - resid[yPeak+0][xPeak+1];
    104107        float dcX = 4*weight[yPeak][xPeak] + weight[yPeak+0][xPeak-1] + weight[yPeak+0][xPeak+1];
    105         float nX = cX / sqrtf(dcX);
     108        float nX = cX / sqrtf(dcX + softening);
    106109
    107110        // Up the centre: x = 0
    108111        float cY = 2*resid[yPeak][xPeak]   - resid[yPeak-1][xPeak+0]  - resid[yPeak+1][xPeak+0];
    109112        float dcY = 4*weight[yPeak][xPeak] + weight[yPeak-1][xPeak+0] + weight[yPeak+1][xPeak+0];
    110         float nY = cY / sqrtf(dcY);
     113        float nY = cY / sqrtf(dcY + softening);
    111114
    112115        // Diagonal: x = y
    113116        float cL = 2*resid[yPeak][xPeak]   - resid[yPeak-1][xPeak-1]  - resid[yPeak+1][xPeak+1];
    114117        float dcL = 4*weight[yPeak][xPeak] + weight[yPeak-1][xPeak-1] + weight[yPeak+1][xPeak+1];
    115         float nL = cL / sqrtf(dcL);
     118        float nL = cL / sqrtf(dcL + softening);
    116119
    117120        // Diagonal: x = - y
    118121        float cR = 2*resid[yPeak][xPeak]   - resid[yPeak+1][xPeak-1]  - resid[yPeak-1][xPeak+1];
    119122        float dcR = 4*weight[yPeak][xPeak] + weight[yPeak+1][xPeak-1] + weight[yPeak-1][xPeak+1];
    120         float nR = cR / sqrtf(dcR);
    121 
    122         // Soften weights (add systematic error)
    123         float softening = 6 * soft * source->peak->flux; // Softening for weights
    124         dcX += softening;
    125         dcY += softening;
    126         dcL += softening;
    127         dcR += softening;
     123        float nR = cR / sqrtf(dcR + softening);
    128124
    129125        // P(chisq > chisq_obs; Ndof) = gamma_Q (Ndof/2, chisq/2)
Note: See TracChangeset for help on using the changeset viewer.