IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24889


Ignore:
Timestamp:
Jul 21, 2009, 3:28:53 PM (17 years ago)
Author:
eugene
Message:

use the per-cell saturation value, search 75% from saturation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotDeblendSatstars.c

    r21519 r24889  
    11# include "psphotInternal.h"
    22
    3 bool psphotDeblendSatstars (psArray *sources, psMetadata *recipe) {
     3bool psphotDeblendSatstars (pmReadout *readout, psArray *sources, psMetadata *recipe) {
    44
    55    int N;
     
    99
    1010    int Nblend = 0;
    11     float SAT_TEST_LEVEL = 50000;
    1211    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;
    1317
    1418    // we need sources spatially-sorted to find overlaps
     
    3236        // XXX filter? if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;
    3337        if (source->mode & PM_SOURCE_MODE_BLEND) continue;
    34         if (source->peak->flux < SAT_TEST_LEVEL) continue;
     38        if (source->peak->flux < SATURATION) continue;
    3539
    3640        // save these for reference below
     
    4549        psVector *xVec = contour->data[0];
    4650        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;
    4952
    5053        // find the center of the contour (let's just use mid[x,y])
     
    6265        int yCenter = 0.5*(yMin + yMax);
    6366        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");
    6472
    6573        // reset the peak for this source to the value of the center pixel
Note: See TracChangeset for help on using the changeset viewer.