Changeset 12691
- Timestamp:
- Mar 29, 2007, 4:53:26 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r12608 r12691 13 13 * use ->min and ->max (PS_STAT_USE_RANGE) 14 14 * 15 * @version $Revision: 1.20 5$ $Name: not supported by cvs2svn $16 * @date $Date: 2007-03- 28 00:49:13$15 * @version $Revision: 1.206 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2007-03-30 02:53:26 $ 17 17 * 18 18 * Copyright 2006 IfA, University of Hawaii … … 223 223 vectorMinMax(myVector, maskVector, maskVal, stats): calculates the minimum and maximum of the input vector. 224 224 If there was a problem with the calculation, this routine sets stats->max and stats->min to NAN. Return the 225 number of valid values in the vector (those not masked or outside the specified range .225 number of valid values in the vector (those not masked or outside the specified range). 226 226 XXX : using the method below, with a single loop for various options 227 227 costs only a small amount and is much easier to debug. running 10000 tests … … 393 393 if (isnan(stats->sampleMean)) { 394 394 stats->sampleStdev = NAN; 395 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: vectorSampleStdev(): vectorSampleMean() reported a NAN mean.\n");395 psWarning("WARNING: vectorSampleStdev(): vectorSampleMean() reported a NAN mean.\n"); 396 396 psTrace("psLib.math", 4, "---- %s() end ----\n", __func__); 397 397 return false; … … 429 429 if (count == 0) { 430 430 stats->sampleStdev = NAN; 431 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: vectorSampleStdev(): no valid psVector elements (%ld). Setting stats->sampleStdev = NAN.\n", count);431 psWarning("WARNING: vectorSampleStdev(): no valid psVector elements (%ld). Setting stats->sampleStdev = NAN.\n", count); 432 432 return false; 433 433 } 434 434 if (count == 1) { 435 435 stats->sampleStdev = 0.0; 436 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: vectorSampleStdev(): only one valid psVector elements (%ld). Setting stats->sampleStdev = 0.0.\n", count);436 psWarning("WARNING: vectorSampleStdev(): only one valid psVector elements (%ld). Setting stats->sampleStdev = 0.0.\n", count); 437 437 return false; 438 438 } … … 502 502 vectorSampleMedian(myVector, tmpMask, maskVal, stats); 503 503 if (isnan(stats->sampleMedian)) { 504 ps LogMsg(__func__, PS_LOG_WARN,"Call to vectorSampleMedian returned NAN\n");504 psWarning("Call to vectorSampleMedian returned NAN\n"); 505 505 psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__); 506 506 psFree(tmpMask); … … 512 512 vectorSampleStdev(myVector, errors, tmpMask, maskVal, stats); 513 513 if (isnan(stats->sampleStdev)) { 514 ps LogMsg(__func__, PS_LOG_WARN,"Call to vectorSampleStdev returned NAN\n");514 psWarning("Call to vectorSampleStdev returned NAN\n"); 515 515 psTrace("psLib.math", 4, "---- %s(false) end ----\n", __func__); 516 516 psFree(tmpMask); … … 1362 1362 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0); 1363 1363 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0); 1364 if (binMin == binMax) {1365 psAbort ("invalid range for fitted mean"); 1366 }1364 if (binMin == binMax) { 1365 psAbort ("invalid range for fitted mean"); 1366 } 1367 1367 1368 1368 // search for mode (peak of histogram within range mean-2sigma - mean+2sigma … … 1557 1557 // However, it is also not used anywhere, yet. 1558 1558 // 1559 ps LogMsg(__func__, PS_LOG_WARN,"WARNING: vectorSmoothHistGaussian() on non-uniform histograms has not been tested or used.\n");1559 psWarning("WARNING: vectorSmoothHistGaussian() on non-uniform histograms has not been tested or used.\n"); 1560 1560 1561 1561 for (long i = 0; i < numBins; i++) { … … 1923 1923 psStatsOptions option = psStatsOptionFromString(statString); 1924 1924 if (option == 0) { 1925 ps LogMsg(__func__, PS_LOG_WARN,"Unable to interpret statistic option: %s --- ignored.\n",1925 psWarning("Unable to interpret statistic option: %s --- ignored.\n", 1926 1926 statString); 1927 1927 continue;
Note:
See TracChangeset
for help on using the changeset viewer.
