Changeset 31153 for trunk/psModules/src/objects/pmFootprintAssignPeaks.c
- Timestamp:
- Apr 4, 2011, 1:04:41 PM (15 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmFootprintAssignPeaks.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:ignore
-
old new 28 28 ChangeLog 29 29 psmodules-*.tar.* 30 a.out.dSYM
-
- Property svn:ignore
-
trunk/psModules/src/objects/pmFootprintAssignPeaks.c
r30621 r31153 46 46 */ 47 47 psImage *ids = pmSetFootprintArrayIDs(footprints, true); 48 assert (ids != NULL);49 assert (ids->type.type == PS_TYPE_S32);50 const int row0 = ids ->row0;51 const int col0 = ids ->col0;52 const int numRows = ids ->numRows;53 const int numCols = ids ->numCols;48 if (ids) { assert (ids->type.type == PS_TYPE_S32); } 49 50 const int row0 = ids ? ids->row0 : 0; 51 const int col0 = ids ? ids->col0 : 0; 52 const int numRows = ids ? ids->numRows : -1; 53 const int numCols = ids ? ids->numCols : -1; 54 54 55 55 for (int i = 0; i < peaks->n; i++) { … … 58 58 const int y = peak->y - row0; 59 59 60 assert (x >= 0 && x < numCols && y >= 0 && y < numRows); 61 int id = ids->data.S32[y][x - col0]; 60 if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);} 61 int id = ids ? ids->data.S32[y][x - col0] : 0; 62 // XXX I think the '[x - col0]' above is just wrong (should be [x], but never gets triggerd. 62 63 63 64 if (id == 0) { // peak isn't in a footprint, so make one for it … … 86 87 if (fp->peaks->n == 1) continue; 87 88 88 fp->peaks = psArraySort(fp->peaks, pmPeakSortBySN); 89 // make sure the peaks are sorted in a way consistent with our cull process 90 if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) { 91 fp->peaks = psArraySort(fp->peaks, pmPeaksSortBySmoothFluxDescend); 92 } else { 93 fp->peaks = psArraySort(fp->peaks, pmPeaksSortByRawFluxDescend); 94 } 89 95 90 96 // XXX check for an assert on duplicates (I don't think they can happen, but
Note:
See TracChangeset
for help on using the changeset viewer.
