- Timestamp:
- Jul 22, 2011, 5:08:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/psModules/src/objects/pmPCM_MinimizeChisq.c
r29012 r31926 45 45 # define USE_FFT 1 46 46 # define PRE_CONVOLVE 1 47 # define TESTCOPY 0 47 48 48 49 bool pmPCM_MinimizeChisq ( … … 93 94 psFree (pcm->psfFFT); 94 95 } 95 pcm->psfFFT = psImageConvolveKernelInit(pcm->modelFlux, pcm->psf); 96 # if (!TESTCOPY) 97 if (!pcm->use1Dgauss) { 98 pcm->psfFFT = psImageConvolveKernelInit(pcm->modelFlux, pcm->psf); 99 } 100 # endif 96 101 # endif 97 102 … … 309 314 # if (PRE_CONVOLVE) 310 315 // convolve model image and derivative images with pre-convolved kernel 311 psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT); 316 317 // XXX for a test, just copy, rather than convolve 318 # if (TESTCOPY) 319 psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 320 # else 321 if (pcm->use1Dgauss) { 322 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 323 // * the model flux is not masked 324 // * threading takes place above this level 325 pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 326 psImageSmooth (pcm->modelConvFlux, pcm->sigma, pcm->nsigma); 327 } else { 328 psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT); 329 } 330 # endif 331 312 332 for (int n = 0; n < pcm->dmodelsFlux->n; n++) { 313 333 if (pcm->dmodelsFlux->data[n] == NULL) continue; … … 315 335 psImage *dmodel = pcm->dmodelsFlux->data[n]; 316 336 psImage *dmodelConv = pcm->dmodelsConvFlux->data[n]; 317 psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT); 337 # if (TESTCOPY) 338 psImageCopy (dmodelConv, dmodel, dmodel->type.type); 339 # else 340 if (pcm->use1Dgauss) { 341 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 342 // * the model flux is not masked 343 // * threading takes place above this level 344 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 345 psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma); 346 } else { 347 psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT); 348 } 349 # endif 318 350 } 319 351 # else … … 325 357 psImage *dmodel = pcm->dmodelsFlux->data[n]; 326 358 psImage *dmodelConv = pcm->dmodelsConvFlux->data[n]; 327 psImageConvolveFFT (dmodelConv, dmodel, NULL, 0, pcm->psf); 359 360 if (pcm->use1Dgauss) { 361 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 362 // * the model flux is not masked 363 // * threading takes place above this level 364 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 365 psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma); 366 } else { 367 psImageConvolveFFT (dmodelConv, dmodel, NULL, 0, pcm->psf); 368 } 328 369 } 329 370 # endif // PRE-CONVOLVE
Note:
See TracChangeset
for help on using the changeset viewer.
