IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2008, 2:38:23 PM (18 years ago)
Author:
Paul Price
Message:

In one case, all of dE0subset were the same value (3.81469727e-06), so
the stdev was NAN. Trap and ignore this case.

File:
1 edited

Legend:

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

    r19103 r19474  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-08-18 00:40:47 $
     7 *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2008-09-11 00:38:23 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    802802    int nBin = PS_MAX (mag->n / nGroup, 1);
    803803
    804     // output vectors for ApResid trend
    805     psVector *dSo = psVectorAlloc (nBin, PS_TYPE_F32);
    806 
    807804    // use mag to group parameters in sequence
    808805    psVector *index = psVectorSortIndex (NULL, mag);
     
    815812
    816813    int n = 0;
    817     for (int i = 0; i < dSo->n; i++) {
     814    float min = INFINITY;               // Minimum error
     815    for (int i = 0; i < nBin; i++) {
    818816        int j;
    819817        for (j = 0; (j < nGroup) && (n < mag->n); j++, n++) {
     
    844842        dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
    845843
    846         dSo->data.F32[i] = sqrt(dEsquare);
     844        if (isfinite(dEsquare)) {
     845            float err = sqrtf(dEsquare);
     846            if (err < min) {
     847                min = err;
     848            }
     849        }
    847850    }
    848851    psFree (dE0subset);
     
    851854    psFree (mkSubset);
    852855
    853     psStats *minStats = psStatsAlloc(PS_STAT_MIN);
    854     psVectorStats(minStats, dSo, NULL, NULL, 0);
    855     *errorFloor = minStats->min;
    856     psFree(minStats);
    857 
    858856    psFree(index);
    859     psFree (dSo);
    860 
    861     psFree (statsS);
     857
     858    psFree(statsS);
    862859
    863860    return true;
Note: See TracChangeset for help on using the changeset viewer.