IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2011, 3:11:09 PM (15 years ago)
Author:
eugene
Message:

fix the calculation of chisq values for constant errors (re-calculated, do not attempt to correct raw value)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceFitModel.c

    r30763 r30784  
    236236        model->covar = psMemIncrRefCounter(covar);
    237237    }
     238    model->nIter = myMin->iter;
     239    model->nPar = nParams;
     240
    238241    psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
    239242
    240243    // save the resulting chisq, nDOF, nIter
     244    // NOTE: if (!options->poissonErrors) chisq will be wrong : recalculate
    241245    if (options->poissonErrors) {
    242246        model->chisq = myMin->value;
    243247        model->nPix  = y->n;
    244         model->nDOF  = y->n - nParams;
     248        model->nDOF  = y->n - model->nPar;
    245249        model->chisqNorm = model->chisq / model->nDOF;
    246250    } else {
    247         pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, options->covarFactor, nParams);
    248     }
    249     model->nIter = myMin->iter;
     251        pmSourceChisqUnsubtracted (source, model, maskVal);
     252    }
    250253
    251254    // set the model success or failure status
Note: See TracChangeset for help on using the changeset viewer.