Changeset 5828 for trunk/psphot/src/psphotBasicDeblend.c
- Timestamp:
- Dec 22, 2005, 4:20:27 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotBasicDeblend.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotBasicDeblend.c
r5772 r5828 8 8 pmSource *source, *testSource; 9 9 10 FILE *f = fopen ("deblend.dat", "w");11 if (f == NULL) psAbort ("psphot", "can't open deblend.dat output file");12 10 int Nblend = 0; 13 11 … … 82 80 // XXX EAM : should the contour input coordinate be in parent or subimage coords? parent, for now 83 81 psArray *contour = pmSourceContour_EAM (source->pixels, source->peak->x, source->peak->y, threshold); 84 if (contour == NULL) { 85 fprintf (stderr, "below threshold? invalid peak?\n"); 86 continue; 87 } 82 if (contour == NULL) continue; 88 83 89 84 // the source contour consists of two vectors, xv and yv. the contour is … … 102 97 if (xv->data.F32[j+1] < testSource->peak->x) break; 103 98 99 # if (0) 104 100 int xp0 = source->moments->x - source->pixels->col0; 105 101 int xp1 = source->peak->x - source->pixels->col0; … … 111 107 int yp2 = testSource->moments->y - testSource->pixels->row0; 112 108 int yp3 = testSource->peak->y - testSource->pixels->row0; 109 110 fprintf (f, "%d %d (%f, %f) : %d %d (%f, %f) vs %f\n", 111 source->peak->x, source->peak->y, 112 source->pixels->data.F32[yp0][xp0], source->pixels->data.F32[yp1][xp1], 113 testSource->peak->x, testSource->peak->y, 114 testSource->pixels->data.F32[yp2][xp2], testSource->pixels->data.F32[yp3][xp3], threshold 115 ); 116 # endif 117 118 testSource->mode |= PM_SOURCE_BLEND; 113 119 114 fprintf (f, "%d %d (%f, %f) : %d %d (%f, %f) vs %f\n",115 source->peak->x, source->peak->y,116 source->pixels->data.F32[yp0][xp0], source->pixels->data.F32[yp1][xp1],117 testSource->peak->x, testSource->peak->y,118 testSource->pixels->data.F32[yp2][xp2], testSource->pixels->data.F32[yp3][xp3], threshold119 );120 // add this to the list of source->blends 121 if (source->blends == NULL) { 122 source->blends = psArrayAlloc (16); 123 source->blends->n = 0; 124 } 125 psArrayAdd (source->blends, 16, testSource); 120 126 121 testSource->mode |= PM_SOURCE_BLEND;122 127 Nblend ++; 123 128 j = xv->n; … … 126 131 } 127 132 } 128 fclose (f); 129 psLogMsg ("psphot.deblend", 3, "identified %d blended objects (%f)\n", Nblend, psTimerMark ("psphot")); 133 psLogMsg ("psphot.deblend", 3, "identified %d blended objects (%f sec)\n", Nblend, psTimerMark ("psphot")); 130 134 return true; 131 135 } 132 133 134
Note:
See TracChangeset
for help on using the changeset viewer.
