Changeset 31990
- Timestamp:
- Aug 3, 2011, 10:30:02 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/psphot/src
- Files:
-
- 5 edited
-
psphot.h (modified) (1 diff)
-
psphotExtendedSourceFits.c (modified) (15 diffs)
-
psphotRadiusChecks.c (modified) (1 diff)
-
psphotSersicModelClass.c (modified) (5 diffs)
-
psphotSourceFits.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/psphot/src/psphot.h
r31452 r31990 469 469 psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc); 470 470 471 bool psphotSersicModelClassGuessPCM (pmPCMdata *pcm, pmSource *source); 472 void psphotSersicModelClassInit (); 473 void psphotSersicModelClassCleanup (); 474 475 bool psphotSetRadiusMoments (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal); 476 471 477 #endif -
branches/eam_branches/ipp-20110710/psphot/src/psphotExtendedSourceFits.c
r31867 r31990 45 45 int Nfail = 0; 46 46 47 psphotSersicModelClassInit(); 48 47 49 psTimerStart ("psphot.extended"); 48 50 … … 103 105 104 106 if (item->type != PS_DATA_METADATA) { 107 // XXX we could cull the bad entries or build a validated model folder 105 108 psAbort ("Invalid type for EXTENDED_SOURCE_MODEL entry %s, not a metadata folder", item->name); 106 // XXX we could cull the bad entries or build a validated model folder107 109 } 108 110 … … 247 249 psFree(AnalysisRegion); 248 250 251 psphotSersicModelClassCleanup(); 252 249 253 psLogMsg ("psphot", PS_LOG_INFO, "extended source model fits: %f sec for %d objects\n", psTimerMark ("psphot.extended"), Next); 250 254 psLogMsg ("psphot", PS_LOG_INFO, " %d convolved models (%d passed)\n", Nconvolve, NconvolvePass); … … 265 269 int Nplain = 0; 266 270 int NplainPass = 0; 267 bool savePics = false; 268 float radius; 271 float fitRadius, windowRadius; 269 272 psScalar *scalar = NULL; 270 273 pmMoments psfMoments; … … 279 282 psImageMaskType markVal = PS_SCALAR_VALUE(job->args->data[6],PS_TYPE_IMAGE_MASK_DATA); 280 283 281 // pthread_t tid = pthread_self(); // Thread identifier282 283 284 // Define source fitting parameters for extended source fits 284 285 pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc(); … … 309 310 if (source->peak->y > region->y1) continue; 310 311 311 // if model is NULL, we don't have a starting guess312 // XXX use the parameters guessed from moments313 // if (source->modelEXT == NULL) continue;314 315 // fprintf (stderr, "fit %d,%d in thread %d\n", source->peak->x, source->peak->y, (int) tid);316 317 312 // replace object in image 318 313 if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) { … … 321 316 Next ++; 322 317 323 // set the radius based on the f ootprint (also sets the mask pixels)324 if (!psphotSetRadius Footprint(&radius, readout, source, markVal, 1.0)) {318 // set the radius based on the first radial moment (also sets the mask pixels) 319 if (!psphotSetRadiusMoments(&fitRadius, &windowRadius, readout, source, markVal)) { 325 320 fprintf (stderr, "skipping (1) %f, %f\n", source->peak->xf, source->peak->yf); 326 321 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 327 // XXX raise an error of some kind 322 // XXX raise an error of some kind or set a flag bit 328 323 continue; 329 324 } 330 325 331 // XXX note that this changes the source moments that are published... 332 // recalculate the source moments using the larger extended-source moments radius 333 // at this stage, skip Gaussian windowing, and do not clip pixels by S/N 334 // this uses the footprint to judge both radius and aperture? 335 // XXX save the psf-based moments for output 326 // Recalculate the source moments using the larger extended-source moments radius. At 327 // this stage, skip Gaussian windowing, and do not clip pixels by S/N. Save the 328 // psf-based moments for output 336 329 psfMoments = *source->moments; 337 if (!pmSourceMoments (source, radius, 0.0, 0.0, 0.0, maskVal)) {330 if (!pmSourceMoments (source, windowRadius, 0.0, 0.0, 0.0, maskVal & PS_NOT_IMAGE_MASK(markVal))) { 338 331 // subtract the best fit from the object, leave local sky 339 332 fprintf (stderr, "skipping (2) %f, %f\n", source->peak->xf, source->peak->yf); … … 344 337 } 345 338 346 // save the modelFlux here in case we need to subtract it (for failure) 339 // save the PSF-based modelFlux here in case we need to subtract it (for failure). If 340 // it does not exist, attempt to generate it. Give up if we cannot even do that. 347 341 psImage *modelFluxStart = psMemIncrRefCounter (source->modelFlux); 348 342 if (!modelFluxStart) { … … 358 352 } 359 353 360 if (savePics) {361 psphotSaveImage (NULL, readout->image, "image.xp.fits");362 }363 364 354 // array to store the pointers to the model flux images while the models are being fitted 365 355 psArray *modelFluxes = psArrayAllocEmpty (models->list->n); … … 368 358 if (source->modelFits == NULL) { 369 359 source->modelFits = psArrayAllocEmpty (models->list->n); 360 } 361 // extFitPars are the non-parametric data measured for this model fit (moments, kron, etc) 362 if (source->extFitPars == NULL) { 363 source->extFitPars = psArrayAllocEmpty (models->list->n); 370 364 } 371 365 … … 397 391 bool convolved = psMetadataLookupBool (&status, model, "PSF_CONVOLVED_VALUE"); 398 392 assert (status); 399 400 // XXX psTraceSetLevel ("psLib.math.psMinimizeLMChi2", 6);401 // XXX psTraceSetLevel ("psphot.psphotModelWithPSF_LMM", 6);402 403 // XXX this does not make sense in a threaded context404 psTimerStart ("psphot.extended.fit");405 393 406 394 // fit the model as convolved or not … … 439 427 } 440 428 441 psLogMsg ("psphot", PS_LOG_INFO, "model fit: %7.5f sec, %5d npix, %2d iter, %s type\n", psTimerMark ("psphot.extended.fit"), modelFit->nPix, modelFit->nIter, pmModelClassGetName (modelFit->type)); 442 443 // save each of the model flux images and store the best 429 // save each of the model flux images for now, and (below) store the best 444 430 psArrayAdd (modelFluxes, 4, source->modelFlux); 445 431 432 pmSourceExtFitPars *extFitPars = pmSourceExtFitParsAlloc(); 433 extFitPars->Mxx = source->moments->Mxx; 434 extFitPars->Mxy = source->moments->Mxy; 435 extFitPars->Myy = source->moments->Myy; 436 extFitPars->Mrf = source->moments->Mrf; 437 extFitPars->Mrh = source->moments->Mrh; 438 extFitPars->peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN; 439 440 // save kron mag, but assign apMag & psfMag on output (not yet calculated) 441 extFitPars->krMag = -2.5*log10(source->moments->KronFlux); 442 443 psArrayAdd (source->extFitPars, 4, extFitPars); 444 psFree (extFitPars); 445 446 446 // test for fit quality / result 447 modelFit->fitRadius = radius;447 modelFit->fitRadius = fitRadius; 448 448 psArrayAdd (source->modelFits, 4, modelFit); 449 449 … … 470 470 } 471 471 472 // clear the circular mask 473 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 474 472 475 if (minModel == -1) { 473 // re-subtract the object, leave local sky476 // no valid extended fit; re-subtract the object, leave local sky 474 477 psTrace ("psphot", 5, "failed to fit extended source model to object at %f, %f", source->moments->Mx, source->moments->My); 475 478 … … 483 486 psFree (modelFluxes); 484 487 485 if (savePics) {486 psphotSaveImage (NULL, readout->image, "image.xp.fits");487 char key[10];488 fprintf (stdout, "continue? ");489 if (!fgets (key, 8, stdin)) {490 psWarning("Couldn't read anything.");491 } else if (key[0] == 'n') {492 savePics = false;493 }494 }495 488 continue; 496 489 } … … 516 509 psTrace ("psphot", 4, "best ext model for %f, %f : %s chisq = %f\n", source->moments->Mx, source->moments->My, pmModelClassGetName (source->modelEXT->type), source->modelEXT->chisq); 517 510 psTrace ("psphot", 5, "extended source model for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 518 519 if (savePics) {520 psphotSaveImage (NULL, readout->image, "image.xm.fits");521 char key[10];522 fprintf (stdout, "continue? ");523 if (!fgets (key, 8, stdin)) {524 psWarning("Couldn't read anything.");525 } else if (key[0] == 'n') {526 savePics = false;527 }528 }529 511 } 530 512 psFree (fitOptions); 531 532 // fprintf (stderr, "xfit : tried %ld objects\n", sources->n);533 513 534 514 // change the value of a scalar on the array (wrap this and put it in psArray.h) -
branches/eam_branches/ipp-20110710/psphot/src/psphotRadiusChecks.c
r31452 r31990 142 142 } 143 143 144 # define MIN_WINDOW 5.0 145 # define SCALE1 5.0 146 # define SCALE2 12.5 147 148 // call this function whenever you (re)-define the EXT model 149 bool psphotSetRadiusMoments (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal) { 150 151 psAssert (source, "source not defined??"); 152 psAssert (source->moments, "moments not defined??"); 153 154 *fitRadius = SCALE1 * source->moments->Mrf; 155 *fitRadius = PS_MIN (PS_MAX(*fitRadius, MIN_WINDOW), EXT_FIT_MAX_RADIUS); 156 157 *windowRadius = SCALE2 * source->moments->Mrf; 158 *windowRadius = PS_MIN (PS_MAX(*windowRadius, 2.5*MIN_WINDOW), 2.5*EXT_FIT_MAX_RADIUS); 159 160 // redefine the pixels if needed 161 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, *windowRadius); 162 163 // set the mask to flag the excluded pixels 164 psImageKeepCircle (source->maskObj, source->peak->xf, source->peak->yf, *fitRadius, "OR", markVal); 165 166 return true; 167 } 168 144 169 // call this function whenever you (re)-define the EXT model 145 170 bool psphotSetRadiusFootprint (float *radius, pmReadout *readout, pmSource *source, psImageMaskType markVal, float factor) { -
branches/eam_branches/ipp-20110710/psphot/src/psphotSersicModelClass.c
r31966 r31990 505 505 } 506 506 507 void psphotWriteGuess(pmModel *model, float dKronMag, float PSFratio, float ASPratio); 507 # define TIMING false 508 508 509 509 bool psphotSersicModelClassGuessPCM (pmPCMdata *pcm, pmSource *source) { 510 511 float t1, t2, t4, t5; 512 if (TIMING) { psTimerStart ("SersicGuess"); } 510 513 511 514 psF32 *PAR = pcm->modelConv->params->data.F32; … … 549 552 550 553 // find the containing model class: 554 555 if (TIMING) { t1 = psTimerMark ("SersicGuess"); } 551 556 552 557 psphotSersicModelClass *class = NULL; … … 561 566 } 562 567 568 if (TIMING) { t2 = psTimerMark ("SersicGuess"); } 569 563 570 psAssert (class, "PSFratio and ASPratio must be in range"); 564 571 … … 610 617 PAR[PM_PAR_I0] = 1.0; 611 618 619 if (TIMING) { t4 = psTimerMark ("SersicGuess"); } 620 612 621 // set the normalization by linear fit between model and data 613 622 psphotSersicModelNorm (pcm, source); 623 624 if (TIMING) { t5 = psTimerMark ("SersicGuess"); } 625 626 if (TIMING) { 627 fprintf (stderr, "guess, t1: %6.4f, t2: %6.4f, t4: %6.4f, t5: %6.4f\n", t1, t2, t4, t5); 628 } 614 629 615 630 // float flux = pcm->modelConv->modelFlux(pcm->modelConv->params); … … 617 632 // float Io = pow(10.0, -0.4*(totalMag - normMag)); 618 633 // PAR[PM_PAR_I0] = Io; 619 620 psphotWriteGuess(pcm->modelConv, dKronMag, PSFratio, ASPratio);621 634 622 635 return true; -
branches/eam_branches/ipp-20110710/psphot/src/psphotSourceFits.c
r31452 r31990 211 211 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *newSources, pmPSF *psf, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal) { 212 212 213 float radius;213 float fitRadius, windowRadius; 214 214 bool okEXT, okDBL; 215 215 pmModel *ONE = NULL; … … 225 225 if (source->type == PM_SOURCE_TYPE_SATURATED) return false; 226 226 227 # define TEST_X -540.0 228 # define TEST_Y 540.0 229 230 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 231 fprintf (stderr, "test galaxy\n"); 232 } 233 234 # undef TEST_X 235 # undef TEST_Y 236 227 237 // set the radius based on the footprint (also sets the mask pixels) 228 if (!psphotSetRadiusFootprint(&radius, readout, source, markVal, 1.0)) return false; 238 if (!psphotSetRadiusMoments(&fitRadius, &windowRadius, readout, source, markVal)) return false; 239 // fprintf (stderr, "rad: %6.1f %6.1f | %5.2f %5.2f %5.2f ", source->peak->xf, source->peak->yf, source->moments->Mrf, fitRadius, windowRadius); 229 240 230 241 // XXX note that this changes the source moments that are published... … … 234 245 // this uses the footprint to judge both radius and aperture? 235 246 // XXX save the psf-based moments for output 247 // XXX do not limit to pixels in the marked circle 236 248 psfMoments = *source->moments; 237 if (!pmSourceMoments (source, radius, 0.0, 0.5, 0.0, maskVal)) {249 if (!pmSourceMoments (source, windowRadius, 0.0, 0.5, 0.0, maskVal & PS_NOT_IMAGE_MASK(markVal))) { 238 250 *source->moments = psfMoments; 251 fprintf (stderr, "skip (bad moments)\n"); 239 252 return false; 240 253 } 254 // fprintf (stderr, "r1: %f\n", source->moments->Mrf); 255 256 // XXX note that we do not re-try to measure the moments if the resulting Mrf is large compared 257 // to the initial value 241 258 242 259 psTrace ("psphot", 5, "trying blob...\n"); … … 263 280 ONE = DBL->data[0]; 264 281 if (ONE) { 265 if (!isfinite(ONE->params->data.F32[PM_PAR_I0])) psAbort("nan in fit");282 psAssert (isfinite(ONE->params->data.F32[PM_PAR_I0]), "nan in fit"); 266 283 chiDBL = ONE->chisqNorm; // save chisq for double-star/galaxy comparison 267 ONE->fitRadius = radius;284 ONE->fitRadius = fitRadius; 268 285 } 269 286 … … 271 288 ONE = DBL->data[1]; 272 289 if (ONE) { 273 if (!isfinite(ONE->params->data.F32[PM_PAR_I0])) psAbort("nan in fit");274 ONE->fitRadius = radius;290 psAssert (isfinite(ONE->params->data.F32[PM_PAR_I0]), "nan in fit"); 291 ONE->fitRadius = fitRadius; 275 292 } 276 293 } … … 284 301 okEXT = psphotEvalEXT (tmpSrc, EXT); 285 302 chiEXT = EXT ? EXT->chisqNorm : NAN; 303 EXT->fitRadius = fitRadius; 286 304 } 287 305 … … 476 494 // for sersic models, use a grid search to choose an index, then float the params there 477 495 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { 478 // for the test fits, use a somewhat smaller radius479 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 0.5);480 496 psphotFitSersicIndex (model, readout, source, fitOptions, maskVal, markVal); 481 }482 483 if (!psphotSetRadiusModel (model, readout, source, markVal, true)) {484 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 1.0);485 497 } 486 498 … … 499 511 } 500 512 513 # define TIMING 0 514 501 515 pmModel *psphotFitPCM (pmReadout *readout, pmSource *source, pmSourceFitOptions *fitOptions, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) { 502 516 … … 517 531 return NULL; 518 532 } 533 534 # define TEST_X -540.0 535 # define TEST_Y 540.0 536 537 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 538 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5); 539 } 540 541 float t1, t2, t4, t5; 542 if (TIMING) { psTimerStart ("psphotFitPCM"); } 519 543 520 544 pmPCMdata *pcm = pmPCMinit (source, &options, model, maskVal, psfSize); … … 524 548 return model; 525 549 } 526 527 // use the source moments, etc to guess basic model parameters 528 if (!pmSourceModelGuessPCM (pcm, source, maskVal, markVal)) { 529 psFree (pcm); 530 model->flags |= PM_MODEL_STATUS_BADARGS; 531 return model; 532 } 533 534 // for sersic models, use a grid search to choose an index, then float the params there 550 if (TIMING) { t1 = psTimerMark ("psphotFitPCM"); } 551 552 // get the guess for sersic models 535 553 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { 536 // for the test fits, use a somewhat smaller radius 537 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 0.5); 538 539 if (!psphotFitSersicIndexPCM (pcm, readout, source, fitOptions, maskVal, markVal, psfSize)) { 554 // use the source moments, etc to guess basic model parameters 555 if (!psphotSersicModelClassGuessPCM (pcm, source)) { 540 556 psFree (pcm); 541 557 model->flags |= PM_MODEL_STATUS_BADARGS; 542 558 return model; 543 559 } 544 } 545 546 if (!psphotSetRadiusModel (model, readout, source, markVal, true)) { 547 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 1.0); 548 } 560 } else { 561 // use the source moments, etc to guess basic model parameters 562 if (!pmSourceModelGuessPCM (pcm, source, maskVal, markVal)) { 563 psFree (pcm); 564 model->flags |= PM_MODEL_STATUS_BADARGS; 565 return model; 566 } 567 } 568 569 if (TIMING) { t2 = psTimerMark ("psphotFitPCM"); } 549 570 550 571 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { … … 555 576 // update the pcm elements if we have changed the circumstance (options.mode or source->pixels) 556 577 pmPCMupdate(pcm, source, &options, model); 578 if (TIMING) { t4 = psTimerMark ("psphotFitPCM"); } 557 579 558 580 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 559 581 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 560 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 582 if (TIMING) { t5 = psTimerMark ("psphotFitPCM"); } 583 584 if (TIMING) { 585 fprintf (stderr, "psphotFitPCM : nIter: %2d, radius: %6.1f, npix: %5d, t1: %6.4f, t2: %6.4f, t4: %6.4f, t5: %6.4f\n", model->nIter, model->fitRadius, model->nPix, t1, t2, t4, t5); 586 } 587 588 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 589 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0); 590 } 561 591 562 592 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); … … 566 596 } 567 597 598 # undef TEST_X 599 # undef TEST_Y 600 568 601 // note that these should be 1/2n of the standard sersic index 569 float indexGuess[] = {0.5, 0.33, 0.25, 0.167, 0.125, 0.083}; 570 # define N_INDEX_GUESS 6 602 // float indexGuess[] = {0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0}; 603 // float indexGuess[] = {0.5, 0.33, 0.25, 0.167, 0.125, 0.083}; 604 float indexGuess[] = {1.0, 2.0, 3.0, 4.0}; 605 # define N_INDEX_GUESS 4 571 606 572 607 // A sersic model is very sensitive to the index. attempt to find the index first by grid search in just the index … … 586 621 float chiSquare[N_INDEX_GUESS]; 587 622 623 # define TEST_X -540.0 624 # define TEST_Y 540.0 625 626 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 627 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5); 628 } 629 588 630 for (int i = 0; i < N_INDEX_GUESS; i++) { 589 model->params->data.F32[PM_PAR_7] = indexGuess[i];631 model->params->data.F32[PM_PAR_7] = 0.5/indexGuess[i]; 590 632 591 633 if (!model->modelGuess(model, source)) { … … 594 636 } 595 637 596 // each time we change the model guess, we need to adjust the radius597 // XXX this did not work : we do not need such a large radius -- just uses moments-based radius598 if (false && !psphotSetRadiusModel (model, readout, source, markVal, false)) {599 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 0.5);600 }601 602 638 pmSourceFitModel (source, model, &options, maskVal); 603 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix);639 fprintf (stderr, "index: %f, chisq: %f, nIter: %d, radius: %f, npix: %d\n", indexGuess[i], model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 604 640 605 641 chiSquare[i] = model->chisqNorm; … … 616 652 assert (iMin >= 0); 617 653 654 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 655 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0); 656 } 657 618 658 model->flags = PM_MODEL_STATUS_NONE; // do not attempt to handle failures here, let the next iteration deal with it 619 model->params->data.F32[PM_PAR_7] = indexGuess[iMin];659 model->params->data.F32[PM_PAR_7] = 0.5/indexGuess[iMin]; 620 660 model->modelGuess(model, source); 621 622 // each time we change the model guess, we need to adjust the radius623 // if (!psphotSetRadiusModel (model, readout, source, markVal, true)) {624 // psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal);625 // }626 661 627 662 return true; … … 648 683 float xMin = NAN; 649 684 float chiSquare[N_INDEX_GUESS]; 685 686 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 687 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 5); 688 } 650 689 651 690 for (int i = 0; i < N_INDEX_GUESS; i++) { … … 657 696 } 658 697 659 // each time we change the model guess, we need to adjust the radius660 // XXX this did not work : we do not need such a large radius -- just uses moments-based radius661 if (false && !psphotSetRadiusModel (model, readout, source, markVal, false)) {662 psphotSetRadiusFootprint(&model->fitRadius, readout, source, markVal, 0.5);663 }664 665 698 # if (0) 699 // this block is to test the relative speed of straight and PCM fits 666 700 pmSourceFitModel (source, model, &options, maskVal); 667 701 # else … … 669 703 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 670 704 # endif 705 fprintf (stderr, "index: %f, chisq: %f, nIter: %d, radius: %f, npix: %d\n", indexGuess[i], model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 671 706 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 672 707 … … 684 719 assert (iMin >= 0); 685 720 721 if ((fabs(source->peak->xf - TEST_X) < 5) && (fabs(source->peak->yf - TEST_Y) < 5)) { 722 psTraceSetLevel("psModules.objects.pmPCM_MinimizeChisq", 0); 723 } 724 686 725 model->flags = PM_MODEL_STATUS_NONE; // do not attempt to handle failures here, let the next iteration deal with it 687 726 model->params->data.F32[PM_PAR_7] = indexGuess[iMin];
Note:
See TracChangeset
for help on using the changeset viewer.
