Changeset 31153 for trunk/psModules/src/objects/pmSourceFitModel.c
- Timestamp:
- Apr 4, 2011, 1:04:41 PM (15 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSourceFitModel.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:ignore
-
old new 28 28 ChangeLog 29 29 psmodules-*.tar.* 30 a.out.dSYM
-
- Property svn:ignore
-
trunk/psModules/src/objects/pmSourceFitModel.c
r29004 r31153 40 40 #include "pmSourceDiffStats.h" 41 41 #include "pmSource.h" 42 #include "pmSourcePhotometry.h" 42 43 #include "pmSourceFitModel.h" 43 44 … … 59 60 opt->maxChisqDOF = NAN; 60 61 opt->poissonErrors = true; 62 opt->saveCovariance = false; 61 63 62 64 return opt; … … 231 233 psTrace ("psModules.objects", 4, "%f +/- %f", params->data.F32[i], dparams->data.F32[i]); 232 234 } 235 if (options->saveCovariance) { 236 model->covar = psMemIncrRefCounter(covar); 237 } 238 model->nIter = myMin->iter; 239 model->nPar = nParams; 240 233 241 psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value); 234 242 235 243 // save the resulting chisq, nDOF, nIter 236 model->chisq = myMin->value; 237 model->nIter = myMin->iter; 238 model->nPix = y->n; 239 model->nDOF = y->n - nParams; 240 model->chisqNorm = model->chisq / model->nDOF; 244 // NOTE: if (!options->poissonErrors) chisq will be wrong : recalculate 245 if (options->poissonErrors) { 246 model->chisq = myMin->value; 247 model->nPix = y->n; 248 model->nDOF = y->n - model->nPar; 249 model->chisqNorm = model->chisq / model->nDOF; 250 } else { 251 pmSourceChisqUnsubtracted (source, model, maskVal); 252 } 253 254 // set the model success or failure status 241 255 model->flags |= PM_MODEL_STATUS_FITTED; 242 256 if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
Note:
See TracChangeset
for help on using the changeset viewer.
