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/pmSourceFitSet.c

    r30763 r30784  
    335335        psTrace ("psModules.objects", 4, " src %d", i);
    336336
     337        model->nIter = myMin->iter;
     338        // model->nPar is set by pmSourceFitSetMasks
     339
    337340        // save the resulting chisq, nDOF, nIter
    338341        // these are not unique for any one source
     
    340343            model->chisq = myMin->value;
    341344            model->nPix  = nPix;
    342             model->nDOF  = nPix - model->params->n;
     345            model->nDOF  = nPix - model->nPar;
    343346            model->chisqNorm = model->chisq / model->nDOF;
    344347        } else {
    345             pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, options->covarFactor, model->params->n);
     348            pmSourceChisqUnsubtracted (source, model, maskVal);
    346349        }
    347         model->nIter = myMin->iter;
    348350
    349351        // set the model success or failure status
     
    399401    for (int i = 0; i < set->paramSet->n; i++) {
    400402        psVector *paramOne = set->paramSet->data[i];
     403        pmModel  *modelOne = set->modelSet->data[i];
    401404
    402405        switch (mode) {
     
    406409                if (j == PM_PAR_I0) continue;
    407410                constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + j] = 1;
     411                modelOne->nPar = 1;
    408412            }
    409413            break;
     
    415419                if (j == PM_PAR_I0) continue;
    416420                constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + j] = 1;
     421                modelOne->nPar = 3;
    417422            }
    418423            break;
     
    420425            // EXT model fits all params (except sky)
    421426            constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + PM_PAR_SKY] = 1;
     427            modelOne->nPar = paramOne->n - 1;
    422428            break;
    423429          default:
Note: See TracChangeset for help on using the changeset viewer.