Changeset 24889
- Timestamp:
- Jul 21, 2009, 3:28:53 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotDeblendSatstars.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotDeblendSatstars.c
r21519 r24889 1 1 # include "psphotInternal.h" 2 2 3 bool psphotDeblendSatstars (p sArray *sources, psMetadata *recipe) {3 bool psphotDeblendSatstars (pmReadout *readout, psArray *sources, psMetadata *recipe) { 4 4 5 5 int N; … … 9 9 10 10 int Nblend = 0; 11 float SAT_TEST_LEVEL = 50000;12 11 float SAT_MIN_RADIUS = 5.0; 12 13 bool status; 14 pmCell *cell = readout->parent; 15 float SATURATION = 0.75*psMetadataLookupF32 (&status, cell->concepts, "CELL.SATURATION"); 16 float SAT_TEST_LEVEL = 0.5*SATURATION; 13 17 14 18 // we need sources spatially-sorted to find overlaps … … 32 36 // XXX filter? if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; 33 37 if (source->mode & PM_SOURCE_MODE_BLEND) continue; 34 if (source->peak->flux < SAT _TEST_LEVEL) continue;38 if (source->peak->flux < SATURATION) continue; 35 39 36 40 // save these for reference below … … 45 49 psVector *xVec = contour->data[0]; 46 50 psVector *yVec = contour->data[1]; 47 48 // XXX should we filter based on the number of pixels in the contour? 51 if (xVec->n < 5) continue; 49 52 50 53 // find the center of the contour (let's just use mid[x,y]) … … 62 65 int yCenter = 0.5*(yMin + yMax); 63 66 psFree (contour); 67 68 psAssert (xCenter >= source->pixels->col0, "invalid shift in object center"); 69 psAssert (xCenter < source->pixels->col0 + source->pixels->numCols, "invalid shift in object center"); 70 psAssert (yCenter >= source->pixels->row0, "invalid shift in object center"); 71 psAssert (yCenter < source->pixels->row0 + source->pixels->numRows, "invalid shift in object center"); 64 72 65 73 // reset the peak for this source to the value of the center pixel
Note:
See TracChangeset
for help on using the changeset viewer.
