IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 28, 2011, 2:44:39 PM (15 years ago)
Author:
eugene
Message:

unified function to generate output parameters for output cmf files; add chisqNorm calculation to pmSourceChisq, pass in nParams; re-calculate the chisq if we use constant weights; make sure we correctly set nDOF = nPoints - nParams

File:
1 edited

Legend:

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

    r30705 r30763  
    4040#include "pmSourceDiffStats.h"
    4141#include "pmSource.h"
     42#include "pmSourcePhotometry.h"
    4243#include "pmSourceFitModel.h"
    4344
     
    238239
    239240    // save the resulting chisq, nDOF, nIter
    240     model->chisq = myMin->value;
     241    if (options->poissonErrors) {
     242        model->chisq = myMin->value;
     243        model->nPix  = y->n;
     244        model->nDOF  = y->n - nParams;
     245        model->chisqNorm = model->chisq / model->nDOF;
     246    } else {
     247        pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, options->covarFactor, nParams);
     248    }
    241249    model->nIter = myMin->iter;
    242     model->nPix  = y->n;
    243     model->nDOF  = y->n - nParams;
    244     model->chisqNorm = model->chisq / model->nDOF;
     250
     251    // set the model success or failure status
    245252    model->flags |= PM_MODEL_STATUS_FITTED;
    246253    if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
Note: See TracChangeset for help on using the changeset viewer.