Changeset 25754 for trunk/psModules/src/objects/models/pmModel_RGAUSS.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_RGAUSS.c
r25738 r25754 1 1 /****************************************************************************** 2 2 * this file defines the RGAUSS source shape model (XXX need a better name!). Note that these 3 * model functions are loaded by pmModel Group.c using 'include', and thus need no 'include'3 * model functions are loaded by pmModelClass.c using 'include', and thus need no 'include' 4 4 * statements of their own. The models use a psVector to represent the set of parameters, with 5 5 * the sequence used to specify the meaning of the parameter. The meaning of the parameters 6 * may thus vary depending on the specifics of the model. All models which are used a PSF6 * may thus vary depending on the specifics of the model. All models which are used as a PSF 7 7 * representations share a few parameters, for which # define names are listed in pmModel.h: 8 8 … … 39 39 # define PM_MODEL_SET_LIMITS pmModelSetLimits_RGAUSS 40 40 41 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 42 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 43 // values need to be pixel coords 44 41 45 // Lax parameter limits 42 46 static float paramsMinLax[] = { -1.0e3, 1.0e-2, -100, -100, 0.5, 0.5, -1.0, 1.25 }; … … 87 91 dPAR[PM_PAR_SXY] = -q*X*Y; 88 92 89 // this model derivative is undefined at z = 0.0, but is actually0.093 // this model derivative is undefined at z = 0.0, but the limit is zero as z -> 0.0 90 94 dPAR[PM_PAR_7] = (z == 0.0) ? 0.0 : -5.0*t*log(z)*p*z; 91 95 } … … 172 176 173 177 // make an initial guess for parameters 178 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 174 179 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 175 180 { … … 196 201 if (!isfinite(shape.sxy)) return false; 197 202 198 PAR[PM_PAR_SKY] = moments->Sky;203 PAR[PM_PAR_SKY] = 0.0; 199 204 PAR[PM_PAR_I0] = peak->flux; 200 205 PAR[PM_PAR_XPOS] = peak->xf; … … 276 281 // choose a z value guaranteed to be beyond our limit 277 282 float z0 = pow((1.0 / limit), (1.0 / PAR[PM_PAR_7])); 283 psAssert (isfinite(z0), "fix this code: z0 should not be nan for %f", PAR[PM_PAR_7]); 278 284 float z1 = (1.0 / limit); 285 psAssert (isfinite(z1), "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]); 279 286 z1 = PS_MAX (z0, z1); 280 287 z0 = 0.0; … … 402 409 bool PM_MODEL_FIT_STATUS (pmModel *model) 403 410 { 404 405 psF32 dP;406 411 bool status; 407 412 … … 409 414 psF32 *dPAR = model->dparams->data.F32; 410 415 411 dP = 0;412 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);413 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);414 dP = sqrt (dP);415 416 416 status = true; 417 status &= (dP < 0.5);418 417 status &= (PAR[PM_PAR_I0] > 0); 419 418 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
Note:
See TracChangeset
for help on using the changeset viewer.
