Changeset 35768 for trunk/psModules/src/objects/models/pmModel_PS1_V1.c
- Timestamp:
- Jul 3, 2013, 2:37:22 PM (13 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/models/pmModel_PS1_V1.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130509/psModules (added) merged: 35594,35613,35628,35638-35639,35643-35648,35653,35657,35662,35750
- Property svn:mergeinfo changed
-
trunk/psModules/src/objects/models/pmModel_PS1_V1.c
r35560 r35768 1 1 /****************************************************************************** 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: 2 * this file defines the PS1_V1 source shape model. Note that these model functions are 3 * loaded by pmModelClass.c using 'include', and thus need no 'include' statements of 4 * their own. The models use a psVector to represent the set of parameters, with the 5 * 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 as a 7 * PSF representations share a few parameters, for which # define names are listed in 8 * pmModel.h: 8 9 9 10 power-law with fitted linear term … … 148 149 float q2 = NAN; 149 150 if (nParam == PM_PAR_SXY) { 150 float f1 = 1.0 / PS_SQR(params[PM_PAR_SYY]) + 1.0 / PS_SQR(params[PM_PAR_SXX]);151 float f2 = 1.0 / PS_SQR(params[PM_PAR_SYY]) - 1.0 / PS_SQR(params[PM_PAR_SXX]);151 float f1 = 2.0 / PS_SQR(params[PM_PAR_SYY]) + 2.0 / PS_SQR(params[PM_PAR_SXX]); 152 float f2 = 2.0 / PS_SQR(params[PM_PAR_SYY]) - 2.0 / PS_SQR(params[PM_PAR_SXX]); 152 153 float q1 = PS_SQR(f1)*AR_RATIO - PS_SQR(f2); 153 154 q1 = (q1 < 0.0) ? 0.0 : q1; … … 220 221 221 222 // set the shape parameters 222 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments )) {223 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 223 224 return false; 224 225 } … … 244 245 { 245 246 float z, norm; 246 psEllipseShape shape;247 247 248 248 psF32 *PAR = params->data.F32; 249 249 250 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 251 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 252 shape.sxy = PAR[PM_PAR_SXY]; 253 254 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 250 psEllipseAxes axes; 251 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 255 252 float AspectRatio = axes.minor / axes.major; 256 253 … … 284 281 { 285 282 psF64 z; 286 psEllipseShape shape;287 283 288 284 psF32 *PAR = params->data.F32; … … 292 288 if (flux >= PAR[PM_PAR_I0]) return 1.0; 293 289 294 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 295 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 296 shape.sxy = PAR[PM_PAR_SXY]; 297 298 psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0); 290 psEllipseAxes axes; 291 pmModelParamsToAxes (&axes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], false); 299 292 psF64 sigma = axes.major; 300 293 … … 363 356 // the 2D PSF model fits polarization terms (E0,E1,E2) 364 357 // convert to shape terms (SXX,SYY,SXY) 365 if (!pmPSF_FitToModel (out, 0.1)) { 358 bool useReff = pmModelUseReff (modelPSF->type); 359 if (!pmPSF_FitToModel (out, 0.1, useReff)) { 366 360 psTrace("psModules.objects", 5, "Failed to fit object at (r,c) = (%.1f,%.1f)", in[PM_PAR_YPOS], in[PM_PAR_XPOS]); 367 361 return false; … … 416 410 // convert to shape terms (SXX,SYY,SXY) 417 411 // XXX user-defined value for limit? 418 if (!pmPSF_FitToModel (PAR, 0.1)) { 412 bool useReff = pmModelUseReff (model->type); 413 if (!pmPSF_FitToModel (PAR, 0.1, useReff)) { 419 414 psTrace ("psModules.objects", 3, "Failed to fit object at (r,c) = (%.1f,%.1f)", Xo, Yo); 420 415 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
