Changeset 25754 for trunk/psModules/src/objects/models/pmModel_QGAUSS.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_QGAUSS.c
r25738 r25754 1 1 /****************************************************************************** 2 2 * this file defines the QGAUSS 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 … … 38 38 # define PM_MODEL_FIT_STATUS pmModelFitStatus_QGAUSS 39 39 # define PM_MODEL_SET_LIMITS pmModelSetLimits_QGAUSS 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 40 44 41 45 // Lax parameter limits … … 178 182 179 183 // make an initial guess for parameters 184 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 180 185 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 181 186 { … … 202 207 if (!isfinite(shape.sxy)) return false; 203 208 204 // XXX turn this off here for now PAR[PM_PAR_SKY] = moments->Sky;205 209 PAR[PM_PAR_SKY] = 0.0; 206 210 PAR[PM_PAR_I0] = peak->flux; … … 283 287 // choose a z value guaranteed to be beyond our limit 284 288 float z0 = pow((1.0 / limit), (1.0 / 2.25)); 289 psAssert (isfinite(z0), "fix this code: z0 should not be nan for %f", PAR[PM_PAR_7]); 285 290 float z1 = (1.0 / limit) / PAR[PM_PAR_7]; 291 psAssert (isfinite(z1), "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]); 286 292 z1 = PS_MAX (z0, z1); 287 293 z0 = 0.0; … … 409 415 bool PM_MODEL_FIT_STATUS (pmModel *model) 410 416 { 411 412 psF32 dP;413 417 bool status; 414 418 … … 416 420 psF32 *dPAR = model->dparams->data.F32; 417 421 418 dP = 0;419 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);420 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);421 dP = sqrt (dP);422 423 422 status = true; 424 // status &= (dP < 0.5);425 423 status &= (PAR[PM_PAR_I0] > 0); 426 424 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5);
Note:
See TracChangeset
for help on using the changeset viewer.
