Changeset 20878
- Timestamp:
- Dec 3, 2008, 1:38:29 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSourceSize.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSourceSize.c
r20867 r20878 100 100 // Compare the central pixel with those on either side, for the four possible lines through it. 101 101 102 // Soften weights (add systematic error) 103 float softening = soft * PS_SQR(source->peak->flux); // Softening for weights 104 102 105 // Across the middle: y = 0 103 106 float cX = 2*resid[yPeak][xPeak] - resid[yPeak+0][xPeak-1] - resid[yPeak+0][xPeak+1]; 104 107 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); 106 109 107 110 // Up the centre: x = 0 108 111 float cY = 2*resid[yPeak][xPeak] - resid[yPeak-1][xPeak+0] - resid[yPeak+1][xPeak+0]; 109 112 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); 111 114 112 115 // Diagonal: x = y 113 116 float cL = 2*resid[yPeak][xPeak] - resid[yPeak-1][xPeak-1] - resid[yPeak+1][xPeak+1]; 114 117 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); 116 119 117 120 // Diagonal: x = - y 118 121 float cR = 2*resid[yPeak][xPeak] - resid[yPeak+1][xPeak-1] - resid[yPeak-1][xPeak+1]; 119 122 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); 128 124 129 125 // P(chisq > chisq_obs; Ndof) = gamma_Q (Ndof/2, chisq/2)
Note:
See TracChangeset
for help on using the changeset viewer.
