Changeset 25754 for trunk/psModules/src/objects/models/pmModel_SERSIC.c
- Timestamp:
- Oct 2, 2009, 3:11:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/models/pmModel_SERSIC.c
r25738 r25754 1 1 /****************************************************************************** 2 2 * this file defines the SERSIC source shape model. Note that these model functions are loaded 3 * by pmModel Group.c using 'include', and thus need no 'include' statements of their own. The3 * by pmModelClass.c using 'include', and thus need no 'include' statements of their own. The 4 4 * models use a psVector to represent the set of parameters, with the sequence used to specify 5 5 * the meaning of the parameter. The meaning of the parameters may thus vary depending on the 6 * specifics of the model. All models which are used a PSF representations share a few6 * specifics of the model. All models which are used as a PSF representations share a few 7 7 * parameters, for which # define names are listed in pmModel.h: 8 8 … … 41 41 # define PM_MODEL_FIT_STATUS pmModelFitStatus_SERSIC 42 42 # define PM_MODEL_SET_LIMITS pmModelSetLimits_SERSIC 43 44 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 45 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 46 // values need to be pixel coords 43 47 44 48 // Lax parameter limits … … 186 190 187 191 // make an initial guess for parameters 192 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 188 193 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 189 194 { … … 210 215 if (!isfinite(shape.sxy)) return false; 211 216 212 // XXX PAR[PM_PAR_SKY] = moments->Sky;213 217 PAR[PM_PAR_SKY] = 0.0; 214 218 PAR[PM_PAR_I0] = peak->flux; … … 284 288 285 289 psF64 z = pow (-log(limit), (1.0 / PAR[PM_PAR_7])); 290 psAssert (isfinite(z), "fix this code: z should not be nan for %f", PAR[PM_PAR_7]); 286 291 287 292 psF64 radius = sigma * sqrt (2.0 * z); 293 psAssert (isfinite(radius), "fix this code: radius should not be nan for %f, %f", PAR[PM_PAR_7], sigma); 288 294 289 295 if (isnan(radius)) … … 392 398 bool PM_MODEL_FIT_STATUS (pmModel *model) 393 399 { 394 395 psF32 dP;396 400 bool status; 397 401 … … 399 403 psF32 *dPAR = model->dparams->data.F32; 400 404 401 dP = 0;402 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);403 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);404 dP = sqrt (dP);405 406 405 status = true; 407 // status &= (dP < 0.5);408 406 status &= (PAR[PM_PAR_I0] > 0); 409 407 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); 410 408 409 <<<<<<< .working 411 410 fprintf (stderr, "SERSIC status pars: dP: %f, I0: %f, S/N: %f\n", 412 411 dP, PAR[PM_PAR_I0], (dPAR[PM_PAR_I0]/PAR[PM_PAR_I0])); 413 412 413 ======= 414 >>>>>>> .merge-right.r25750 414 415 return status; 415 416 }
Note:
See TracChangeset
for help on using the changeset viewer.
