- Timestamp:
- Sep 13, 2009, 4:49:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_SERSIC.c
r20001 r25351 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 … … 32 32 # define PM_MODEL_FIT_STATUS pmModelFitStatus_SERSIC 33 33 34 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 35 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 36 // values need to be pixel coords 34 37 psF32 PM_MODEL_FUNC (psVector *deriv, 35 38 const psVector *params, … … 223 226 224 227 // make an initial guess for parameters 228 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 225 229 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 226 230 { … … 247 251 if (!isfinite(shape.sxy)) return false; 248 252 249 // XXX PAR[PM_PAR_SKY] = moments->Sky;250 253 PAR[PM_PAR_SKY] = 0.0; 251 254 PAR[PM_PAR_I0] = peak->flux; … … 429 432 bool PM_MODEL_FIT_STATUS (pmModel *model) 430 433 { 431 432 psF32 dP;433 434 bool status; 434 435 … … 436 437 psF32 *dPAR = model->dparams->data.F32; 437 438 438 dP = 0;439 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);440 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);441 dP = sqrt (dP);442 443 439 status = true; 444 // status &= (dP < 0.5);445 440 status &= (PAR[PM_PAR_I0] > 0); 446 441 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); 447 448 fprintf (stderr, "SERSIC status pars: dP: %f, I0: %f, S/N: %f\n",449 dP, PAR[PM_PAR_I0], (dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]));450 442 451 443 return status;
Note:
See TracChangeset
for help on using the changeset viewer.
