Changeset 25754 for trunk/psModules/src/objects/models/pmModel_PGAUSS.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_PGAUSS.c
r25738 r25754 1 1 /****************************************************************************** 2 2 * this file defines the PGAUSS 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 … … 54 54 55 55 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 56 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 57 // values need to be pixel coords 56 58 psF32 PM_MODEL_FUNC(psVector *deriv, 57 59 const psVector *params, … … 165 167 166 168 // make an initial guess for parameters 169 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 167 170 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 168 171 { … … 179 182 psEllipseShape shape = psEllipseAxesToShape (axes); 180 183 181 PAR[PM_PAR_SKY] = moments->Sky;184 PAR[PM_PAR_SKY] = 0.0; 182 185 PAR[PM_PAR_I0] = peak->flux; 183 186 PAR[PM_PAR_XPOS] = peak->xf; … … 258 261 // choose a z value guaranteed to be beyond our limit 259 262 float z0 = pow((1.0 / limit), (1.0 / 3.0)); 263 psAssert (isfinite(z0), "fix this code: z0 should not be nan for %f", PAR[PM_PAR_I0]); 260 264 float z1 = (1.0 / limit); 265 psAssert (isfinite(z1), "fix this code: z1 should not be nan for %f", PAR[PM_PAR_I0]); 261 266 z1 = PS_MAX (z0, z1); 262 267 z0 = 0.0; … … 389 394 bool PM_MODEL_FIT_STATUS (pmModel *model) 390 395 { 391 psF32 dP;392 396 bool status; 393 397 … … 395 399 psF32 *dPAR = model->dparams->data.F32; 396 400 397 dP = 0;398 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);399 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);400 dP = sqrt (dP);401 402 401 status = true; 403 status &= (dP < 0.5);404 402 status &= (PAR[PM_PAR_I0] > 0); 405 403 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
Note:
See TracChangeset
for help on using the changeset viewer.
