Changeset 38560 for trunk/psphot/src/psphotStackUpdateReadout.c
- Timestamp:
- Jul 2, 2015, 7:36:29 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotStackUpdateReadout.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotStackUpdateReadout.c
r38531 r38560 362 362 source->modelPSF->residuals = psf->residuals; 363 363 } 364 364 365 if (!(source->mode & PM_SOURCE_MODE_PSFMODEL)) { 365 366 // The cmf loaders unconditionallly create psf models even if the source did not have one. … … 372 373 } 373 374 374 // make sure that the window radius is large enough. Should we do this regardless of whether375 // or not the source is extended?375 // make sure that the window radius is large enough. 376 // Should we do this regardless of whether or not the source is extended? 376 377 float fitRadius = NAN; 377 378 float windowRadius = NAN; 378 if (1 || source->modelEXT) { 379 if (!psphotSetRadiusMoments (&fitRadius, &windowRadius, readout, source, markVal)) { 380 psError (PSPHOT_ERR_UNKNOWN, false, "failed to set radius for ext source"); 381 return false; 382 } 383 } 379 if (!psphotSetRadiusMoments (&fitRadius, &windowRadius, readout, source, markVal)) { 380 psError (PSPHOT_ERR_UNKNOWN, false, "failed to set radius for ext source"); 381 return false; 382 } 383 // We are getting some sources near the edge of skycells which are marked as having 384 // been fit with saturated star model but have peak coordinates far outside the 385 // image. When this happens an error is left on the stack. 386 psErrorClear(); 384 387 385 388 // If we find a good model we will cache it below. … … 431 434 // I Should be getting that information from the recipe. 432 435 pmPCMdata *pcm = pmPCMinit (source, fitOptions, model, maskVal, psfSize); 433 if (!pcm) { 434 psError (PSPHOT_ERR_UNKNOWN, false, "failed to to initialize PCM for model"); 435 return false; 436 if (pcm) { 437 model->params->data.F32[PM_PAR_I0] = 1.0; 438 float normFlux = model->class->modelFlux(model->params); 439 float I0 = modelFlux / normFlux; 440 if (isfinite(I0)) { 441 model->params->data.F32[PM_PAR_I0] = I0; 442 goodModel = true; 443 // Usually this it is set when doing the fit. Since we are instantiating the model we 444 // set it explicitly here. 445 model->isPCM = true; 446 } 447 psFree(pcm); 448 } else { 449 // psError (PSPHOT_ERR_UNKNOWN, false, "failed to to initialize PCM for model"); 450 // return false; 451 // fall through 436 452 } 437 model->params->data.F32[PM_PAR_I0] = 1.0;438 // XXX: this duplicates work that pmPCMCacheModel does439 // pmPCMMakeModel (source, model, pcm->nsigma, maskVal, psfSize);440 float normFlux = model->class->modelFlux(model->params);441 float I0 = modelFlux / normFlux;442 if (isfinite(I0)) {443 model->params->data.F32[PM_PAR_I0] = I0;444 goodModel = true;445 // Usually this it is set when doing the fit. Since we are instantiating the model we446 // set it explicitly here.447 model->isPCM = true;448 }449 psFree(pcm);450 453 } 451 454 if (!goodModel) { … … 458 461 // XXX However we aren't going to cache it below so... 459 462 source->type = PM_SOURCE_TYPE_STAR; 463 psFree(source->modelEXT); 464 source->modelEXT = NULL; 460 465 model = NULL; 461 466 }
Note:
See TracChangeset
for help on using the changeset viewer.
