IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2009, 11:21:56 AM (17 years ago)
Author:
eugene
Message:

always handle psVectorStats false return status (is an error); check for NAN results and handle as possible

File:
1 edited

Legend:

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

    r23187 r23989  
    479479        stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);
    480480
    481         psVectorStats (stats, tmpSx, NULL, NULL, 0);
     481        if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) {
     482            psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats");
     483            return (emptyClump);
     484        }
    482485        psfClump.X  = stats->clippedMean;
    483486        psfClump.dX = stats->clippedStdev;
    484487
    485         psVectorStats (stats, tmpSy, NULL, NULL, 0);
     488        if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) {
     489            psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats");
     490            return (emptyClump);
     491        }
    486492        psfClump.Y  = stats->clippedMean;
    487493        psfClump.dY = stats->clippedStdev;
     
    636642
    637643        if (!psVectorStats (stats, starsn_moments, NULL, NULL, 0)) {
    638             // Don't care about this error
    639             psErrorClear();
     644            psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats");
     645            psFree (stats);
     646            psFree (starsn_peaks);
     647            return false;
    640648        }
    641649        psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats->min, stats->max);
     
    648656        stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
    649657        if (!psVectorStats (stats, starsn_peaks, NULL, NULL, 0)) {
    650             // Don't care about this error
    651             psErrorClear();
     658            psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats");
     659            psFree (stats);
     660            psFree (starsn_peaks);
     661            return false;
    652662        }
    653663        psLogMsg ("psModules.objects", 3, "SN range (peaks)  : %f - %f (%ld)\n",
Note: See TracChangeset for help on using the changeset viewer.