- Timestamp:
- Aug 13, 2010, 12:17:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/psModules/src/objects/pmPCM_MinimizeChisq.c
r28702 r28908 43 43 # define FACILITY "psModules.objects" 44 44 45 # define USE_FFT 1 46 # define PRE_CONVOLVE 1 47 45 48 bool pmPCM_MinimizeChisq ( 46 49 psMinimization *min, … … 86 89 psF32 dLinear = 0.0; 87 90 91 # if (USE_FFT && PRE_CONVOLVE) 92 if (pcm->psfFFT) { 93 psFree (pcm->psfFFT); 94 } 95 pcm->psfFFT = psImageConvolveKernelInit(pcm->modelFlux, pcm->psf); 96 # endif 97 88 98 // calculate initial alpha and beta, set chisq (min->value) 89 99 min->value = pmPCM_SetABX(alpha, beta, params, paramMask, pcm, source); … … 293 303 // XXX speed this up by saving the FFTed psf (for each source, obviously) 294 304 305 // XXX save the FFT'ed psf 306 // XXX create an alternative function which takes a pre-FFTed kernel 307 308 # if (USE_FFT) 309 # if (PRE_CONVOLVE) 310 // convolve model image and derivative images with pre-convolved kernel 311 psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT); 312 for (int n = 0; n < pcm->dmodelsFlux->n; n++) { 313 if (pcm->dmodelsFlux->data[n] == NULL) continue; 314 psImage *dmodel = pcm->dmodelsFlux->data[n]; 315 psImage *dmodelConv = pcm->dmodelsConvFlux->data[n]; 316 psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT); 317 } 318 # else 319 // convolve model image and derivative images with psf via FFT 320 psImageConvolveFFT (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psf); 321 for (int n = 0; n < pcm->dmodelsFlux->n; n++) { 322 if (pcm->dmodelsFlux->data[n] == NULL) continue; 323 psImage *dmodel = pcm->dmodelsFlux->data[n]; 324 psImage *dmodelConv = pcm->dmodelsConvFlux->data[n]; 325 psImageConvolveFFT (dmodelConv, dmodel, NULL, 0, pcm->psf); 326 } 327 # endif // PRE-CONVOLVE 328 # else 329 // convolve model image and derivative images with psf direct 295 330 psImageConvolveDirect (pcm->modelConvFlux, pcm->modelFlux, pcm->psf); 296 331 for (int n = 0; n < pcm->dmodelsFlux->n; n++) { … … 300 335 psImageConvolveDirect (dmodelConv, dmodel, pcm->psf); 301 336 } 337 # endif // USE_FFT 302 338 303 339 // XXX TEST : SAVE IMAGES
Note:
See TracChangeset
for help on using the changeset viewer.
