IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31364


Ignore:
Timestamp:
Apr 25, 2011, 8:51:17 AM (15 years ago)
Author:
eugene
Message:

use the best position for the photometry analysis (mostly affects the aperture location)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psphot/src/psphotMagnitudes.c

    r31328 r31364  
    190190        }
    191191
     192        float xPos = source->peak->xf;
     193        float yPos = source->peak->yf;
     194
     195        pmModel *model = source->modelPSF;
     196        if (model) {
     197            xPos = model->params->data.F32[PM_PAR_XPOS];
     198            yPos = model->params->data.F32[PM_PAR_YPOS];
     199        } else {
     200            bool useMoments = pmSourcePositionUseMoments(source);
     201            if (useMoments) {
     202                xPos = source->moments->Mx;
     203                yPos = source->moments->My;
     204            }
     205        }
     206
    192207        // clear the mask bit and set the circular mask pixels
    193208        psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    194         psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, source->apRadius, "OR", markVal);
     209        psImageKeepCircle (source->maskObj, xPos, yPos, source->apRadius, "OR", markVal);
    195210
    196211        status = pmSourceMagnitudes (source, psf, photMode, maskVal, markVal, source->apRadius);
     
    213228        if (backModel) {
    214229            psAssert (binning, "if backModel is defined, so should binning be");
    215             source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, backModel->image, binning);
     230            source->sky = psImageUnbinPixel(xPos, yPos, backModel->image, binning);
    216231            if (isnan(source->sky) && false) {
    217232                psLogMsg ("psphot.magnitudes", PS_LOG_DETAIL, "error setting pmSource.sky");
     
    223238        if (backStdev) {
    224239            psAssert (binning, "if backStdev is defined, so should binning be");
    225             source->skyErr = psImageUnbinPixel(source->peak->x, source->peak->y, backStdev->image, binning);
     240            source->skyErr = psImageUnbinPixel(xPos, yPos, backStdev->image, binning);
    226241            if (isnan(source->skyErr) && false) {
    227242                psLogMsg ("psphot.magnitudes", PS_LOG_DETAIL, "error setting pmSource.skyErr");
Note: See TracChangeset for help on using the changeset viewer.