Changeset 36375 for trunk/psModules/src/objects/pmPCM_MinimizeChisq.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/psModules
- Property svn:mergeinfo changed
-
trunk/psModules/src/objects/pmPCM_MinimizeChisq.c
r36085 r36375 135 135 } 136 136 137 if (min->isInteractive) { 138 fprintf (stderr, "%d : ", min->iter); 139 for (int ti = 0; ti < params->n; ti++) { 140 fprintf (stderr, "%f ", params->data.F32[ti]); 141 } 142 fprintf (stderr, " : %f\n", min->value); 143 } 144 137 145 char key[10]; // used for interactive responses 138 146 bool testValue = false; … … 140 148 // set a new guess for Alpha, Beta, Params 141 149 if (!psMinLM_GuessABP(Alpha, Beta, Params, alpha, beta, params, paramMask, checkLimits, lambda, &dLinear)) { 142 if ( min->isInteractive) {150 if (false && min->isInteractive) { 143 151 fprintf (stdout, "guess failed (singular matrix or NaN values), continue? [Y,n] "); 144 152 if (!fgets(key, 8, stdin)) { … … 167 175 } 168 176 169 if ( min->isInteractive) {177 if (false && min->isInteractive) { 170 178 p_psVectorPrint(psTraceGetDestination(), Params, "current parameters: "); 171 179 fprintf (stdout, "last chisq : %f\n", min->value); … … 473 481 # else 474 482 if (pcm->use1Dgauss) { 475 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 476 // * the model flux is not masked 477 // * threading takes place above this level 478 pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 479 psImageSmooth_PreAlloc_F32 (pcm->modelConvFlux, pcm->smdata); 480 // psImageSmooth (pcm->modelConvFlux, pcm->sigma, pcm->nsigma); 483 484 if (USE_1D_CACHE) { 485 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 486 // * the model flux is not masked 487 // * threading takes place above this level 488 pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 489 psImageSmoothCache_F32 (pcm->modelConvFlux, pcm->smdata); 490 } else { 491 pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type); 492 psImageSmooth2dCache_F32 (pcm->modelConvFlux, pcm->smdata2d); 493 } 481 494 } else { 482 495 psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT); … … 493 506 # else 494 507 if (pcm->use1Dgauss) { 495 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 496 // * the model flux is not masked 497 // * threading takes place above this level 498 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 499 psImageSmooth_PreAlloc_F32 (dmodelConv, pcm->smdata); 500 // psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma); 508 if (USE_1D_CACHE) { 509 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 510 // * the model flux is not masked 511 // * threading takes place above this level 512 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 513 psImageSmoothCache_F32 (dmodelConv, pcm->smdata); 514 } else { 515 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 516 psImageSmooth2dCache_F32 (dmodelConv, pcm->smdata2d); 517 } 501 518 } else { 502 519 psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT); … … 514 531 515 532 if (pcm->use1Dgauss) { 516 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 517 // * the model flux is not masked 518 // * threading takes place above this level 519 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 520 psImageSmooth_PreAlloc_F32 (dmodelConv, pcm->smdata); 521 // psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma); 533 if (USE_1D_CACHE) { 534 // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread): 535 // * the model flux is not masked 536 // * threading takes place above this level 537 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 538 psImageSmoothCache_F32 (dmodelConv, pcm->smdata); 539 } else { 540 dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type); 541 psImageSmooth2dCache_F32 (dmodelConv, pcm->smdata2d); 542 } 522 543 } else { 523 544 psImageConvolveFFT (dmodelConv, dmodel, NULL, 0, pcm->psf); … … 541 562 static int Npass = 0; 542 563 char name[128]; 543 snprintf (name, 128, "psf.%03d.fits", Npass); psphotSaveImage (NULL, pcm->psf->image, name); 564 if (!pcm->use1Dgauss) { 565 snprintf (name, 128, "psf.%03d.fits", Npass); psphotSaveImage (NULL, pcm->psf->image, name); 566 } 544 567 snprintf (name, 128, "mod.%03d.fits", Npass); psphotSaveImage (NULL, pcm->modelFlux, name); 545 568 snprintf (name, 128, "cnv.%03d.fits", Npass); psphotSaveImage (NULL, pcm->modelConvFlux, name); … … 579 602 580 603 float ymodel = pcm->modelConvFlux->data.F32[i][j]; 581 float yweight = 1.0 / source->variance->data.F32[i][j]; 604 605 // XXXX note this point here::: 606 float yweight = pcm->poissonErrors ? 1.0 / source->variance->data.F32[i][j] : 1.0; 582 607 float delta = ymodel - source->pixels->data.F32[i][j]; 583 608
Note:
See TracChangeset
for help on using the changeset viewer.
