- Timestamp:
- Aug 17, 2007, 11:01:59 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070817/psModules/src/objects/pmSourceFitModel.c
r13932 r14544 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 6-21 22:58:11$8 * @version $Revision: 1.24.4.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-08-17 21:01:59 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 #include "pmPSF.h" 31 31 #include "pmSource.h" 32 #include "pmModel Group.h"32 #include "pmModelClass.h" 33 33 #include "pmSourceFitModel.h" 34 34 … … 116 116 psVector *dparams = model->dparams; 117 117 118 pmModelFunc modelFunc = pmModelFunc_GetFunction (model->type);119 if (!modelFunc)120 psAbort("invalid model function");121 pmModelLimits checkLimits = pmModelLimits_GetFunction (model->type);122 if (!checkLimits)123 psAbort("invalid model limits function");124 125 118 // create the minimization constraints 126 119 psMinConstraint *constraint = psMinConstraintAlloc(); 127 120 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_U8); 128 constraint->checkLimits = checkLimits;121 constraint->checkLimits = model->modelLimits; 129 122 130 123 // set parameter mask based on fitting mode … … 156 149 // force the floating parameters to fall within the contraint ranges 157 150 for (int i = 0; i < params->n; i++) { 158 checkLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL);159 checkLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL);151 model->modelLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL); 152 model->modelLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL); 160 153 } 161 154 … … 174 167 psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32); 175 168 176 fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model Func);169 fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->modelFunc); 177 170 for (int i = 0; i < dparams->n; i++) { 178 171 if (psTraceGetLevel("psModules.objects") >= 4) { … … 201 194 altmask->data.U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1; 202 195 } 203 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model Func);196 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc); 204 197 for (int i = 0; i < dparams->n; i++) { 205 198 if (!constraint->paramMask->data.U8[i]) … … 236 229 return(rc); 237 230 } 231 232 # define SKIP_FIT_SET 1 233 # if (SKIP_FIT_SET) 234 235 bool pmSourceFitSet (pmSource *source, 236 psArray *modelSet, 237 pmSourceFitMode mode, 238 psMaskType maskVal) 239 { 240 psTrace("psModules.objects", 3, "---- %s begin ----\n", __func__); 241 PS_ASSERT_PTR_NON_NULL(source, false); 242 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 243 PS_ASSERT_PTR_NON_NULL(source->maskObj, false); 244 PS_ASSERT_PTR_NON_NULL(source->weight, false); 245 246 return true; 247 } 248 249 # else 238 250 239 251 /********************* Source Model Set Functions ***************************/ … … 255 267 oneModelFunc = pmModelFunc_GetFunction (type); 256 268 oneCheckLimits = pmModelLimits_GetFunction (type); 257 nOnePar = pmModel ParameterCount (type);269 nOnePar = pmModelClassParameterCount (type); 258 270 259 271 onePar = psVectorAlloc (nOnePar, PS_DATA_F32); … … 567 579 } 568 580 581 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
