Changeset 21486
- Timestamp:
- Feb 15, 2009, 9:53:13 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20090208/psModules/src/objects/pmSource.c
r21408 r21486 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02- 06 02:31:25$8 * @version $Revision: 1.69.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-15 19:53:13 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 113 113 source->type = PM_SOURCE_TYPE_UNKNOWN; 114 114 source->mode = PM_SOURCE_MODE_DEFAULT; 115 source->tmpFlags = 0; 115 116 source->extpars = NULL; 116 117 source->region = psRegionSet(NAN, NAN, NAN, NAN); … … 534 535 float INNER_RADIUS = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS"); 535 536 537 pmSourceMode noMoments = PM_SOURCE_MODE_MOMENTS_FAILURE | PM_SOURCE_MODE_SKYVAR_FAILURE | PM_SOURCE_MODE_SKY_FAILURE | PM_SOURCE_MODE_BELOW_MOMENTS_SN; 538 536 539 // XXX allow clump size to be scaled relative to sigmas? 537 540 // make rough IDs based on clumpX,Y,DX,DY … … 540 543 pmSource *source = (pmSource *) sources->data[i]; 541 544 542 if (source->peak->x < region->x0) continue; 543 if (source->peak->x > region->x1) continue; 544 if (source->peak->y < region->y0) continue; 545 if (source->peak->y > region->y1) continue; 546 547 source->peak->type = 0; 545 // psf clumps are found for image subregions: 546 // skip sources not in this region 547 if (source->peak->x < region->x0) continue; 548 if (source->peak->x >= region->x1) continue; 549 if (source->peak->y < region->y0) continue; 550 if (source->peak->y >= region->y1) continue; 551 552 // should be set by pmSourceAlloc 553 psAssert (source->type == PM_SOURCE_TYPE_UNKNOWN, "source type was not init-ed?"); 548 554 549 555 // we are basically classifying by moments; use the default if not found 550 556 if (!source->moments) { 551 557 source->type = PM_SOURCE_TYPE_STAR; 558 psAssert (source->mode & noMoments, "why is this source missing moments?"); 552 559 Nstar++; 553 560 continue; … … 1049 1056 } 1050 1057 1058 // sort by Seq (ascending) 1059 int pmSourceSortBySeq (const void **a, const void **b) 1060 { 1061 pmSource *A = *(pmSource **)a; 1062 pmSource *B = *(pmSource **)b; 1063 1064 int iA = A->seq; 1065 int iB = B->seq; 1066 1067 int diff = iA - iB; 1068 if (diff > 0) return (+1); 1069 if (diff < 0) return (-1); 1070 return (0); 1071 } 1072 1051 1073 pmSourceMode pmSourceModeFromString (const char *name) { 1052 1074 if (!strcasecmp (name, "DEFAULT" )) return PM_SOURCE_MODE_DEFAULT; … … 1066 1088 if (!strcasecmp (name, "CRLIMIT" )) return PM_SOURCE_MODE_CR_LIMIT; 1067 1089 if (!strcasecmp (name, "EXTLIMIT" )) return PM_SOURCE_MODE_EXT_LIMIT; 1068 if (!strcasecmp (name, "SUBTRACTED")) return PM_SOURCE_MODE_SUBTRACTED;1069 1090 return PM_SOURCE_MODE_DEFAULT; 1070 1091 } … … 1088 1109 case PM_SOURCE_MODE_CR_LIMIT : return psStringCopy ("CRLIMIT" ); 1089 1110 case PM_SOURCE_MODE_EXT_LIMIT : return psStringCopy ("EXTLIMIT" ); 1090 case PM_SOURCE_MODE_SUBTRACTED : return psStringCopy ("SUBTRACTED");1091 1111 default: 1092 1112 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.
