Changeset 36207
- Timestamp:
- Oct 13, 2013, 1:31:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psModules/src/objects/pmPCMdata.c
r36089 r36207 250 250 pmPCMdata *pmPCMinit(pmSource *source, pmSourceFitOptions *fitOptions, pmModel *model, psImageMaskType maskVal, float psfSize) { 251 251 252 // make sure we save a cached copy of the psf flux253 pmSourceCachePSF (source, maskVal);254 255 // convert the cached cached psf model for this source to a psKernel256 psKernel *psf = pmPCMkernelFromPSF (source, psfSize);257 if (!psf) {258 // NOTE: this only happens if the source is too close to an edge259 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 # endif267 268 252 // count the number of unmasked pixels: 269 253 int nPix = 0; … … 298 282 if (nPix < nParams + 1) { 299 283 psTrace ("psModules.objects", 4, "insufficient valid pixels\n"); 300 psFree (psf);301 284 psFree (constraint); 302 285 model->flags |= PM_MODEL_STATUS_BADARGS; … … 306 289 // generate PCM data storage structure 307 290 pmPCMdata *pcm = pmPCMdataAlloc (params, constraint->paramMask, source); 308 309 pcm->psf = psf;310 291 pcm->modelConv = psMemIncrRefCounter(model); 311 292 pcm->constraint = constraint; … … 333 314 pcm->smdata = psImageSmooth_PreAlloc_DataAlloc (source->pixels, pcm->sigma, pcm->nsigma); 334 315 # 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; 335 333 pcm->smdata = NULL; 334 336 335 # endif 337 336
Note:
See TracChangeset
for help on using the changeset viewer.
