- Timestamp:
- Sep 19, 2009, 8:49:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotEllipticalContour.c
r25433 r25452 5 5 psF32 psphotEllipticalContourFunc (psVector *deriv, const psVector *params, const psVector *coord); 6 6 7 bool psphotEllipticalContour (pmSource *source, pmPetrosian *petrosian) { 7 bool psphotEllipticalContour (pmSource *source) { 8 9 pmSourceRadialProfile *profile = source->extpars->profile; 8 10 9 11 // use LMM to fit theta vs radius to an ellipse 10 psVector *theta = p etrosian->theta;11 psVector *radius = p etrosian->isophotalRadii;12 psVector *theta = profile->theta; 13 psVector *radius = profile->isophotalRadii; 12 14 13 15 // find Rmin and Rmax for the initial guess … … 83 85 /// XXX rationalize? if epsilon > 1, flip major and minor axes (rotate by 90 degrees) 84 86 if (params->data.F32[PAR_EPSILON] < 1.0) { 85 p etrosian->axes.major = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON];86 p etrosian->axes.minor = params->data.F32[PAR_RMIN];87 p etrosian->axes.theta = params->data.F32[PAR_PHI];87 profile->axes.major = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON]; 88 profile->axes.minor = params->data.F32[PAR_RMIN]; 89 profile->axes.theta = params->data.F32[PAR_PHI]; 88 90 } else { 89 p etrosian->axes.major = params->data.F32[PAR_RMIN];90 p etrosian->axes.minor = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON];91 p etrosian->axes.theta = params->data.F32[PAR_PHI] + 0.5*M_PI;91 profile->axes.major = params->data.F32[PAR_RMIN]; 92 profile->axes.minor = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON]; 93 profile->axes.theta = params->data.F32[PAR_PHI] + 0.5*M_PI; 92 94 } 93 95 94 96 psTrace ("psphot", 4, "# fitted values:\n"); 95 psTrace ("psphot", 4, "Phi: %f\n", p etrosian->axes.theta*PS_DEG_RAD);96 psTrace ("psphot", 4, "Rmaj: %f\n", p etrosian->axes.major);97 psTrace ("psphot", 4, "Rmin: %f\n", p etrosian->axes.minor);97 psTrace ("psphot", 4, "Phi: %f\n", profile->axes.theta*PS_DEG_RAD); 98 psTrace ("psphot", 4, "Rmaj: %f\n", profile->axes.major); 99 psTrace ("psphot", 4, "Rmin: %f\n", profile->axes.minor); 98 100 99 101 // show the results
Note:
See TracChangeset
for help on using the changeset viewer.
