IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 1, 2006, 11:44:36 AM (20 years ago)
Author:
gusciora
Message:

....

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/tst_psImageStats.c

    r6280 r6283  
    2929
    3030testDescription tests[] = {
    31                               {testPsImageHistogram, 0, "psImageHistogram", 0, true},
     31                              {testPsImageHistogram, 0, "psImageHistogram", 0, false},
    3232                              {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},
    3737                              {NULL}
    3838                          };
     
    220220}
    221221
    222 // HEY: XXX
    223222static psS32 testPsImageFitPolynomial()
    224223{
     
    638637}
    639638
    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 
    665639static psS32 testPsImageStats()
    666640{
    667     trentBug();
    668     return(0);
    669 
    670641    psTraceSetLevel("p_psVectorRobustStats", 0);
    671642
     
    764735        }
    765736
    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 );
    769739        /*************************************************************************/
    770740        /*  Calculate Sample Mean with no mask                           */
     
    776746            psAbort(__func__,"Failed input psStats equal to returned psStats");
    777747        }
    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 );
    780749
    781750        /*************************************************************************/
     
    787756            fprintf(stderr,"TEST ERROR: psImageStats() returned NULL.\n");
    788757        } 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 );
    791759        }
    792760
     
    839807}
    840808
    841 
    842 
    843 
    844 
    845 //This code will
Note: See TracChangeset for help on using the changeset viewer.