Changeset 31153 for trunk/psModules/src/objects/pmSourceMoments.c
- Timestamp:
- Apr 4, 2011, 1:04:41 PM (15 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSourceMoments.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:ignore
-
old new 28 28 ChangeLog 29 29 psmodules-*.tar.* 30 a.out.dSYM
-
- Property svn:ignore
-
trunk/psModules/src/objects/pmSourceMoments.c
r29602 r31153 82 82 psF32 Sum = 0.0; 83 83 psF32 Var = 0.0; 84 psF32 SumCore = 0.0; 85 psF32 VarCore = 0.0; 84 86 psF32 R2 = PS_SQR(radius); 85 87 psF32 minSN2 = PS_SQR(minSN); … … 248 250 249 251 int nKronPix = 0; 252 int nCorePix = 0; 253 int nInner = 0; 254 int nOuter = 0; 250 255 Sum = Var = 0.0; 251 256 float SumInner = 0.0; … … 255 260 256 261 psF32 yDiff = row - yCM; 257 if (fabs(yDiff) > radK ron) continue;262 if (fabs(yDiff) > radKouter) continue; 258 263 259 264 psF32 *vPix = source->pixels->data.F32[row]; … … 272 277 273 278 psF32 xDiff = col - xCM; 274 if (fabs(xDiff) > radK ron) continue;279 if (fabs(xDiff) > radKouter) continue; 275 280 276 281 // radKron is just a function of (xDiff, yDiff) … … 293 298 } 294 299 300 // use sigma (fixed by psf) not a radKron based value 301 if (r < sigma) { 302 SumCore += pDiff; 303 VarCore += wDiff; 304 nCorePix ++; 305 } 306 295 307 if ((r > radKinner) && (r < radKron)) { 296 308 SumInner += pDiff; 309 nInner ++; 297 310 } 298 311 if ((r > radKron) && (r < radKouter)) { 299 312 SumOuter += pDiff; 313 nOuter ++; 300 314 } 301 315 } 302 316 } 303 source->moments->KronFlux = Sum; 304 source->moments->KronFinner = SumInner; 305 source->moments->KronFouter = SumOuter; 306 source->moments->KronFluxErr = sqrt(Var); 317 // *** should I rescale these fluxes by pi R^2 / nNpix? 318 source->moments->KronCore = SumCore * M_PI * PS_SQR(sigma) / nCorePix; 319 source->moments->KronCoreErr = sqrt(VarCore) * M_PI * PS_SQR(sigma) / nCorePix; 320 source->moments->KronFlux = Sum * M_PI * PS_SQR(radKron) / nKronPix; 321 source->moments->KronFluxErr = sqrt(Var) * M_PI * PS_SQR(radKron) / nKronPix; 322 source->moments->KronFinner = SumInner * M_PI * (PS_SQR(radKron) - PS_SQR(radKinner)) / nInner; 323 source->moments->KronFouter = SumOuter * M_PI * (PS_SQR(radKouter) - PS_SQR(radKron)) / nOuter; 307 324 308 325 psTrace ("psModules.objects", 4, "Mrf: %f KronFlux: %f Mxx: %f Mxy: %f Myy: %f Mxxx: %f Mxxy: %f Mxyy: %f Myyy: %f Mxxxx: %f Mxxxy: %f Mxxyy: %f Mxyyy: %f Mxyyy: %f\n", … … 313 330 314 331 psTrace ("psModules.objects", 3, "peak %f %f (%f = %f) Mx: %f My: %f Sum: %f Mxx: %f Mxy: %f Myy: %f sky: %f Npix: %d\n", 315 source->peak->xf, source->peak->yf, source->peak-> flux, source->peak->SN, source->moments->Mx, source->moments->My, Sum, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, sky, source->moments->nPixels);332 source->peak->xf, source->peak->yf, source->peak->rawFlux, sqrt(source->peak->detValue), source->moments->Mx, source->moments->My, Sum, source->moments->Mxx, source->moments->Mxy, source->moments->Myy, sky, source->moments->nPixels); 316 333 317 334 return(true);
Note:
See TracChangeset
for help on using the changeset viewer.
