IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 17, 2006, 5:10:06 PM (20 years ago)
Author:
Paul Price
Message:

Adding check for NAN data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psStats.c

    r7132 r7139  
    1616 * use ->min and ->max (PS_STAT_USE_RANGE)
    1717 *
    18  *  @version $Revision: 1.172 $ $Name: not supported by cvs2svn $
    19  *  @date $Date: 2006-05-18 01:20:50 $
     18 *  @version $Revision: 1.173 $ $Name: not supported by cvs2svn $
     19 *  @date $Date: 2006-05-18 03:10:06 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    20412041        // We want a copy of the mask, since we may change values
    20422042        maskU8 = psVectorCopy(NULL, mask, PS_TYPE_U8);
    2043     }
    2044 
     2043    } else {
     2044        maskU8 = psVectorAlloc(in->n, PS_TYPE_U8);
     2045        maskU8->n = in->n;
     2046        memset(maskU8->data.U8, 0, in->n * sizeof(psU8));
     2047    }
     2048
     2049    // Mask bad data
     2050    for (long i = 0; i < inF32->n; i++) {
     2051        if (!isfinite(inF32->data.F32[i])) {
     2052            maskU8->data.U8[i] = 0xff;
     2053        }
     2054    }
    20452055
    20462056    if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) {
Note: See TracChangeset for help on using the changeset viewer.