Changeset 20451
- Timestamp:
- Oct 28, 2008, 2:03:17 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMakeResiduals.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMakeResiduals.c
r20307 r20451 125 125 } 126 126 pmResiduals *resid = pmResidualsAlloc (xSize, ySize, xBin, yBin); 127 psImageInit (resid->mask, 0); 127 128 128 129 // x(resid) = (x(image) - Xo)*xBin + xCenter … … 195 196 196 197 // mark input pixels which are more than N sigma from the median 198 int nKeep = 0; 197 199 for (int i = 0; i < fluxes->n; i++) { 198 200 float delta = fluxes->data.F32[i] - fluxClip->robustMedian; … … 204 206 fmasks->data.U8[i] = clippedMask; 205 207 } 208 if (!fmasks->data.U8[i]) nKeep++; 206 209 } 207 210 … … 216 219 //resid->weight->data.F32[oy][ox] = fluxStats->sampleStdev; 217 220 218 if ( resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) {221 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*fluxStats->sampleStdev/sqrt(nKeep)) { 219 222 resid->mask->data.U8[oy][ox] = 1; 220 223 } 224 225 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], fluxStats->sampleStdev, fluxStats->sampleStdev/sqrt(nKeep), nKeep, resid->mask->data.U8[oy][ox]); 221 226 222 227 } else { … … 255 260 256 261 float dRo = sqrt(A->data.F32[0][0]); 257 if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) { 262 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.U8[oy][ox]); 263 264 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*dRo/sqrt(nKeep)) { 258 265 resid->mask->data.U8[oy][ox] = 1; 259 266 }
Note:
See TracChangeset
for help on using the changeset viewer.
