Changeset 13426 for trunk/psModules/src/objects/pmPSF.c
- Timestamp:
- May 18, 2007, 4:08:34 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSF.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSF.c
r13064 r13426 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 4-27 22:14:08$8 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-05-18 14:08:34 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 #include "pmFPAMaskWeight.h" 37 37 #include "psVectorBracket.h" 38 #include "pmErrorCodes.h" 38 39 39 40 /*****************************************************************************/ … … 178 179 179 180 // set model parameters for this source based on PSF information 180 modelFromPSFFunc (modelPSF, modelEXT, psf); 181 if (!modelFromPSFFunc (modelPSF, modelEXT, psf)) { 182 psError(PM_ERR_PSF, true, "Failed to set model params from PSF"); 183 psFree(modelPSF); 184 return NULL; 185 } 186 // XXX note that model->residuals is just a reference 187 modelPSF->residuals = psf->residuals; 181 188 182 189 return (modelPSF); … … 248 255 pol.e2 = fittedPar[PM_PAR_E2]; 249 256 250 psEllipseAxes axes = psEllipsePolToAxes (pol, minMinorAxis); 257 psEllipseAxes axes; 258 if (psEllipsePolToAxes (pol, minMinorAxis, &axes) != PS_ERR_NONE) { 259 psError(PM_ERR_PSF, false, "Failed to convert e[012] (%g,%g,%g) to axes", 260 pol.e0, pol.e1, pol.e2); 261 return false; 262 } 251 263 psEllipseShape shape = psEllipseAxesToShape (axes); 252 264 … … 519 531 // no need to interpolate since we have forced the object center 520 532 // to 0.5, 0.5 above 533 bool completeGrowthCurve = true; // do we have a complete curve of growth? 521 534 for (int i = 0; i < psf->growth->radius->n; i++) { 522 535 … … 525 538 // mask the given aperture and measure the apMag 526 539 psImageKeepCircle (mask, xc, yc, radius, "OR", PM_MASK_MARK); 527 pmSourcePhotometryAper (&apMag, model, image, mask); 540 if (!pmSourcePhotometryAper (&apMag, model, image, mask)) { 541 psError(PM_ERR_PHOTOM, false, "Measuring apMag for radius == %g", radius); 542 completeGrowthCurve = false; 543 break; 544 } 528 545 529 546 // XXX since we re-mask on each pass, this could be dropped. … … 538 555 } 539 556 540 psf->growth->apRef = psVectorInterpolate (psf->growth->radius, psf->growth->apMag, psf->growth->refRadius); 541 psf->growth->apLoss = psf->growth->fitMag - psf->growth->apRef; 557 if (completeGrowthCurve) { 558 psf->growth->apRef = psVectorInterpolate (psf->growth->radius, psf->growth->apMag, psf->growth->refRadius); 559 psf->growth->apLoss = psf->growth->fitMag - psf->growth->apRef; 560 } else { 561 psf->growth->apRef = NAN; 562 psf->growth->apLoss = 0; 563 } 542 564 543 565 psLogMsg ("psphot.growth", 4, "GrowthCurve : apLoss : %f\n", psf->growth->apLoss); … … 549 571 psFree (modelRef); 550 572 551 return true;552 } 573 return completeGrowthCurve ? true : false; 574 }
Note:
See TracChangeset
for help on using the changeset viewer.
