Changeset 17998 for trunk/psModules/src/objects/pmSourcePhotometry.c
- Timestamp:
- Jun 8, 2008, 2:43:46 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourcePhotometry.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourcePhotometry.c
r17396 r17998 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2008-0 4-08 18:35:38$5 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-06-09 00:43:46 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 246 246 if (!status) { 247 247 psTrace ("psModules.objects", 3, "fail mag : bad Ap Mag"); 248 psErrorCode last = psErrorCodeLast();249 // XXX flag the object?250 if (last == PM_ERR_PHOTOM) {251 // the aper mag was undefined (flux < 0). bad object, but252 // don't keep the error on the stack253 psErrorClear();254 }255 248 } 256 249 257 250 // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS 258 if (status && isPSF && psf) { 251 // if the aper mag is NAN, the flux < 0. this can happen for sources near the 252 // detection limits (esp near bright neighbors) 253 if (isfinite (source->apMag) && isPSF && psf) { 259 254 if (psf->growth && (mode & PM_SOURCE_PHOT_GROWTH)) { 260 255 source->apMag += pmGrowthCurveCorrect (psf->growth, model->radiusFit); 261 256 } 262 257 if (mode & PM_SOURCE_PHOT_APCORR) { 263 rflux = pow (10.0, 0.4*source->psfMag);264 source->apMag-= PS_SQR(model->radiusFit)*rflux * psf->skyBias + psf->skySat / rflux;258 rflux = pow (10.0, 0.4*source->psfMag); 259 source->apMag -= PS_SQR(model->radiusFit)*rflux * psf->skyBias + psf->skySat / rflux; 265 260 } 266 261 } … … 343 338 } 344 339 if (apSum <= 0) { 345 psError(PM_ERR_PHOTOM, true, "apSum is negative");346 return false;340 *apMag = NAN; 341 return true; 347 342 } 348 343 349 344 *apMag = -2.5*log10(apSum); 350 return (true);345 return true; 351 346 } 352 347
Note:
See TracChangeset
for help on using the changeset viewer.
