IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2014, 12:30:45 PM (12 years ago)
Author:
eugene
Message:

merge changes (from past YEAR) into trunk

Location:
branches/eam_branches/ipp-ops-20130712/psModules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-ops-20130712/psModules

    • Property svn:mergeinfo deleted
  • branches/eam_branches/ipp-ops-20130712/psModules/src/objects

    • Property svn:ignore
      •  

        old new  
        1212pmSourceIO_CMF_PS1_V1.v1.c
        1313pmSourceIO_CMF_PS1_V4.c
         14pmSourceIO_CMF_PS1_V5.c
        1415pmSourceIO_CMF_PS1_SV1.c
        1516pmSourceIO_CMF_PS1_SV2.c
         17pmSourceIO_CMF_PS1_SV3.c
        1618pmSourceIO_CMF_PS1_DV1.c
        1719pmSourceIO_CMF_PS1_DV2.c
        1820pmSourceIO_CMF_PS1_DV3.c
        19 
         21pmSourceIO_CMF_PS1_DV4.c
  • branches/eam_branches/ipp-ops-20130712/psModules/src/objects/pmSourceFitModel.c

    r35768 r37066  
    3333#include "pmMoments.h"
    3434#include "pmModelFuncs.h"
     35#include "pmModelClass.h"
    3536#include "pmModel.h"
    3637#include "pmModelUtils.h"
    37 #include "pmModelClass.h"
    3838#include "pmSourceMasks.h"
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
    4141#include "pmSourceSatstar.h"
     42#include "pmSourceLensing.h"
    4243#include "pmSource.h"
    4344#include "pmSourcePhotometry.h"
     
    5960    opt->maxTol = 1.00;
    6061    opt->weight = 1.00;
     62    opt->nsigma = 5.00;
    6163    opt->maxChisqDOF = NAN;
    6264    opt->poissonErrors = true;
     
    6668    opt->gainFactorMode = 0;
    6769    opt->chisqConvergence = true;
     70    opt->isInteractive = false;
    6871
    6972    return opt;
     
    167170    psMinConstraint *constraint = psMinConstraintAlloc();
    168171    constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
    169     constraint->checkLimits = model->modelLimits;
     172    constraint->checkLimits = model->class->modelLimits;
    170173
    171174    // set parameter mask based on fitting mode
     
    230233    // force the floating parameters to fall within the contraint ranges
    231234    for (int i = 0; i < params->n; i++) {
    232         model->modelLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL);
    233         model->modelLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL);
     235        model->class->modelLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL);
     236        model->class->modelLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL);
    234237    }
    235238
     
    247250    myMin->gainFactorMode = options->gainFactorMode;
    248251    myMin->chisqConvergence = options->chisqConvergence;
     252    myMin->isInteractive = options->isInteractive;
    249253
    250254    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
    251255
    252     fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->modelFunc);
     256    fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->class->modelFunc);
    253257    for (int i = 0; i < dparams->n; i++) {
    254258        if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
     
    279283    // set the model success or failure status
    280284    model->flags |= PM_MODEL_STATUS_FITTED;
    281     if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
     285    if (!fitStatus) {
     286        if (isnan(myMin->value)) {
     287          model->flags |= PM_MODEL_STATUS_NAN_CHISQ;
     288        } else {
     289          model->flags |= PM_MODEL_STATUS_NONCONVERGE;
     290        }
     291    }
    282292
    283293    if (myMin->chisqConvergence) {
     
    296306            altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1;
    297307        }
    298         psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc);
     308        psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->class->modelFunc);
    299309
    300310        for (int i = 0; i < dparams->n; i++) {
Note: See TracChangeset for help on using the changeset viewer.