Changeset 23989 for trunk/psphot/src/psphotMakeResiduals.c
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMakeResiduals.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMakeResiduals.c
r21366 r23989 200 200 // measure the robust median to determine a baseline reference value 201 201 *fluxClip = *fluxClipDef; 202 psVectorStats (fluxClip, fluxes, NULL, fmasks, fmaskVal); 203 psErrorClear(); // clear (ignore) any outstanding errors 202 if (!psVectorStats (fluxClip, fluxes, NULL, fmasks, fmaskVal)) { 203 psError(PSPHOT_ERR_CONFIG, false, "Error calculating residual stats"); 204 return false; 205 } 206 if (isnan(fluxClip->robustMedian)) { 207 resid->Ro->data.F32[oy][ox] = 0.0; 208 resid->Rx->data.F32[oy][ox] = 0.0; 209 resid->Ry->data.F32[oy][ox] = 0.0; 210 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = badMask; 211 continue; 212 } 204 213 205 214 // mark input pixels which are more than N sigma from the median … … 220 229 // measure the desired statistic on the unclipped pixels 221 230 *fluxStats = *fluxStatsDef; 222 psVectorStats (fluxStats, fluxes, NULL, fmasks, fmaskVal); 223 psErrorClear(); // clear (ignore) any outstanding errors 231 if (!psVectorStats (fluxStats, fluxes, NULL, fmasks, fmaskVal)) { 232 psError(PSPHOT_ERR_CONFIG, false, "Error calculating residual stats"); 233 return false; 234 } 224 235 225 236 resid->Ro->data.F32[oy][ox] = psStatsGetValue(fluxStats, statOption); 226 237 resid->Rx->data.F32[oy][ox] = resid->Ry->data.F32[oy][ox] = 0.0; 227 //resid->variance->data.F32[oy][ox] = fluxStats->sampleStdev; 238 239 if (isnan(resid->Ro->data.F32[oy][ox])) { 240 resid->Ro->data.F32[oy][ox] = 0.0; 241 resid->Rx->data.F32[oy][ox] = 0.0; 242 resid->Ry->data.F32[oy][ox] = 0.0; 243 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = badMask; 244 continue; 245 } 228 246 229 247 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*fluxStats->sampleStdev/sqrt(nKeep)) {
Note:
See TracChangeset
for help on using the changeset viewer.
