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/psastro/src/psastroFixChipsTest.c

    r21409 r23989  
    140140    psStats *stats;
    141141    stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    142     psVectorStats (stats, dX, NULL, NULL, 0);
     142    if (!psVectorStats (stats, dX, NULL, NULL, 0)) {
     143        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     144        return false;
     145    }
    143146    Xo = stats->robustMedian;
    144147    fprintf (stderr, "offset x: %f +/- %f\n", stats->robustMedian, stats->robustStdev);
     
    146149
    147150    stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    148     psVectorStats (stats, dY, NULL, NULL, 0);
     151    if (!psVectorStats (stats, dY, NULL, NULL, 0)) {
     152        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     153        return false;
     154    }
    149155    Yo = stats->robustMedian;
    150156    fprintf (stderr, "offset y: %f +/- %f\n", stats->robustMedian, stats->robustStdev);
     
    168174    }
    169175    stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    170     psVectorStats (stats, dT, NULL, NULL, 0);
     176    if (!psVectorStats (stats, dT, NULL, NULL, 0)) {
     177        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     178        return false;
     179    }
    171180    float To = stats->robustMedian;
    172181    fprintf (stderr, "offset t: %f +/- %f\n", stats->robustMedian, stats->robustStdev);
Note: See TracChangeset for help on using the changeset viewer.