Changeset 6283 for trunk/psLib/test/imageops/tst_psImageStats.c
- Timestamp:
- Feb 1, 2006, 11:44:36 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/imageops/tst_psImageStats.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tst_psImageStats.c
r6280 r6283 29 29 30 30 testDescription tests[] = { 31 {testPsImageHistogram, 0, "psImageHistogram", 0, true},31 {testPsImageHistogram, 0, "psImageHistogram", 0, false}, 32 32 {testPsImageStats, 1, "psImageStats", 0, false}, 33 {testPsImageFitPolynomial, 2, "psImageFitPolynomial", 0, true},34 {testPsImagePixelInterpolate, 3, "psImagePixelInterpolate", 0, true},35 {testPsImageEvalPolynom, 4, "psImageEvalPolynom()", 0, true},36 {testImageCountPixel, 5, "psImageCountPixel", 0, true},33 {testPsImageFitPolynomial, 2, "psImageFitPolynomial", 0, false}, 34 {testPsImagePixelInterpolate, 3, "psImagePixelInterpolate", 0, false}, 35 {testPsImageEvalPolynom, 4, "psImageEvalPolynom()", 0, false}, 36 {testImageCountPixel, 5, "psImageCountPixel", 0, false}, 37 37 {NULL} 38 38 }; … … 220 220 } 221 221 222 // HEY: XXX223 222 static psS32 testPsImageFitPolynomial() 224 223 { … … 638 637 } 639 638 640 int trentBug()641 {642 psTraceSetLevel("p_psVectorRobustStats", 6);643 psTraceSetLevel("vectorBinDisectF32", 6);644 645 psFits *fits = psFitsOpen("f0230_c01_606365_12k_i.fits", "r");646 psRegion region = {0, 0, 0, 0};647 psImage *image = psFitsReadImage(NULL, fits, region, 0);648 psFitsClose(fits);649 int numNaN = psImageClipNaN(image, 0.0);650 printf("Clipped %d NaN pixels.\n", numNaN);651 652 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);653 stats->clipSigma = 2;654 stats->clipIter = 5;655 stats = psImageStats(stats, image, NULL, 0);656 657 printf("%lf %lf\n", stats->robustMedian, stats->robustStdev);658 psFree(image);659 psFree(stats);660 661 return(0);662 }663 664 665 639 static psS32 testPsImageStats() 666 640 { 667 trentBug();668 return(0);669 670 641 psTraceSetLevel("p_psVectorRobustStats", 0); 671 642 … … 764 735 } 765 736 766 //HEY 767 // myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN ); 768 myStats = psStatsAlloc( PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV | PS_STAT_ROBUST_QUARTILE | PS_STAT_FITTED_MEAN | PS_STAT_FITTED_STDEV ); 737 myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN ); 738 // myStats = psStatsAlloc( PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV | PS_STAT_ROBUST_QUARTILE | PS_STAT_FITTED_MEAN | PS_STAT_FITTED_STDEV ); 769 739 /*************************************************************************/ 770 740 /* Calculate Sample Mean with no mask */ … … 776 746 psAbort(__func__,"Failed input psStats equal to returned psStats"); 777 747 } 778 // fprintf(stderr, "The sample mean was %.2f\n", myStats->sampleMean ); 779 fprintf(stderr, "The fitted mean was %.2f\n", myStats->fittedMean ); 748 fprintf(stderr, "The sample mean was %.2f\n", myStats->sampleMean ); 780 749 781 750 /*************************************************************************/ … … 787 756 fprintf(stderr,"TEST ERROR: psImageStats() returned NULL.\n"); 788 757 } else { 789 // fprintf(stderr, "The fitted mean was %.2f\n", myStats->fittedMean ); 790 fprintf(stderr, "The fitted mean was %.2f\n", myStats->fittedMean ); 758 fprintf(stderr, "The sample mean was %.2f\n", myStats->sampleMean ); 791 759 } 792 760 … … 839 807 } 840 808 841 842 843 844 845 //This code will
Note:
See TracChangeset
for help on using the changeset viewer.
