IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28974


Ignore:
Timestamp:
Aug 19, 2010, 4:12:08 PM (16 years ago)
Author:
eugene
Message:

replace psf version of source moments after fit is determined (or fails)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/psphot/src/psphotSourceFits.c

    r28782 r28974  
    230230    pmModel *EXT = NULL;
    231231    psArray *DBL = NULL;
     232    pmMoments psfMoments;
    232233
    233234    // skip the source if we don't think it is extended
     
    246247    // this uses the footprint to judge both radius and aperture?
    247248    // XXX save the psf-based moments for output
    248     if (!pmSourceMoments (source, radius, 0.0, 0.0, maskVal)) return false;
     249    psfMoments = *source->moments;
     250    if (!pmSourceMoments (source, radius, 0.0, 0.5, maskVal)) {
     251      *source->moments = psfMoments;
     252      return false;
     253    }
    249254
    250255    psTrace ("psphot", 5, "trying blob...\n");
     
    314319
    315320    // both models failed; reject them both
    316     // XXX -- change type flags to psf in this case and keep original moments?
     321    // XXX -- change type flags to psf in this case, and make sure we subtract it?
     322    // reset the psf moments
     323    *source->moments = psfMoments;
     324
    317325    psFree (EXT);
    318326    psFree (DBL);
     
    343351# endif
    344352
     353    // reset the psf moments
     354    *source->moments = psfMoments;
    345355    return true;
    346356
     
    379389# endif
    380390
     391    // reset the (original) psf moments
     392    *source->moments = psfMoments;
     393    *newSrc->moments = psfMoments;
     394
    381395    psArrayAdd (newSources, 100, newSrc);
    382396    psFree (newSrc);
     
    385399
    386400escape:
     401    // reset the psf moments
     402    *source->moments = psfMoments;
    387403    psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    388404    psFree (tmpSrc);
     
    419435    axes = psEllipseMomentsToAxes (moments, 20.0);
    420436
     437    if (isnan(axes.major)) return NULL;
     438    if (isnan(axes.minor)) return NULL;
     439    if (isnan(axes.theta)) return NULL;
     440
    421441    // XXX this is really arbitrary: 4 pixel separation?
    422442    dx = 2 * cos (axes.theta);
Note: See TracChangeset for help on using the changeset viewer.