IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2007, 2:15:51 PM (19 years ago)
Author:
eugene
Message:

handle errors in pmTrend2DEval

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourcePhotometry.c

    r15000 r15090  
    33 *  @author EAM, IfA; GLG, MHPCC
    44 *
    5  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-09-24 21:27:58 $
     5 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-09-29 00:15:51 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999    if (psf->FluxScale) {
    100100        double fluxScale = pmTrend2DEval (psf->FluxScale, x, y);
    101         if (isfinite(fluxScale) && (fluxScale > 0.0)) {
    102             source->psfMag = -2.5*log10(fluxScale * source->modelPSF->params->data.F32[PM_PAR_I0]);
     101        if (!isfinite(fluxScale)) {
     102            // XXX objects on the edge can be slightly outside -- if we get an
     103            // error, use the full fit.
     104            psErrorClear();
     105            status = pmSourcePhotometryModel (&source->psfMag, source->modelPSF);
    103106        } else {
    104             source->psfMag = NAN;
     107            if (isfinite(fluxScale) && (fluxScale > 0.0)) {
     108                source->psfMag = -2.5*log10(fluxScale * source->modelPSF->params->data.F32[PM_PAR_I0]);
     109            } else {
     110                source->psfMag = NAN;
     111            }
    105112        }
    106113    } else {
     
    214221        psTrace ("psModules.objects", 3, "fail mag : bad Ap Mag");
    215222        psErrorCode last = psErrorCodeLast();
     223        // XXX flag the object?
    216224        if (last == PM_ERR_PHOTOM) {
    217225            // the aper mag was undefined (flux < 0).  bad object, but
Note: See TracChangeset for help on using the changeset viewer.