IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 12:45:24 PM (17 years ago)
Author:
eugene
Message:

update from mainline

Location:
branches/eam_branches/20090715
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715

  • branches/eam_branches/20090715/psphot/src/psphot.h

    r23688 r25022  
    157157bool            psphotSubWithTest (pmSource *source, bool useState, psImageMaskType maskVal);
    158158bool            psphotSetState (pmSource *source, bool curState, psImageMaskType maskVal);
    159 bool            psphotDeblendSatstars (psArray *sources, psMetadata *recipe);
     159bool            psphotDeblendSatstars (pmReadout *readout, psArray *sources, psMetadata *recipe);
    160160bool            psphotSourceSize (pmConfig *config, pmReadout *readout, psArray *sources, psMetadata *recipe, long first);
    161161
  • branches/eam_branches/20090715/psphot/src/psphotApResid.c

    r23989 r25022  
    168168        if (source->mode &  PM_SOURCE_MODE_POOR) SKIPSTAR ("POOR STAR");
    169169
     170        if (source->mode &  PM_SOURCE_MODE_EXT_LIMIT) SKIPSTAR ("EXTENDED");
     171        if (source->mode &  PM_SOURCE_MODE_CR_LIMIT) SKIPSTAR ("COSMIC RAY");
     172           
    170173        if (!isfinite(source->apMag) || !isfinite(source->psfMag)) {
    171174            continue;
     
    317320*/
    318321
     322// XXX this still sucks...  need a better way to estimate the error floor...
    319323bool psphotMagErrorScale (float *errorScale, float *errorFloor, psVector *dMag, psVector *dap, psVector *mask, int nGroup) {
    320324
     
    385389    for (int i = 0; i < dSo->n; i++) {
    386390        *errorFloor = dSo->data.F32[i];
     391        if (fabs(*errorFloor) <= FLT_EPSILON) continue;
    387392        if (isfinite(*errorFloor)) break;
    388393    }
  • branches/eam_branches/20090715/psphot/src/psphotCullPeaks.c

    r17516 r25022  
    1818        nsigma_min = 0;
    1919    }
     20    float fPadding = psMetadataLookupF32(&status, recipe, "FOOTPRINT_CULL_NSIGMA_PAD");
     21    if (!status) {
     22        fPadding = 0;
     23    }
    2024    const float skyStdev = psMetadataLookupF32(NULL, recipe, "SKY_STDEV");
    21 
    22     return pmFootprintArrayCullPeaks(image, weight, footprints,
    23                                      nsigma_delta, nsigma_min*skyStdev);
    24 }
    25 
    26 
    27 /*
    28  * Cull an entire psArray of pmFootprints
    29  * XXX drop this intermediate level function?
    30  */
    31 psErrorCode
    32 pmFootprintArrayCullPeaks(const psImage *img, // the image wherein lives the footprint
    33                           const psImage *weight,        // corresponding variance image
    34                           psArray *footprints, // array of pmFootprints
    35                           const float nsigma_delta, // how many sigma above local background a peak
    36                                         // needs to be to survive
    37                           const float min_threshold) { // minimum permitted coll height
     25    const float min_threshold = nsigma_min*skyStdev;
     26   
    3827    for (int i = 0; i < footprints->n; i++) {
    3928        pmFootprint *fp = footprints->data[i];
    40         if (pmFootprintCullPeaks(img, weight, fp, nsigma_delta, min_threshold) != PS_ERR_NONE) {
     29        if (pmFootprintCullPeaks(image, weight, fp, nsigma_delta, fPadding, min_threshold) != PS_ERR_NONE) {
    4130            return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    4231        }
     
    4534    return PS_ERR_NONE;
    4635}
    47 
    48  /*
    49   * Examine the peaks in a pmFootprint, and throw away the ones that are not sufficiently
    50   * isolated.  More precisely, for each peak find the highest coll that you'd have to traverse
    51   * to reach a still higher peak --- and if that coll's more than nsigma DN below your
    52   * starting point, discard the peak.
    53   */
    54 psErrorCode pmFootprintCullPeaks_OLD(const psImage *img, // the image wherein lives the footprint
    55                                  const psImage *weight, // corresponding variance image
    56                                  pmFootprint *fp, // Footprint containing mortal peaks
    57                                  const float nsigma_delta, // how many sigma above local background a peak
    58                                         // needs to be to survive
    59                                  const float min_threshold) { // minimum permitted coll height
    60     assert (img != NULL); assert (img->type.type == PS_TYPE_F32);
    61     assert (weight != NULL); assert (weight->type.type == PS_TYPE_F32);
    62     assert (img->row0 == weight->row0 && img->col0 == weight->col0);
    63     assert (fp != NULL);
    64 
    65     if (fp->peaks == NULL || fp->peaks->n == 0) { // nothing to do
    66         return PS_ERR_NONE;
    67     }
    68 
    69     psRegion subRegion;                 // desired subregion; 1 larger than bounding box (grr)
    70     subRegion.x0 = fp->bbox.x0; subRegion.x1 = fp->bbox.x1 + 1;
    71     subRegion.y0 = fp->bbox.y0; subRegion.y1 = fp->bbox.y1 + 1;
    72     const psImage *subImg = psImageSubset((psImage *)img, subRegion);
    73     const psImage *subWt = psImageSubset((psImage *)weight, subRegion);
    74     assert (subImg != NULL && subWt != NULL);
    75     //
    76     // We need a psArray of peaks brighter than the current peak.  We'll fake this
    77     // by reusing the fp->peaks but lying about n.
    78     //
    79     // We do this for efficiency (otherwise I'd need two peaks lists), and we are
    80     // rather too chummy with psArray in consequence.  But it works.
    81     //
    82     psArray *brightPeaks = psArrayAlloc(0);
    83     psFree(brightPeaks->data);
    84     brightPeaks->data = psMemIncrRefCounter(fp->peaks->data);// use the data from fp->peaks
    85     //
    86     // The brightest peak is always safe; go through other peaks trying to cull them
    87     //
    88     for (int i = 1; i < fp->peaks->n; i++) { // n.b. fp->peaks->n can change within the loop
    89         const pmPeak *peak = fp->peaks->data[i];
    90         int x = peak->x - subImg->col0;
    91         int y = peak->y - subImg->row0;
    92         //
    93         // Find the level nsigma below the peak that must separate the peak
    94         // from any of its friends
    95         //
    96         assert (x >= 0 && x < subImg->numCols && y >= 0 && y < subImg->numRows);
    97         const float stdev = sqrt(subWt->data.F32[y][x]);
    98         float threshold = subImg->data.F32[y][x] - nsigma_delta*stdev;
    99         if (isnan(threshold) || threshold < min_threshold) {
    100 #if 1     // min_threshold is assumed to be below the detection threshold,
    101           // so all the peaks are pmFootprint, and this isn't the brightest
    102             // XXX mark peak to be dropped
    103             (void)psArrayRemoveIndex(fp->peaks, i);
    104             i--;                        // we moved everything down one
    105             continue;
    106 #else
    107 #error n.b. We will be running LOTS of checks at this threshold, so only find the footprint once
    108             threshold = min_threshold;
    109 #endif
    110         }
    111 
    112         // XXX EAM : if stdev >= 0, i'm not sure how this can ever be true?
    113         if (threshold > subImg->data.F32[y][x]) {
    114             threshold = subImg->data.F32[y][x] - 10*FLT_EPSILON;
    115         }
    116 
    117         // XXX this is a bit expensive: psImageAlloc for every peak contained in this footprint
    118         // perhaps this should alloc a single ID image above and pass it in to be set.
    119 
    120         const int peak_id = 1;          // the ID for the peak of interest
    121         brightPeaks->n = i;             // only stop at a peak brighter than we are
    122 
    123         // XXX optionally use the faster pmFootprintsFind if the subimage size is large (eg, M31)
    124 
    125         pmFootprint *peakFootprint = pmFootprintsFindAtPoint(subImg, threshold, brightPeaks, peak->y, peak->x);
    126         brightPeaks->n = 0;             // don't double free
    127         psImage *idImg = pmSetFootprintID(NULL, peakFootprint, peak_id);
    128         psFree(peakFootprint);
    129 
    130         // Check if any of the previous (brighter) peaks are within the footprint of this peak
    131         // If so, the current peak is bogus; drop it.
    132         int j;
    133         for (j = 0; j < i; j++) {
    134             const pmPeak *peak2 = fp->peaks->data[j];
    135             int x2 = peak2->x - subImg->col0;
    136             int y2 = peak2->y - subImg->row0;
    137             const int peak2_id = idImg->data.S32[y2][x2]; // the ID for some other peak
    138 
    139             if (peak2_id == peak_id) {  // There's a brighter peak within the footprint above
    140                 ;                       // threshold; so cull our initial peak
    141                 (void)psArrayRemoveIndex(fp->peaks, i);
    142                 i--;                    // we moved everything down one
    143                 break;
    144             }
    145         }
    146         if (j == i) {
    147             j++;
    148         }
    149 
    150         psFree(idImg);
    151     }
    152 
    153     brightPeaks->n = 0; psFree(brightPeaks);
    154     psFree((psImage *)subImg);
    155     psFree((psImage *)subWt);
    156 
    157     return PS_ERR_NONE;
    158 }
    159 
    160  /*
    161   * Examine the peaks in a pmFootprint, and throw away the ones that are not sufficiently
    162   * isolated.  More precisely, for each peak find the highest coll that you'd have to traverse
    163   * to reach a still higher peak --- and if that coll's more than nsigma DN below your
    164   * starting point, discard the peak.
    165   */
    166 
    167 # define IN_PEAK 1
    168 psErrorCode pmFootprintCullPeaks(const psImage *img, // the image wherein lives the footprint
    169                                  const psImage *weight, // corresponding variance image
    170                                  pmFootprint *fp, // Footprint containing mortal peaks
    171                                  const float nsigma_delta, // how many sigma above local background a peak
    172                                  // needs to be to survive
    173                                  const float min_threshold) { // minimum permitted coll height
    174     assert (img != NULL); assert (img->type.type == PS_TYPE_F32);
    175     assert (weight != NULL); assert (weight->type.type == PS_TYPE_F32);
    176     assert (img->row0 == weight->row0 && img->col0 == weight->col0);
    177     assert (fp != NULL);
    178 
    179     if (fp->peaks == NULL || fp->peaks->n == 0) { // nothing to do
    180         return PS_ERR_NONE;
    181     }
    182 
    183     psRegion subRegion;                 // desired subregion; 1 larger than bounding box (grr)
    184     subRegion.x0 = fp->bbox.x0; subRegion.x1 = fp->bbox.x1 + 1;
    185     subRegion.y0 = fp->bbox.y0; subRegion.y1 = fp->bbox.y1 + 1;
    186 
    187     psImage *subImg = psImageSubset((psImage *)img, subRegion);
    188     psImage *subWt = psImageSubset((psImage *)weight, subRegion);
    189     assert (subImg != NULL && subWt != NULL);
    190 
    191     psImage *idImg = psImageAlloc(subImg->numCols, subImg->numRows, PS_TYPE_S32);
    192 
    193     // We need a psArray of peaks brighter than the current peak. 
    194     // We reject peaks which either:
    195     // 1) are below the local threshold
    196     // 2) have a brighter peak within their threshold
    197 
    198     // allocate the full-sized array.  if the final array is much smaller, we can realloc
    199     // at that point.
    200     psArray *brightPeaks = psArrayAllocEmpty(fp->peaks->n);
    201     psArrayAdd (brightPeaks, 128, fp->peaks->data[0]);
    202 
    203     // The brightest peak is always safe; go through other peaks trying to cull them
    204     for (int i = 1; i < fp->peaks->n; i++) { // n.b. fp->peaks->n can change within the loop
    205         const pmPeak *peak = fp->peaks->data[i];
    206         int x = peak->x - subImg->col0;
    207         int y = peak->y - subImg->row0;
    208         //
    209         // Find the level nsigma below the peak that must separate the peak
    210         // from any of its friends
    211         //
    212         assert (x >= 0 && x < subImg->numCols && y >= 0 && y < subImg->numRows);
    213         const float stdev = sqrt(subWt->data.F32[y][x]);
    214         float threshold = subImg->data.F32[y][x] - nsigma_delta*stdev;
    215         if (isnan(threshold) || threshold < min_threshold) {
    216             // min_threshold is assumed to be below the detection threshold,
    217             // so all the peaks are pmFootprint, and this isn't the brightest
    218             continue;
    219         }
    220 
    221         // XXX EAM : if stdev >= 0, i'm not sure how this can ever be true?
    222         if (threshold > subImg->data.F32[y][x]) {
    223             threshold = subImg->data.F32[y][x] - 10*FLT_EPSILON;
    224         }
    225 
    226         // XXX this is a bit expensive: psImageAlloc for every peak contained in this footprint
    227         // perhaps this should alloc a single ID image above and pass it in to be set.
    228 
    229         // XXX optionally use the faster pmFootprintsFind if the subimage size is large (eg, M31)
    230 
    231         // at this point brightPeaks only has the peaks brighter than the current
    232         pmFootprint *peakFootprint = pmFootprintsFindAtPoint(subImg, threshold, brightPeaks, peak->y, peak->x);
    233 
    234         // XXX need to supply the image here
    235         // we set the IDs to either 1 (in peak) or 0 (not in peak)
    236         pmSetFootprintID (idImg, peakFootprint, IN_PEAK);
    237         psFree(peakFootprint);
    238 
    239         // Check if any of the previous (brighter) peaks are within the footprint of this peak
    240         // If so, the current peak is bogus; drop it.
    241         bool keep = true;
    242         for (int j = 0; keep && (j < brightPeaks->n); j++) {
    243             const pmPeak *peak2 = fp->peaks->data[j];
    244             int x2 = peak2->x - subImg->col0;
    245             int y2 = peak2->y - subImg->row0;
    246             if (idImg->data.S32[y2][x2] == IN_PEAK)
    247                 // There's a brighter peak within the footprint above threshold; so cull our initial peak
    248                 keep = false;
    249         }
    250         if (!keep) continue;
    251 
    252         psArrayAdd (brightPeaks, 128, fp->peaks->data[i]);
    253     }
    254 
    255     psFree (fp->peaks);
    256     fp->peaks = brightPeaks;
    257 
    258     psFree(idImg);
    259     psFree(subImg);
    260     psFree(subWt);
    261 
    262     return PS_ERR_NONE;
    263 }
    264 
  • branches/eam_branches/20090715/psphot/src/psphotDeblendSatstars.c

    r21519 r25022  
    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
  • branches/eam_branches/20090715/psphot/src/psphotGuessModels.c

    r21519 r25022  
    66// 2) loop over the sources once and associate them with their cell
    77// 3) define the threaded function to work with sources for a given cell
    8 
    9 // A guess for when the moments aren't available
    10 static pmModel *wildGuess(pmSource *source, // Source for which to guess
    11                           pmPSF *psf    // The point-spread function
    12     )
    13 {
    14     pmModel *model = pmModelAlloc(psf->type);
    15     psF32 *PAR = model->params->data.F32;
    16     PAR[PM_PAR_SKY]  = 0;
    17     // XXX get this from the image pixels
    18     PAR[PM_PAR_I0]   = source->peak->flux;
    19     PAR[PM_PAR_XPOS] = source->peak->xf;
    20     PAR[PM_PAR_YPOS] = source->peak->yf;
    21     return model;
    22 }
    238
    249// construct an initial PSF model for each object
     
    8166            }
    8267            psFree(job);
    83 
    84 # if (0)               
    85                 if (!psphotGuessModel_Unthreaded (readout, cells->data[j], psf, maskVal, markVal)) {
    86                     psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    87                     return false;
    88                 }
    89 # endif
    9068        }
    9169
     
    152130        nSrc ++;
    153131       
    154         // XXX if a source is faint, it will not have moments measured.
    155         // it must be modelled as a PSF.  In this case, we need to use
    156         // the peak centroid to get the coordinates and get the peak flux
    157         // from the image?
    158         pmModel *modelEXT;
    159         if (!source->moments) {
    160             modelEXT = wildGuess(source, psf);
     132        // the guess central intensity comes from the peak:
     133        float Io = source->peak->flux;
     134
     135        // We have two options to get a guess for the object position: the position from the
     136        // peak and the position from the moments.  Use the peak position if (a) there are no
     137        // moments and (b) the sources is not saturated
     138
     139        bool useMoments = false;
     140        useMoments = (source->mode & PM_SOURCE_MODE_SATSTAR);  // we only want to try if SATSTAR is set, but..
     141        useMoments = (useMoments && source->moments);          // can't if there are no moments
     142        useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured
     143        useMoments = (useMoments && !(source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed...
     144
     145        float Xo, Yo;
     146        if (useMoments) {
     147            Xo = source->moments->Mx;
     148            Yo = source->moments->My;
    161149        } else {
    162             // use the source moments, etc to guess basic model parameters
    163             modelEXT = pmSourceModelGuess (source, psf->type); // ALLOC X5
    164             if (!modelEXT) {
    165                 modelEXT = wildGuess(source, psf);
    166             }
    167             // these valuse are set in pmSourceModelGuess, should this rule be in there as well?
    168             if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    169                 modelEXT->params->data.F32[PM_PAR_XPOS] = source->moments->Mx;
    170                 modelEXT->params->data.F32[PM_PAR_YPOS] = source->moments->My;
    171             } else {
    172                 modelEXT->params->data.F32[PM_PAR_XPOS] = source->peak->xf;
    173                 modelEXT->params->data.F32[PM_PAR_YPOS] = source->peak->yf;
    174             }
     150            Xo = source->peak->xf;
     151            Yo = source->peak->yf;
    175152        }
    176153
    177         // set PSF parameters for this model (apply 2D shape model)
    178         pmModel *modelPSF = pmModelFromPSF (modelEXT, psf); // ALLOC X5
     154        // set PSF parameters for this model (apply 2D shape model to coordinates Xo, Yo)
     155        pmModel *modelPSF = pmModelFromPSFforXY(psf, Xo, Yo, Io);
     156
    179157        if (modelPSF == NULL) {
    180             psWarning ("Failed to determine PSF model at r,c = (%d,%d); trying centre of image",
    181                     source->peak->y, source->peak->x);
     158            psWarning ("Failed to determine PSF model at (%f,%f); trying image center", Xo, Yo);
    182159
    183             // Try the center of the image
    184             modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*readout->image->numCols;
    185             modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*readout->image->numRows;
    186             modelPSF = pmModelFromPSF (modelEXT, psf);
     160            float Xc = 0.5*readout->image->numCols;
     161            float Yc = 0.5*readout->image->numRows;
     162            pmModel *modelPSF = pmModelFromPSFforXY(psf, Xc, Yc, Io);
    187163            if (modelPSF == NULL) {
    188164                psError(PSPHOT_ERR_PSF, false, "Failed to determine PSF model at center of image");
    189                 psFree(modelEXT);
    190165                return false;
    191166            }
     167
     168            // Now set the object position at the expected location:
     169            modelPSF->params->data.F32[PM_PAR_XPOS] = Xo;
     170            modelPSF->params->data.F32[PM_PAR_YPOS] = Yo;
    192171            source->mode |= PM_SOURCE_MODE_BADPSF;
    193172        }
    194         psFree (modelEXT); // FREE (x3)
    195173
    196         // XXX need to define the guess flux?
    197174        // set the fit radius based on the object flux limit and the model
    198175        // this function affects the mask pixels
     
    209186    return true;
    210187}
    211 
    212 # if (0)
    213 // construct models only for sources in the specified region
    214 bool psphotGuessModel_Unthreaded (pmReadout *readout, psArray *sources, pmPSF *psf, psImageMaskType maskVal, psImageMaskType markVal) {
    215 
    216     int nSrc = 0;
    217 
    218     for (int i = 0; i < sources->n; i++) {
    219         pmSource *source = sources->data[i];
    220 
    221         // XXXX this is just for a test: use this to mark sources for which the model is measured
    222         // check later that all are used.
    223         source->mode |= PM_SOURCE_MODE_EXT_LIMIT;
    224 
    225         // skip non-astronomical objects (very likely defects)
    226         if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
    227         if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
    228         if (!source->peak) continue;
    229 
    230         nSrc ++;
    231        
    232         // XXX if a source is faint, it will not have moments measured.
    233         // it must be modelled as a PSF.  In this case, we need to use
    234         // the peak centroid to get the coordinates and get the peak flux
    235         // from the image?
    236         pmModel *modelEXT;
    237         if (!source->moments) {
    238             modelEXT = wildGuess(source, psf);
    239         } else {
    240             // use the source moments, etc to guess basic model parameters
    241             modelEXT = pmSourceModelGuess (source, psf->type); // ALLOC
    242             if (!modelEXT) {
    243                 modelEXT = wildGuess(source, psf);
    244             }
    245             // these valuse are set in pmSourceModelGuess, should this rule be in there as well?
    246             if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    247                 modelEXT->params->data.F32[PM_PAR_XPOS] = source->moments->Mx;
    248                 modelEXT->params->data.F32[PM_PAR_YPOS] = source->moments->My;
    249             } else {
    250                 modelEXT->params->data.F32[PM_PAR_XPOS] = source->peak->xf;
    251                 modelEXT->params->data.F32[PM_PAR_YPOS] = source->peak->yf;
    252             }
    253         }
    254 
    255         // set PSF parameters for this model (apply 2D shape model)
    256         pmModel *modelPSF = pmModelFromPSF (modelEXT, psf); // ALLOC
    257         if (modelPSF == NULL) {
    258             psError(PSPHOT_ERR_PSF, false,
    259                     "Failed to determine PSF model at r,c = (%d,%d); trying centre of image",
    260                     source->peak->y, source->peak->x);
    261             //
    262             // Try the centre of the image
    263             //
    264             modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*readout->image->numCols;
    265             modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*readout->image->numRows;
    266             modelPSF = pmModelFromPSF (modelEXT, psf);
    267             if (modelPSF == NULL) {
    268                 psError(PSPHOT_ERR_PSF, false,
    269                         "Failed to determine PSF model at centre of image");
    270                 psFree(modelEXT);
    271                 return false;
    272             }
    273 
    274             source->mode |= PM_SOURCE_MODE_BADPSF;
    275         }
    276         psFree (modelEXT);
    277 
    278         // XXX need to define the guess flux?
    279         // set the fit radius based on the object flux limit and the model
    280         // this function affects the mask pixels
    281         psphotCheckRadiusPSF (readout, source, modelPSF, markVal);
    282 
    283         // set the source PSF model
    284         source->modelPSF = modelPSF;
    285         source->modelPSF->residuals = psf->residuals;
    286 
    287         pmSourceCacheModel (source, maskVal);
    288 
    289     }
    290 
    291     return true;
    292 }
    293 # endif
  • branches/eam_branches/20090715/psphot/src/psphotReadout.c

    r24097 r25022  
    8787    // find blended neighbors of very saturated stars
    8888    // XXX merge this with Basic Deblend?
    89     psphotDeblendSatstars (sources, recipe);
     89    psphotDeblendSatstars (readout, sources, recipe);
    9090
    9191    // mark blended peaks PS_SOURCE_BLEND
     
    236236    return psphotReadoutCleanup(config, readout, recipe, detections, psf, sources);
    237237}
     238
  • branches/eam_branches/20090715/psphot/src/psphotReadoutMinimal.c

    r24274 r25022  
    5959    // find blended neighbors of very saturated stars
    6060    // XXX merge this with Basic Deblend?
    61     psphotDeblendSatstars (sources, recipe);
     61    psphotDeblendSatstars (readout, sources, recipe);
    6262
    6363    // mark blended peaks PS_SOURCE_BLEND
Note: See TracChangeset for help on using the changeset viewer.