- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotMakeResiduals.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psphot merged eligible /branches/eam_branches/stackphot.20100406/psphot 27622-27655 /branches/pap_delete/psphot 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simtest_nebulous_branches/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy 21 psphotForced 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/psphot/src/psphotMakeResiduals.c
r23989 r27840 1 1 # include "psphotInternal.h" 2 3 # define RESIDUAL_SOFTENING 0.005 2 4 3 5 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, psImageMaskType maskVal) { … … 31 33 32 34 float pixelSN = psMetadataLookupF32(&status, recipe, "PSF.RESIDUALS.PIX.SN"); 35 PS_ASSERT (status, false); 36 37 float radiusMax = psMetadataLookupF32(&status, recipe, "PSF.RESIDUALS.RADIUS"); 33 38 PS_ASSERT (status, false); 34 39 … … 171 176 bool offImage = false; 172 177 if (psImageInterpolate (&flux, &dflux, &mflux, ix, iy, interp) == PS_INTERPOLATE_STATUS_OFF) { 173 // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux);174 178 // This pixel is off the image 175 179 offImage = true; … … 179 183 } 180 184 fluxes->data.F32[i] = flux; 181 dfluxes->data.F32[i] = dflux;185 dfluxes->data.F32[i] = hypot(dflux, RESIDUAL_SOFTENING); 182 186 if (isnan(flux)) { 187 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = badMask; 188 } 189 if (isnan(dflux)) { 183 190 fmasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = badMask; 184 191 } … … 234 241 } 235 242 243 float radius = hypot((ox - 0.5*resid->Ro->numCols), (oy - 0.5*resid->Ro->numRows)); 244 if (radius > radiusMax) { 245 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 246 continue; 247 } 248 236 249 resid->Ro->data.F32[oy][ox] = psStatsGetValue(fluxStats, statOption); 237 250 resid->Rx->data.F32[oy][ox] = resid->Ry->data.F32[oy][ox] = 0.0; … … 248 261 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 249 262 } 250 251 // 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.PM_TYPE_RESID_MASK_DATA[oy][ox]);252 253 263 } else { 254 264 assert (SPATIAL_ORDER == 1); 265 266 float radius = hypot((ox - 0.5*resid->Ro->numCols), (oy - 0.5*resid->Ro->numRows)); 267 if (radius > radiusMax) { 268 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 269 continue; 270 } 271 255 272 psImageInit(A, 0.0); 256 273 psVectorInit(B, 0.0); … … 275 292 276 293 if (!psMatrixGJSolve(A, B)) { 277 psError(PSPHOT_ERR_PSF, false, "Singular matrix solving for (y,x) = (%d,%d)'s residuals", 278 oy, ox); 279 psFree(resid); resid = NULL; 280 break; 294 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 295 psWarning("Singular matrix solving for (y,x) = (%d,%d)'s residuals, masking", oy, ox); 296 continue; 281 297 } 282 298 … … 286 302 287 303 float dRo = sqrt(A->data.F32[0][0]); 288 // fprintf (stderr, "res: %2d %2d : %6.4f %6.4f %6.4f %3d %1d\n",289 // ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox]);290 304 291 305 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*dRo/sqrt(nKeep)) { 292 306 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = 1; 293 } 294 //resid->variance->data.F32[oy][ox] = XXX; 307 resid->Ro->data.F32[oy][ox] = 0.0; 308 resid->Rx->data.F32[oy][ox] = 0.0; 309 resid->Ry->data.F32[oy][ox] = 0.0; 310 } 295 311 } 296 312 }
Note:
See TracChangeset
for help on using the changeset viewer.
