IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 1, 2006, 12:41:33 PM (19 years ago)
Author:
magnier
Message:

fitted Mean now respects the binsize option

File:
1 edited

Legend:

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

    r10274 r10395  
    1616 * use ->min and ->max (PS_STAT_USE_RANGE)
    1717 *
    18  *  @version $Revision: 1.191 $ $Name: not supported by cvs2svn $
    19  *  @date $Date: 2006-11-29 17:55:25 $
     18 *  @version $Revision: 1.192 $ $Name: not supported by cvs2svn $
     19 *  @date $Date: 2006-12-01 22:41:33 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    10901090    tmpScalar.type.type = PS_TYPE_F32;
    10911091
    1092     // construct a histogram with (sigma/10 < binsize < sigma)
    1093     // set roughly so that the lowest bins have about 2 cnts
    1094     // Nsmallest ~ N50 / (4*dN))
    1095     psF32 dN = PS_MAX (1, PS_MIN (10, stats->robustN50 / 8));
    1096     psF32 newBinSize = stats->fittedStdev / dN;
     1092    psF32 binSize = 1;
     1093    if (stats->options & PS_STAT_USE_BINSIZE) {
     1094        // Set initial bin size to the specified value.
     1095        binSize = stats->binsize;
     1096        psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize);
     1097    } else {
     1098        // construct a histogram with (sigma/10 < binsize < sigma)
     1099        // set roughly so that the lowest bins have about 2 cnts
     1100        // Nsmallest ~ N50 / (4*dN))
     1101        psF32 dN = PS_MAX (1, PS_MIN (10, stats->robustN50 / 8));
     1102        binSize = stats->fittedStdev / dN;
     1103    }
    10971104
    10981105    // Determine the min/max of the vector (which prior outliers masked out)
     
    11081115
    11091116    // Calculate the number of bins.
    1110     long numBins = (max - min) / newBinSize;
     1117    long numBins = (max - min) / binSize;
    11111118    psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max);
    1112     psTrace("psLib.math", 6, "The new bin size is %f.\n", newBinSize);
     1119    psTrace("psLib.math", 6, "The new bin size is %f.\n", binSize);
    11131120    psTrace("psLib.math", 6, "The numBins is %ld\n", numBins);
    11141121
Note: See TracChangeset for help on using the changeset viewer.