Changeset 34312
- Timestamp:
- Aug 14, 2012, 5:05:39 PM (14 years ago)
- File:
-
- 1 edited
-
tags/ipp-20120802/psphot/src/psphotKronIterate.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20120802/psphot/src/psphotKronIterate.c
r33964 r34312 160 160 161 161 // generate the window image: multiply the flux by this to downweight neighbors 162 // XXX: we don't need this image if we aren't going to apply the window 162 163 psImage *kronWindow = psImageAlloc (readout->image->numCols, readout->image->numRows, PS_TYPE_F32); 163 164 psImageInit (kronWindow, 1.0); … … 329 330 } else { 330 331 if (KRON_SB_MIN_DIVISOR) { 331 if (isfinite(source->moments->KronFlux) && (source->moments->KronFlux > 0)) { 332 // Limit window radius based on surface brightness 332 // Limit window radius based on surface brightness if we have a good measurement of kron flux 333 if (isfinite(source->moments->Mrf) && source->moments->Mrf > 0 && 334 isfinite(source->moments->KronFlux) && (source->moments->KronFlux > 0)) { 333 335 float Rmax = sqrt(source->moments->KronFlux) / KRON_SB_MIN_DIVISOR; 334 336 335 if (source->moments->Mrf > 0) { 336 maxWindow = PS_MIN(6.0*source->moments->Mrf, Rmax); 337 } else { 338 maxWindow = Rmax; 339 } 337 maxWindow = PS_MIN(6.0*source->moments->Mrf, Rmax); 340 338 } else { 341 339 maxWindow = RADIUS; 342 340 } 343 341 } else { 344 // old code342 // old recipe, no surface brightness cut 345 343 maxWindow = isfinite(source->moments->Mrf) ? 6.0*source->moments->Mrf : RADIUS; 346 344 } … … 491 489 } 492 490 491 float MrfTry = RF/RS; 492 if (!isfinite(MrfTry)) { 493 // We did not get a successul measurement of the kron radius. 494 // Leave the current values unchanged. 495 return false; 496 } 497 498 float Mrf = MAX(minKronRadius, MrfTry); 493 499 // Saturate the 1st radial moment 494 float Mrf = MAX(minKronRadius, RF/RS);495 500 if (sqrt(source->peak->detValue) < 10.0) { 496 501 Mrf = MIN (radius, Mrf); … … 559 564 psAssert(kronWindow, "need a window"); 560 565 566 // If we are not applying the window then we don't need to check for valid Mrf here. 567 // We should give the this module a chance to measure a good value. 568 // Not yet though. We need to test the effect of this 561 569 if (!isfinite(source->moments->Mrf) || source->moments->Mrf < 0 ) return false; 562 570
Note:
See TracChangeset
for help on using the changeset viewer.
