IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25618


Ignore:
Timestamp:
Sep 27, 2009, 11:18:40 AM (17 years ago)
Author:
eugene
Message:

PM_SOURCE_TMPF_SUBTRACTED is now set in pmSourceAdd/Sub; careful to mask the correct fit radius;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src/psphotSourceFits.c

    r25497 r25618  
    9090    psphotCheckRadiusPSFBlend (readout, source, PSF, markVal, dR);
    9191
    92     // fit PSF model (set/unset the pixel mask)
     92    // fit PSF model
    9393    pmSourceFitSet (source, modelSet, PM_SOURCE_FIT_PSF, maskVal);
     94
     95    // clear the circular mask
     96    psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    9497
    9598    // correct model chisq for flux trend
     
    120123        pmSourceCacheModel (blend, maskVal);
    121124        pmSourceSub (blend, PM_MODEL_OP_FULL, maskVal);
    122         blend->tmpFlags |=  PM_SOURCE_TMPF_SUBTRACTED;
    123125        blend->mode |=  PM_SOURCE_MODE_BLEND_FIT;
    124126    }
     
    144146    pmSourceCacheModel (source, maskVal);
    145147    pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
    146     source->tmpFlags |=  PM_SOURCE_TMPF_SUBTRACTED;
    147148    source->mode |=  PM_SOURCE_MODE_BLEND_FIT;
    148149    return true;
     
    167168    // fit PSF model (set/unset the pixel mask)
    168169    pmSourceFitModel (source, PSF, PM_SOURCE_FIT_PSF, maskVal);
     170
     171    // clear the circular mask
     172    psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    169173
    170174    // correct model chisq for flux trend
     
    186190    pmSourceCacheModel (source, maskVal);
    187191    pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
    188     source->tmpFlags |=  PM_SOURCE_TMPF_SUBTRACTED;
    189192    return true;
    190193}
     
    223226    if (source->peak->SN < EXT_MIN_SN) return false;
    224227
     228    // set the radius based on the footprint (also sets the mask pixels)
    225229    float radius = psphotSetRadiusEXT (readout, source, markVal);
    226230
     
    228232    // recalculate the source moments using the larger extended-source moments radius
    229233    // at this stage, skip Gaussian windowing, and do not clip pixels by S/N
    230     // XXX use the deteremined value of PSF_MOMENTS_RADIUS and SIGMA and scale up?
    231     // XXX increase the moments radius iteratively until the measured sigma / input < f?
    232     // XXX use the footprint somehow to judge both radius and aperture?
     234    // this uses the footprint to judge both radius and aperture?
    233235    if (!pmSourceMoments (source, radius, 0.0, 0.0)) return false;
    234236
     
    251253    okDBL &= psphotEvalDBL (tmpSrc, DBL->data[1]);
    252254    // XXX should I keep / save the flags set in the eval functions?
     255
     256    // clear the circular mask
     257    psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    253258
    254259    // correct first model chisqs for flux trend
     
    301306    pmSourceCacheModel (source, maskVal);
    302307    pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
    303     source->tmpFlags |=  PM_SOURCE_TMPF_SUBTRACTED;
    304308
    305309# if (PS_TRACE_ON)   
     
    322326    psFree (source->modelPSF);
    323327    source->modelPSF = psMemIncrRefCounter (DBL->data[0]);
    324     source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
    325328    source->mode     |= PM_SOURCE_MODE_PAIR;
    326329    source->modelPSF->fitRadius = radius;
     
    389392    // save the PSF model from the Ensemble fit
    390393    PSF = source->modelPSF;
    391     // psphotCheckRadiusPSFBlend (readout, source, PSF, markVal, 8.0);
    392394    if (isnan(PSF->params->data.F32[1])) psAbort("nan in dbl fit");
    393395
     
    422424    PS_ASSERT (EXT, NULL);
    423425
    424     // if (isnan(EXT->params->data.F32[1])) psAbort("nan in ext fit");
    425     // psphotCheckRadiusEXT (readout, source, EXT, markVal);
    426 
    427426    if ((source->moments->Mxx < 1e-3) || (source->moments->Myy < 1e-3)) {
    428427        psTrace ("psphot", 5, "problem source: moments: %f %f\n", source->moments->Mxx, source->moments->Myy);
Note: See TracChangeset for help on using the changeset viewer.