Changeset 25351
- Timestamp:
- Sep 13, 2009, 4:49:08 PM (17 years ago)
- Location:
- branches/eam_branches/20090715/psModules/src/objects/models
- Files:
-
- 6 edited
-
pmModel_GAUSS.c (modified) (5 diffs)
-
pmModel_PGAUSS.c (modified) (6 diffs)
-
pmModel_PS1_V1.c (modified) (6 diffs)
-
pmModel_QGAUSS.c (modified) (6 diffs)
-
pmModel_RGAUSS.c (modified) (7 diffs)
-
pmModel_SERSIC.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_GAUSS.c
r25303 r25351 1 1 /****************************************************************************** 2 2 * this file defines the GAUSS 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 … … 192 192 193 193 // make an initial guess for parameters 194 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 194 195 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 195 196 { … … 207 208 psEllipseShape shape = psEllipseAxesToShape (axes); 208 209 209 PAR[PM_PAR_SKY] = moments->Sky;210 PAR[PM_PAR_SKY] = 0.0; 210 211 PAR[PM_PAR_I0] = peak->flux; 211 212 PAR[PM_PAR_XPOS] = peak->xf; … … 369 370 bool PM_MODEL_FIT_STATUS (pmModel *model) 370 371 { 371 psF32 dP;372 372 bool status; 373 373 … … 375 375 psF32 *dPAR = model->dparams->data.F32; 376 376 377 dP = 0;378 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);379 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);380 dP = sqrt (dP);381 382 377 status = true; 383 status &= (dP < 0.5);384 378 status &= (PAR[PM_PAR_I0] > 0); 385 379 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); 386 380 387 if (status) 388 return true; 389 return false; 381 return status; 390 382 } 391 383 -
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PGAUSS.c
r20001 r25351 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 … … 29 29 30 30 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 31 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 32 // values need to be pixel coords 31 33 psF32 PM_MODEL_FUNC(psVector *deriv, 32 34 const psVector *params, … … 191 193 192 194 // make an initial guess for parameters 195 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 193 196 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 194 197 { … … 205 208 psEllipseShape shape = psEllipseAxesToShape (axes); 206 209 207 PAR[PM_PAR_SKY] = moments->Sky;210 PAR[PM_PAR_SKY] = 0.0; 208 211 PAR[PM_PAR_I0] = peak->flux; 209 212 PAR[PM_PAR_XPOS] = peak->xf; … … 415 418 bool PM_MODEL_FIT_STATUS (pmModel *model) 416 419 { 417 psF32 dP;418 420 bool status; 419 421 … … 421 423 psF32 *dPAR = model->dparams->data.F32; 422 424 423 dP = 0;424 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);425 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);426 dP = sqrt (dP);427 428 425 status = true; 429 status &= (dP < 0.5);430 426 status &= (PAR[PM_PAR_I0] > 0); 431 427 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); -
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PS1_V1.c
r23962 r25351 1 1 /****************************************************************************** 2 * this file defines the PS1_V1 source shape model (XXX need a better name!). Note that these3 * model functions are loaded by pmModelGroup.c using 'include', and thus need no 'include'4 * statements of their own. The models use a psVector to represent the set of parameters, with5 * the sequence used to specify the meaning of the parameter. The meaning of the parameters6 * may thus vary depending on the specifics of the model. All models which are used a PSF7 * representations share a fewparameters, for which # define names are listed in pmModel.h:2 * this file defines the PS1_V1 source shape model. Note that these model functions are loaded 3 * by pmModelClass.c using 'include', and thus need no 'include' statements of their own. The 4 * models use a psVector to represent the set of parameters, with the sequence used to specify 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 as a PSF representations share a few 7 * parameters, for which # define names are listed in pmModel.h: 8 8 9 9 power-law with fitted linear term … … 32 32 # define ALPHA_M 0.666 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, … … 216 219 217 220 // make an initial guess for parameters 221 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 218 222 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 219 223 { … … 240 244 if (!isfinite(shape.sxy)) return false; 241 245 242 // XXX turn this off here for now PAR[PM_PAR_SKY] = moments->Sky;243 246 PAR[PM_PAR_SKY] = 0.0; 244 247 PAR[PM_PAR_I0] = peak->flux; … … 448 451 bool PM_MODEL_FIT_STATUS (pmModel *model) 449 452 { 450 451 psF32 dP;452 453 bool status; 453 454 … … 455 456 psF32 *dPAR = model->dparams->data.F32; 456 457 457 dP = 0;458 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);459 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);460 dP = sqrt (dP);461 462 458 status = true; 463 // status &= (dP < 0.5);464 459 status &= (PAR[PM_PAR_I0] > 0); 465 460 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); -
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_QGAUSS.c
r20001 r25351 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 … … 29 29 # define PM_MODEL_FIT_STATUS pmModelFitStatus_QGAUSS 30 30 31 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 32 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 33 // values need to be pixel coords 31 34 psF32 PM_MODEL_FUNC (psVector *deriv, 32 35 const psVector *params, … … 213 216 214 217 // make an initial guess for parameters 218 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 215 219 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 216 220 { … … 237 241 if (!isfinite(shape.sxy)) return false; 238 242 239 // XXX turn this off here for now PAR[PM_PAR_SKY] = moments->Sky;240 243 PAR[PM_PAR_SKY] = 0.0; 241 244 PAR[PM_PAR_I0] = peak->flux; … … 444 447 bool PM_MODEL_FIT_STATUS (pmModel *model) 445 448 { 446 447 psF32 dP;448 449 bool status; 449 450 … … 451 452 psF32 *dPAR = model->dparams->data.F32; 452 453 453 dP = 0;454 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);455 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);456 dP = sqrt (dP);457 458 454 status = true; 459 // status &= (dP < 0.5);460 455 status &= (PAR[PM_PAR_I0] > 0); 461 456 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); -
branches/eam_branches/20090715/psModules/src/objects/models/pmModel_RGAUSS.c
r20001 r25351 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 … … 29 29 # define PM_MODEL_FIT_STATUS pmModelFitStatus_RGAUSS 30 30 31 // the model is a function of the pixel coordinate (pixcoord[0,1] = x,y) 32 // 0.5 PIX: the parameters are defined in terms of pixel coords, so the incoming pixcoords 33 // values need to be pixel coords 31 34 psF32 PM_MODEL_FUNC (psVector *deriv, 32 35 const psVector *params, … … 62 65 dPAR[PM_PAR_SXY] = -q*X*Y; 63 66 64 // this model derivative is undefined at z = 0.0, but is actually0.067 // this model derivative is undefined at z = 0.0, but the limit is zero as z -> 0.0 65 68 dPAR[PM_PAR_7] = (z == 0.0) ? 0.0 : -5.0*t*log(z)*p*z; 66 69 } … … 206 209 207 210 // make an initial guess for parameters 211 // 0.5 PIX: moments and peaks are in pixel coords, thus so are model parameters 208 212 bool PM_MODEL_GUESS (pmModel *model, pmSource *source) 209 213 { … … 230 234 if (!isfinite(shape.sxy)) return false; 231 235 232 PAR[PM_PAR_SKY] = moments->Sky;236 PAR[PM_PAR_SKY] = 0.0; 233 237 PAR[PM_PAR_I0] = peak->flux; 234 238 PAR[PM_PAR_XPOS] = peak->xf; … … 436 440 bool PM_MODEL_FIT_STATUS (pmModel *model) 437 441 { 438 439 psF32 dP;440 442 bool status; 441 443 … … 443 445 psF32 *dPAR = model->dparams->data.F32; 444 446 445 dP = 0;446 dP += PS_SQR(dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]);447 dP += PS_SQR(dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]);448 dP = sqrt (dP);449 450 447 status = true; 451 status &= (dP < 0.5);452 448 status &= (PAR[PM_PAR_I0] > 0); 453 449 status &= ((dPAR[PM_PAR_I0]/PAR[PM_PAR_I0]) < 0.5); -
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.
