- Timestamp:
- Jul 17, 2014, 12:30:45 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/psModules
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/objects (modified) (1 prop)
-
src/objects/pmSourceFitModel.c (modified) (8 diffs)
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 12 12 pmSourceIO_CMF_PS1_V1.v1.c 13 13 pmSourceIO_CMF_PS1_V4.c 14 pmSourceIO_CMF_PS1_V5.c 14 15 pmSourceIO_CMF_PS1_SV1.c 15 16 pmSourceIO_CMF_PS1_SV2.c 17 pmSourceIO_CMF_PS1_SV3.c 16 18 pmSourceIO_CMF_PS1_DV1.c 17 19 pmSourceIO_CMF_PS1_DV2.c 18 20 pmSourceIO_CMF_PS1_DV3.c 19 21 pmSourceIO_CMF_PS1_DV4.c
-
- Property svn:ignore
-
branches/eam_branches/ipp-ops-20130712/psModules/src/objects/pmSourceFitModel.c
r35768 r37066 33 33 #include "pmMoments.h" 34 34 #include "pmModelFuncs.h" 35 #include "pmModelClass.h" 35 36 #include "pmModel.h" 36 37 #include "pmModelUtils.h" 37 #include "pmModelClass.h"38 38 #include "pmSourceMasks.h" 39 39 #include "pmSourceExtendedPars.h" 40 40 #include "pmSourceDiffStats.h" 41 41 #include "pmSourceSatstar.h" 42 #include "pmSourceLensing.h" 42 43 #include "pmSource.h" 43 44 #include "pmSourcePhotometry.h" … … 59 60 opt->maxTol = 1.00; 60 61 opt->weight = 1.00; 62 opt->nsigma = 5.00; 61 63 opt->maxChisqDOF = NAN; 62 64 opt->poissonErrors = true; … … 66 68 opt->gainFactorMode = 0; 67 69 opt->chisqConvergence = true; 70 opt->isInteractive = false; 68 71 69 72 return opt; … … 167 170 psMinConstraint *constraint = psMinConstraintAlloc(); 168 171 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 169 constraint->checkLimits = model-> modelLimits;172 constraint->checkLimits = model->class->modelLimits; 170 173 171 174 // set parameter mask based on fitting mode … … 230 233 // force the floating parameters to fall within the contraint ranges 231 234 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); 234 237 } 235 238 … … 247 250 myMin->gainFactorMode = options->gainFactorMode; 248 251 myMin->chisqConvergence = options->chisqConvergence; 252 myMin->isInteractive = options->isInteractive; 249 253 250 254 psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32); 251 255 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); 253 257 for (int i = 0; i < dparams->n; i++) { 254 258 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) … … 279 283 // set the model success or failure status 280 284 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 } 282 292 283 293 if (myMin->chisqConvergence) { … … 296 306 altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1; 297 307 } 298 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model-> modelFunc);308 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->class->modelFunc); 299 309 300 310 for (int i = 0; i < dparams->n; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
