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/pmPSFtry.c

    r21183 r23989  
    211211
    212212    if (Next == 0) {
    213         psError(PS_ERR_UNKNOWN, true, "No sources with good extended fits from which to determine PSF.");
     213        psError(PS_ERR_UNKNOWN, false, "No sources with good extended fits from which to determine PSF.");
    214214        psFree(psfTry);
    215215        return NULL;
     
    282282
    283283    if (Npsf == 0) {
    284         psError(PS_ERR_UNKNOWN, true, "No sources with good PSF fits after model is built.");
     284        psError(PS_ERR_UNKNOWN, false, "No sources with good PSF fits after model is built.");
    285285        psFree(psfTry);
    286286        return NULL;
     
    643643        }
    644644        if (entryMin == -1) {
    645             psError (PS_ERR_UNKNOWN, true, "failed to find image map for shape params");
     645            psError (PS_ERR_UNKNOWN, false, "failed to find image map for shape params");
    646646            return false;
    647647        }
     
    958958    float dEsquare = 0.0;
    959959    psStatsInit (stats);
    960     psVectorStats (stats, e0res, NULL, mask, maskValue);
     960    if (!psVectorStats (stats, e0res, NULL, mask, maskValue)) {
     961        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     962        return false;
     963    }
    961964    dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
    962965
    963966    psStatsInit (stats);
    964     psVectorStats (stats, e1res, NULL, mask, maskValue);
     967    if (!psVectorStats (stats, e1res, NULL, mask, maskValue)) {
     968        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     969        return false;
     970    }
    965971    dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
    966972
    967973    psStatsInit (stats);
    968     psVectorStats (stats, e2res, NULL, mask, maskValue);
     974    if (!psVectorStats (stats, e2res, NULL, mask, maskValue)) {
     975        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     976        return false;
     977    }
    969978    dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
    970979
     
    10181027        float dEsquare = 0.0;
    10191028        psStatsInit (statsS);
    1020         psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff);
     1029        if (!psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff)) {
     1030        }
    10211031        dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
    10221032
    10231033        psStatsInit (statsS);
    1024         psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff);
    1025         dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
     1034        if (!psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff)) {
     1035            psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     1036            return false;
     1037        }       
     1038        dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
    10261039
    10271040        psStatsInit (statsS);
    1028         psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff);
     1041        if (!psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff)) {
     1042            psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     1043            return false;
     1044        }
    10291045        dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
    10301046
Note: See TracChangeset for help on using the changeset viewer.