IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 30, 2009, 5:20:29 PM (17 years ago)
Author:
watersc1
Message:

Finished up my edits to the detrend cleanup, and some changes to my
copy of burntool and the pslib astrometry. Detrend cleanup has not
been tested yet. That's up next.

Location:
branches/czw_branch/cleanup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/cleanup

  • branches/czw_branch/cleanup/psphot/src/psphotDeblendSatstars.c

    r21519 r24951  
    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.