- Timestamp:
- Feb 24, 2011, 12:49:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psphot/src/psphotSourceStats.c
r29936 r30753 122 122 // allocate space for moments 123 123 source->moments = pmMomentsAlloc(); 124 125 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) { 126 fprintf (stderr, "moment failure\n"); 127 } 124 128 125 129 // allocate image, weight, mask arrays for each peak (square of radius OUTER) … … 361 365 362 366 bool status = false; 363 float BIG_RADIUS;364 367 psScalar *scalar = NULL; 365 368 … … 415 418 continue; 416 419 } 420 421 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 422 fprintf (stderr, "satstar: %f,%f\n", source->peak->xf, source->peak->yf); 423 } 417 424 418 425 // measure basic source moments (no S/N clipping on input pixels) … … 431 438 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 432 439 } 433 if (status ) {440 if (status && (source->moments->Mrf < 2.0*SIGMA)) { 434 441 Nmoments ++; 435 442 continue; 436 443 } 437 444 438 // if no valid pixels, or massive swing, likely saturated source,445 // if no valid pixels, massive swing or very large Mrf, likely saturated source, 439 446 // try a much larger box 440 BIG_RADIUS = PS_MIN (INNER, 3*RADIUS); 447 float BIG_RADIUS = 3.0*RADIUS; 448 float BIG_SIGMA = 3.0*SIGMA; 449 450 { 451 // NOTE this is slightly sleazy, but only slightly: pmSourceRedefinePixels uses the readout 452 // to pass the pointers to the parent image data. I guess the API could be simplified: 453 // we could recover this from the source in the function 454 455 pmReadout tmpReadout; 456 tmpReadout.image = (psImage *)source->pixels->parent; 457 tmpReadout.mask = (psImage *)source->maskView->parent; 458 tmpReadout.variance = (psImage *)source->variance->parent; 459 460 // re-allocate image, weight, mask arrays for each peak (square of radius OUTER) 461 pmSourceRedefinePixels (source, &tmpReadout, source->peak->x, source->peak->y, BIG_RADIUS + 2); 462 } 463 441 464 psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y); 442 status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, 0.0, maskVal);465 status = pmSourceMoments (source, BIG_RADIUS, BIG_SIGMA, 0.0, maskVal); 443 466 if (status) { 444 467 source->mode |= PM_SOURCE_MODE_BIG_RADIUS;
Note:
See TracChangeset
for help on using the changeset viewer.
