IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36207


Ignore:
Timestamp:
Oct 13, 2013, 1:31:01 PM (13 years ago)
Author:
eugene
Message:

do not cache or use psf model is we are using 1D gaussians

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmPCMdata.c

    r36089 r36207  
    250250pmPCMdata *pmPCMinit(pmSource *source, pmSourceFitOptions *fitOptions, pmModel *model, psImageMaskType maskVal, float psfSize) {
    251251
    252     // make sure we save a cached copy of the psf flux
    253     pmSourceCachePSF (source, maskVal);
    254 
    255     // convert the cached cached psf model for this source to a psKernel
    256     psKernel *psf = pmPCMkernelFromPSF (source, psfSize);
    257     if (!psf) {
    258         // NOTE: this only happens if the source is too close to an edge
    259         model->flags |= PM_MODEL_STATUS_BADARGS;
    260         return NULL;
    261     }
    262 
    263 # if (USE_DELTA_PSF)
    264     psImageInit (psf->image, 0.0);
    265     psf->image->data.F32[(int)(0.5*psf->image->numRows)][(int)(0.5*psf->image->numCols)] = 1.0;
    266 # endif
    267 
    268252    // count the number of unmasked pixels:
    269253    int nPix = 0;
     
    298282    if (nPix <  nParams + 1) {
    299283        psTrace ("psModules.objects", 4, "insufficient valid pixels\n");
    300         psFree (psf);
    301284        psFree (constraint);
    302285        model->flags |= PM_MODEL_STATUS_BADARGS;
     
    306289    // generate PCM data storage structure
    307290    pmPCMdata *pcm = pmPCMdataAlloc (params, constraint->paramMask, source);
    308 
    309     pcm->psf = psf;
    310291    pcm->modelConv = psMemIncrRefCounter(model);
    311292    pcm->constraint = constraint;
     
    333314    pcm->smdata = psImageSmooth_PreAlloc_DataAlloc (source->pixels, pcm->sigma, pcm->nsigma);
    334315# else
     316    // make sure we save a cached copy of the psf flux
     317    pmSourceCachePSF (source, maskVal);
     318
     319    // convert the cached cached psf model for this source to a psKernel
     320    psKernel *psf = pmPCMkernelFromPSF (source, psfSize);
     321    if (!psf) {
     322        // NOTE: this only happens if the source is too close to an edge
     323        model->flags |= PM_MODEL_STATUS_BADARGS;
     324        return NULL;
     325    }
     326
     327# if (USE_DELTA_PSF)
     328    psImageInit (psf->image, 0.0);
     329    psf->image->data.F32[(int)(0.5*psf->image->numRows)][(int)(0.5*psf->image->numCols)] = 1.0;
     330# endif
     331
     332    pcm->psf = psf;
    335333    pcm->smdata = NULL;
     334
    336335# endif
    337336
Note: See TracChangeset for help on using the changeset viewer.