IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12608


Ignore:
Timestamp:
Mar 27, 2007, 2:49:13 PM (19 years ago)
Author:
magnier
Message:

added 2 trace lines, changed BIN_FOR_VALUE calls to saturate on correct edge

File:
1 edited

Legend:

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

    r12495 r12608  
    1313 * use ->min and ->max (PS_STAT_USE_RANGE)
    1414 *
    15  *  @version $Revision: 1.204 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2007-03-19 22:48:11 $
     15 *  @version $Revision: 1.205 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-03-28 00:49:13 $
    1717 *
    1818 *  Copyright 2006 IfA, University of Hawaii
     
    746746        // ADD step 4: Find the bins which contains the 15.8655% (-1 sigma) and 84.1345% (+1 sigma) data points
    747747        // also find the 30.8538% (-0.5 sigma) and 69.1462% (+0.5 sigma) points
    748         PS_BIN_FOR_VALUE(binLo, cumulative->nums, totalDataPoints * 0.158655f, -1);
    749         PS_BIN_FOR_VALUE(binHi, cumulative->nums, totalDataPoints * 0.841345f, +1);
    750 
    751         PS_BIN_FOR_VALUE(binL2, cumulative->nums, totalDataPoints * 0.308538f, -1);
    752         PS_BIN_FOR_VALUE(binH2, cumulative->nums, totalDataPoints * 0.691462f, +1);
     748        PS_BIN_FOR_VALUE(binLo, cumulative->nums, totalDataPoints * 0.158655f, 0);
     749        PS_BIN_FOR_VALUE(binHi, cumulative->nums, totalDataPoints * 0.841345f, 0);
     750        PS_BIN_FOR_VALUE(binL2, cumulative->nums, totalDataPoints * 0.308538f, 0);
     751        PS_BIN_FOR_VALUE(binH2, cumulative->nums, totalDataPoints * 0.691462f, 0);
    753752
    754753        psTrace("psLib.math", 6, "The 15.8655%% and 84.1345%% data point bins are (%ld, %ld).\n",
     
    756755        psTrace("psLib.math", 6, "binLo midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binLo));
    757756        psTrace("psLib.math", 6, "binHi midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binHi));
     757        psTrace("psLib.math", 6, "binL2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binL2));
     758        psTrace("psLib.math", 6, "binH2 midpoint is %f\n", PS_BIN_MIDPOINT(cumulative, binH2));
    758759
    759760        if ((binLo < 0) || (binHi < 0)) {
     
    988989        // select the min and max bins, saturating on the lower and upper end-points
    989990        long binMin, binMax;
    990         PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1);
    991         PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1);
     991        PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0);
     992        PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0);
    992993
    993994        // Generate the variables that will be used in the Gaussian fitting
     
    11661167        // select the min and max bins, saturating on the lower and upper end-points
    11671168        long binMin, binMax;
    1168         PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1);
    1169         PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1);
     1169        PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0);
     1170        PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0);
    11701171
    11711172        // Generate the variables that will be used in the Gaussian fitting
     
    13591360        // select the min and max bins, saturating on the lower and upper end-points
    13601361        long binMin, binMax;
    1361         PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, -1);
    1362         PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, +1);
     1362        PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0);
     1363        PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0);
     1364        if (binMin == binMax) {
     1365            psAbort ("invalid range for fitted mean");   
     1366        }
    13631367
    13641368        // search for mode (peak of histogram within range mean-2sigma - mean+2sigma
Note: See TracChangeset for help on using the changeset viewer.