Changeset 36238
- Timestamp:
- Oct 25, 2013, 3:49:50 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r36237 r36238 1048 1048 1049 1049 1050 #if ( 0)1050 #if (CZW) 1051 1051 printf("CZW: bad sigma?: %f %f %f %f %f %f %f %f %f %f\n", 1052 1052 binH2F32,binL2F32,binHiF32,binLoF32,binH4F32,binL4F32, … … 1289 1289 // XXX can we calculate the binMin, binMax **before** building this histogram? 1290 1290 // if the range is too absurd, adjust numBins & binSize 1291 // We no longer want to reset the binSize here, as it can cause odd things. Better to select 1292 // a number of bins, and then set the min/max values to put those bins sanely around the mean. 1291 1293 long numBins = PS_MAX (50, PS_MIN (10000, (max - min) / binSize)); 1292 binSize = (max - min) / (float) numBins;1294 // binSize = (max - min) / (float) numBins; 1293 1295 psTrace(TRACE, 6, "The new min/max values are (%f, %f).\n", min, max); 1294 1296 psTrace(TRACE, 6, "The new bin size is %f.\n", binSize); … … 1296 1298 1297 1299 1300 #define FITTED_CLIPPING_NUM 5.0 1301 if (min < guessMean - FITTED_CLIPPING_NUM * guessStdev) { 1302 min = guessMean - FITTED_CLIPPING_NUM * guessStdev; 1303 } 1304 if (max > guessMean + FITTED_CLIPPING_NUM * guessStdev) { 1305 max = guessMean + FITTED_CLIPPING_NUM * guessStdev; 1306 } 1307 1298 1308 psHistogram *histogram = psHistogramAlloc(min, max, numBins); // A new histogram (without outliers) 1299 1309 if (!psVectorHistogram(histogram, myVector, errors, mask, maskVal)) { … … 1330 1340 PS_BIN_FOR_VALUE (binMin, histogram->bounds, guessMean - minFitSigma*guessStdev, 0); 1331 1341 PS_BIN_FOR_VALUE (binMax, histogram->bounds, guessMean + maxFitSigma*guessStdev, 0); 1342 1332 1343 if (binMin == binMax) { 1333 1344 COUNT_WARNING(10, 100, "Failed to calculate the min/max of the input vector.\n"); … … 1356 1367 psTrace(TRACE, 6, "The clipped peak value is %f\n", histogram->nums->data.F32[binPeak]); 1357 1368 1369 1358 1370 float lowfitMean = NAN; 1359 1371 float lowfitStdev = NAN;
Note:
See TracChangeset
for help on using the changeset viewer.
