IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15048


Ignore:
Timestamp:
Sep 27, 2007, 2:36:30 PM (19 years ago)
Author:
eugene
Message:

limit histogram to 10k bins

File:
1 edited

Legend:

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

    r14931 r15048  
    1313 * use ->min and ->max (PS_STAT_USE_RANGE)
    1414 *
    15  *  @version $Revision: 1.216 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2007-09-20 23:59:01 $
     15 *  @version $Revision: 1.217 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-09-28 00:36:30 $
    1717 *
    1818 *  Copyright 2006 IfA, University of Hawaii
     
    16971697        // Calculate the number of bins.
    16981698        // XXX can we calculate the binMin, binMax **before** building this histogram?
    1699         long numBins = (max - min) / binSize;
     1699        // if the range is too absurd, adjust numBins & binSize
     1700        long numBins = PS_MAX (5, PS_MIN (10000, (max - min) / binSize));
     1701        binSize = (max - min) / (float) numBins;
    17001702        psTrace(TRACE, 6, "The new min/max values are (%f, %f).\n", min, max);
    17011703        psTrace(TRACE, 6, "The new bin size is %f.\n", binSize);
Note: See TracChangeset for help on using the changeset viewer.