IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 7, 2006, 5:34:39 PM (20 years ago)
Author:
Paul Price
Message:

Pulling out function that got implemented in psLib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeScaleZero.c

    r9824 r9907  
    1111#include "ppMerge.h"
    1212#include "ppMergeScaleZero.h"
    13 
    14 // Extract a particular statistic from the stats
    15 static inline double getStat(const psStats *stats, // Statistics structure
    16                              psStatsOptions option // Statistic option to return
    17     )
    18 {
    19     switch (option) {
    20       case PS_STAT_SAMPLE_MEAN:
    21         return stats->sampleMean;
    22       case PS_STAT_SAMPLE_MEDIAN:
    23         return stats->sampleMedian;
    24       case PS_STAT_ROBUST_MEDIAN:
    25         return stats->robustMedian;
    26       case PS_STAT_FITTED_MEAN:
    27         return stats->fittedMean;
    28       case PS_STAT_CLIPPED_MEAN:
    29         return stats->clippedMean;
    30       default:
    31         psAbort(__func__, "Invalid statistics option: %x\n", option);
    32     }
    33     return NAN;                         // Token return
    34 }
    35 
    3613
    3714// Get the scale and zero for each chip of each input
     
    262239                    psFree(sample);
    263240                    psFree(sampleMask);
    264                     background->data.F32[i][cellNum] = getStat(bgStats, options->mean);
     241                    background->data.F32[i][cellNum] = psStatsGetValue(bgStats, options->mean);
    265242                    psTrace("ppMerge", 3, "Background for %s, cell %d is %f\n", name, cellNum,
    266243                            background->data.F32[i][cellNum]);
Note: See TracChangeset for help on using the changeset viewer.