Changeset 34354
- Timestamp:
- Aug 24, 2012, 4:37:05 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
ippconfig/recipes/psphot.config (modified) (1 diff)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotSourceMatch.c (modified) (1 diff)
-
psphot/src/psphotStackReadout.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/recipes/psphot.config
r34343 r34354 389 389 END 390 390 391 # if true keep all matched sources, even if we get a non-finite aperture flux measurement 392 PSPHOT.STACK.KEEP.BAD.MATCHES BOOL F 393 391 394 RADIAL_APERTURES BOOL F # calculate flux in circular radial apertures? 392 395 RADIAL_APERTURES_SN_LIM F32 0.0 # S/N limit for radial aperture calculation -
trunk/psphot/src/psphot.h
r34317 r34354 368 368 bool psphotMatchSourcesReadout (psArray *objects, pmConfig *config, const pmFPAview *view, const char *filerule, int index); 369 369 bool psphotMatchSourcesToObjects (psArray *objects, psArray *sources, float RADIUS); 370 bool psphotDropBadMatchedSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects); 370 371 371 372 bool psphotFitSourcesLinearStack (pmConfig *config, psArray *objects, bool final); -
trunk/psphot/src/psphotSourceMatch.c
r34338 r34354 558 558 return matchInfo; 559 559 } 560 561 bool psphotDropBadMatchedSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) { 562 563 bool status = false; 564 565 psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Drop Bad Matched Sources ---"); 566 567 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 568 569 // select the appropriate recipe information 570 bool keepBadMatches = psMetadataLookupBool (&status, recipe, "PSPHOT.STACK.KEEP.BAD.MATCHES"); 571 if (!status) { 572 keepBadMatches = true; 573 } 574 575 if (keepBadMatches) { 576 psLogMsg ("psphot", PS_LOG_INFO, "keeping bad matches"); 577 return true; 578 } 579 580 int numImages = psphotFileruleCount(config, filerule); 581 psVector *dropped = psVectorAlloc(numImages, PS_TYPE_U32); 582 psVectorInit(dropped, 0); 583 584 int nDropped = 0; 585 for (int i = 0; i < objects->n; i++) { 586 pmPhotObj *obj = objects->data[i]; 587 588 // traverse the array from the end so that sources don't move until after we've processed them 589 for (int j = obj->sources->n - 1; j >= 0; j--) { 590 591 pmSource *source = obj->sources->data[j]; 592 // This applies only to matched sources 593 if (!(source->mode2 & PM_SOURCE_MODE2_MATCHED)) continue; 594 595 if (isfinite(source->apFlux)) continue; 596 597 psTrace ("psphot", 7, "Dropping matched source from image %d at (%d, %d) no valid flux", 598 source->imageID, source->peak->x, source->peak->y); 599 600 psAssert(source->imageID >= 0 && source->imageID < numImages, "bad imageID %d", source->imageID); 601 602 dropped->data.U32[source->imageID]++; 603 604 nDropped++; 605 606 psArrayRemoveIndex(obj->sources, j); 607 } 608 } 609 610 psLogMsg ("psphot", PS_LOG_DETAIL, "Dropped %d matched sources with no valid flux", nDropped); 611 psLogMsg ("psphot", PS_LOG_DETAIL, " Input Num Dropped"); 612 for (int i=0; i<numImages; i++) { 613 psLogMsg ("psphot", PS_LOG_DETAIL, " %8d %8d", i, dropped->data.U32[i]); 614 } 615 psFree(dropped); 616 617 return true; 618 } 619 620 -
trunk/psphot/src/psphotStackReadout.c
r34336 r34354 355 355 356 356 psMemDump("psfstats"); 357 358 // drop matched sources without any useful measurements 359 psphotDropBadMatchedSources (config, view, STACK_SRC, objects); 357 360 358 361 // measure elliptical apertures, petrosians (objects sorted by S/N)
Note:
See TracChangeset
for help on using the changeset viewer.
