Changeset 27950 for branches/eam_branches/psphot.20100506/src/psphotExtendedSourceAnalysisByObject.c
- Timestamp:
- May 13, 2010, 11:01:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.20100506/src/psphotExtendedSourceAnalysisByObject.c
r27939 r27950 1 1 # include "psphotInternal.h" 2 2 3 // ?? these cannot happen here --> we would need to do this in psphotExtendedSourceAnalysis4 // XXX option to choose a consistent position5 3 // XXX option to choose a consistent elliptical contour 6 4 // XXX SDSS uses the r-band petrosian radius to measure petrosian fluxes in all bands 7 // XXX consistent choice of extendedness...8 5 9 6 // aperture-like measurements for extended sources … … 64 61 65 62 // source analysis is done in S/N order (brightest first) 66 // XXX add this in (need to put S/N in pmPhotObj) :objects = psArraySort (objects, pmPhotObjSortBySN);63 objects = psArraySort (objects, pmPhotObjSortBySN); 67 64 68 65 // process the objects in order. … … 72 69 if (!object->sources) continue; 73 70 71 // we need to decide for an object if we are going to measure all sources or not 72 // simple rule : if *any* of the sources would be measured, measure the object 73 74 74 // choose the sources of interest 75 for (int j = 0; j < object->sources->n; j++) { 75 bool measureSource = false; 76 for (int j = 0; !measureSource && (j < object->sources->n); j++) { 76 77 77 78 pmSource *source = object->sources->data[j]; … … 88 89 assert (source->peak); // how can a source not have a peak? 89 90 if (source->peak->SN < SN_LIM) continue; 91 measureSource = true; 92 } 93 if (!measureSource) continue; 94 95 // choose the sources of interest 96 for (int j = 0; j < object->sources->n; j++) { 97 98 pmSource *source = object->sources->data[j]; 99 psAssert (source, "programming error"); // all entries in object->sources must exist, right? 100 psAssert (source->peak, "programming error"); // how can a source not have a peak? 90 101 91 102 // replace object in image … … 146 157 return true; 147 158 } 148 149 // sort by X (ascending)150 # if (0)151 int pmPhotObjSortBySN (const void **a, const void **b)152 {153 pmPhotObj *objA = *(pmPhotObj **)a;154 pmPhotObj *objB = *(pmPhotObj **)b;155 156 psF32 fA = objA->x;157 psF32 fB = objB->x;158 159 psF32 diff = fA - fB;160 if (diff > FLT_EPSILON) return (+1);161 if (diff < FLT_EPSILON) return (-1);162 return (0);163 }164 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
