- Timestamp:
- Dec 4, 2013, 2:00:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psphot/src/psphotExtendedSourceFits.c
r36333 r36342 64 64 psLogMsg("psphot", PS_LOG_INFO, "extended source fits for image %d", index); 65 65 psphotVisualShowImage(readout); 66 67 // psphotSaveImage (NULL, readout->image, "test.01.fits");68 66 69 67 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 302 300 psArrayAdd(job->args, 1, cells->data[j]); // sources 303 301 psArrayAdd(job->args, 1, models); 302 304 303 // Allocate a metadata iterator here because psMetadataIteratorAlloc/Free are not thread safe 305 304 psMetadataIterator *iter = psMetadataIteratorAlloc (models, PS_LIST_HEAD, NULL); … … 321 320 322 321 // XXX TEST 323 if ( true &&!isInteractive) {322 if (!isInteractive) { 324 323 if (!psThreadJobAddPending(job)) { 325 324 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); … … 403 402 psphotSersicModelClassCleanup(); 404 403 405 // psphotSaveImage (NULL, readout->image, "test.02.fits");406 407 404 psphotVisualShowResidualImage (readout, false); 408 405 … … 458 455 pmSource *source = sources->data[i]; 459 456 460 // skip PSF-like and non-astronomical objects 461 if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) continue; 462 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 463 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 464 465 // skip saturated stars modeled with a radial profile 466 if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue; 467 468 // XXX this should use peak? 457 // rules for measuring petrosian parameters for specific objects are set in 458 // psphotChooseAnalysisOptions.c 459 if (!(source->tmpFlags & PM_SOURCE_TMPF_EXT_FIT)) continue; 460 461 // limit selection by analysis region (XXX move this into psphotChooseAnalysisOption?) 469 462 if (source->peak->x < region->x0) continue; 470 463 if (source->peak->y < region->y0) continue; 471 464 if (source->peak->x > region->x1) continue; 472 465 if (source->peak->y > region->y1) continue; 473 474 475 // XXX for a test, just do the obvious trail476 // XXX if (source->peak->xf < 1100) continue;477 // XXX if (source->peak->xf > 1400) continue;478 // XXX if (source->peak->yf > 245) continue;479 466 480 467 // replace object in image … … 487 474 psphotSetRadiusMomentsExact(&fitRadius, &windowRadius, readout, source, markVal); // NOTE : 6 allocs 488 475 489 // XXX WATCH OUT HERE!!490 // fitRadius = 30;491 492 476 // UPDATE : we have changed the moments calculation. There is now an iteration within 493 477 // psphotKronMasked to determine moments appropriate for a larger object. The values … … 502 486 # ifdef TEST_OBJECT 503 487 bool testObject = false; 504 // testObject |= ((fabs(source->peak->xf - 179) < 5) && (fabs(source->peak->yf - 1138) < 5)); 505 // testObject |= ((fabs(source->peak->xf - 5047) < 5) && (fabs(source->peak->yf - 151) < 5)); 506 // testObject |= ((fabs(source->peak->xf - 3929) < 5) && (fabs(source->peak->yf - 4109) < 5)); 507 // testObject |= ((fabs(source->peak->xf - 915) < 5) && (fabs(source->peak->yf - 5998) < 5)); 508 // testObject |= ((fabs(source->peak->xf - 5406) < 5) && (fabs(source->peak->yf - 326) < 5)); 488 testObject |= ((fabs(source->peak->xf - 179) < 5) && (fabs(source->peak->yf - 1138) < 5)); 509 489 if (testObject) { 510 490 fprintf (stderr, "test object @ %f, %f\n", source->peak->xf, source->peak->yf); … … 528 508 assert (status); 529 509 530 // limit selection to some SN limit 531 bool skipSource = false; 532 if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) { 533 skipSource = (source->moments->KronFlux < FIT_SN_LIM * source->moments->KronFluxErr); 534 } else { 535 skipSource = (sqrt(source->peak->detValue) < FIT_SN_LIM); 536 } 537 if (skipSource) { 510 // limit selection to some SN limit for specific models (this value only applies if > EXTENDED_SOURCE_SN_LIM) 511 if (isfinite(FIT_SN_LIM)) { 512 if (source->moments->KronFlux < FIT_SN_LIM * source->moments->KronFluxErr) { 538 513 Nfaint ++; 539 514 continue; 515 } 540 516 } 541 517 … … 612 588 } 613 589 } 614 // XXX really need to do this in a cleaner way: 615 // XXX I'm not sure I can get to this statement with a null modelFit 616 if (!modelFit) continue; 590 psAssert (modelFit, "modelFit not set?"); 617 591 618 592 // test for fit quality / result
Note:
See TracChangeset
for help on using the changeset viewer.
