IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30196


Ignore:
Timestamp:
Dec 28, 2010, 12:49:29 PM (15 years ago)
Author:
eugene
Message:

enable caching of the pcm models as well as regular ones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psphot/src/psphotReplaceUnfit.c

    r30174 r30196  
    213213    psAssert (maskVal, "missing mask value?");
    214214
     215    // what fraction of the PSF is used? (radius in pixels : 2 -> 5x5 box)
     216    int psfSize = psMetadataLookupS32 (&status, recipe, "PCM_BOX_SIZE");
     217    assert (status);
     218
    215219    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    216220    psAssert (psf, "missing psf?");
     
    254258          pmSourceCachePSF (source, maskVal);
    255259
    256 # if (0)
    257260          psKernel *psfKernel = pmPCMkernelFromPSF(source, psfSize);
    258261          if (!psfKernel) {
     
    260263          }
    261264
    262           psImage *modelFlux = getmodelflux(model);
    263           psImageConvolveFFT (source->modelFlux, modelFlux, NULL, 0, psfKernel);
     265          // generate an image of the right size
     266          psImage *rawModelFlux = psImageCopy (NULL, source->pixels, PS_TYPE_F32);
     267          psImageInit (rawModelFlux, 0.0);
     268         
     269          // insert the model image normalized to 1.0
     270          pmModelAdd (rawModelFlux, NULL, model, PM_MODEL_OP_FULL | PM_MODEL_OP_NORM, maskVal);
     271
     272          psImageConvolveFFT (source->modelFlux, rawModelFlux, NULL, 0, psfKernel);
    264273         
    265274          psFree (psfKernel);
    266           psFree (modelFlux);
    267 # endif
     275          psFree (rawModelFlux);
    268276      }
    269277
     
    271279    }
    272280
    273     // psphotSaveImage(NULL, readoutIn->image, "image.in.fits");
    274     // psphotSaveImage(NULL, readoutOut->image, "image.out.sub.fits");
    275     // psphotVisualShowImage (readout);
    276 
    277281    psLogMsg ("psphot.replace", PS_LOG_INFO, "subtracted models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot.replace"));
    278282    return true;
Note: See TracChangeset for help on using the changeset viewer.