IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 27, 2004, 2:17:33 PM (22 years ago)
Author:
gusciora
Message:

I made changes to reflect the new SDRS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psStats.h

    r729 r796  
    11#if !defined(PS_STATS_H)
    22#define PS_STATS_H
    3 
     3/******************************************************************************
     4    This file will histogram/statistical functions and data structures.
     5 *****************************************************************************/
    46/** \file psStats.h
    57 *  \brief basic statistical operations
     
    79 */
    810#include "psVector.h"
    9 
    10 /** statistics which may be calculated */
     11/******************************************************************************
     12    Statistical functions and data structures.
     13 *****************************************************************************/
    1114typedef enum {
    1215    PS_STAT_SAMPLE_MEAN           = 0x000001,
    1316    PS_STAT_SAMPLE_MEDIAN         = 0x000002,
    1417    PS_STAT_SAMPLE_STDEV          = 0x000004,
    15     PS_STAT_SAMPLE_UQ             = 0x000008,
    16     PS_STAT_SAMPLE_LQ             = 0x000010,
    17     PS_STAT_ROBUST_MEAN           = 0x000020,
    18     PS_STAT_ROBUST_MEAN_NVALUES   = 0x000040,
    19     PS_STAT_ROBUST_MEDIAN         = 0x000080,
    20     PS_STAT_ROBUST_MEDIAN_NVALUES = 0x000100,
    21     PS_STAT_ROBUST_MODE           = 0x000200,
    22     PS_STAT_ROBUST_MODE_NVALUES   = 0x000400,
    23     PS_STAT_ROBUST_STDEV          = 0x000800,
    24     PS_STAT_ROBUST_UQ             = 0x001000,
    25     PS_STAT_ROBUST_LQ             = 0x002000,
    26     PS_STAT_CLIPPED_MEAN          = 0x004000,
    27     PS_STAT_CLIPPED_MEAN_NVALUES  = 0x008000,
    28     PS_STAT_CLIPPED_MEAN_NSIGMA   = 0x010000,
    29     PS_STAT_CLIPPED_STDEV         = 0x020000,
    30     PS_STAT_MAX                   = 0x040000,
    31     PS_STAT_MIN                   = 0x080000,
    32     PS_STAT_NVALUES               = 0x100000
     18    PS_STAT_SAMPLE_QUARTILE       = 0x000008,
     19    PS_STAT_ROBUST_MEAN           = 0x000010,
     20    PS_STAT_ROBUST_MEDIAN         = 0x000020,
     21    PS_STAT_ROBUST_MODE           = 0x000040,
     22    PS_STAT_ROBUST_STDEV          = 0x000080,
     23    PS_STAT_ROBUST_QUARTILE       = 0x000100,
     24    PS_STAT_CLIPPED_MEAN          = 0x000200,
     25    PS_STAT_CLIPPED_STDEV         = 0x000400,
     26    PS_STAT_MAX                   = 0x000800,
     27    PS_STAT_MIN                   = 0x001000,
     28    PS_STAT_USE_RANGE             = 0x002000,
     29    PS_STAT_USE_BINSIZE           = 0x004000,
     30    PS_STAT_ROBUST_FOR_SAMPLE     = 0x008000
    3331} psStatsOptions;
    3432
     
    4240    double sampleUQ;            ///< upper quartile of sample
    4341    double sampleLQ;            ///< lower quartile of sample
     42    double sampleLimit;         ///<
    4443    double robustMean;          ///< robust mean of array
    4544    int    robustMeanNvalues;   ///< number of measurements used for robust mean
    4645    double robustMedian;        ///< robust median of array
    47     int    robustMedianNvalues; ///< number of measurements used for robust median
    4846    double robustMode;          ///< Robust mode of array
    49     int    robustModeNvalues;   ///< Number of measurements used for robust mode
    5047    double robustStdev;         ///< robust standard deviation of array
    5148    double robustUQ;            ///< robust upper quartile
    5249    double robustLQ;            ///< robust lower quartile
     50    double robustN50;           ///<
     51    double robustNfit;          ///<
    5352    double clippedMean;         ///< Nsigma clipped mean
    54     int    clippedMeanNvalues;  ///< number of data points used for clipped mean
    5553    double clippedStdev;        ///< standard deviation after clipping
    5654    double clipSigma;           ///< Nsigma used for clipping; user input
     
    5856    double min;                 ///< minimum data value in array
    5957    double max;                 ///< maximum data value in array
    60     int    nValues;             ///< number of data values in array
     58    double binsize;             ///<
    6159    psStatsOptions options;     ///< bitmask of calculated values
    6260}
     
    6664/** Do Statistics on an array.  Returns a status value. \ingroup MathGroup */
    6765psStats *
    68 psArrayStats(const psVector *restrict myVector, ///< Vector to be analysed: must be FLOAT
    69              const psVector *restrict maskVector, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    70              unsigned int maskVal, ///< Only mask elements with one of these bits set in maskVector
    71              psStats *stats  ///< stats structure defines stats to be calculated and how
    72             );
     66psVectorStats(psStats *stats,       ///< stats structure defines stats to be calculated and how
     67              psVector *in,         ///< Vector to be analysed: must be F32
     68              psVector *mask,       ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
     69              unsigned int maskVal ///< Only mask elements with one of these bits set in maskVector
     70             );
    7371
    7472/** Constructor */
    75 psStats *
    76 psStatsAlloc(psStatsOptions options ///< Statistics to measure
    77             );
     73psStats *psStatsAlloc(psStatsOptions options); ///< Statistics to measure
    7874
    7975/** Destructor */
    80 void
    81 psStatsFree(psStats *restrict stats ///< Stats structure to destroy
    82            );
     76void psStatsFree(psStats *restrict stats); ///< Stats structure to destroy
    8377
    84 /** Histograms  */
    85 // NOTE: I added the numBins member.  Must consult with IfA on this.
     78/******************************************************************************
     79    Histogram functions and data structures.
     80 *****************************************************************************/
    8681typedef struct
    8782{
    88     const psVector *restrict lower; ///< Lower bounds for the bins (FLOAT)
    89     const psVector *restrict upper; ///< Upper bounds for the bins (FLOAT)
    90     psVector *nums;                 ///< Number in each of the bins (INT)
    91     float minVal;
    92     float maxVal;                   ///< Minimum and maximum values
    93     int minNum;
    94     int maxNum;                     ///< Number below the minimum and above the maximum
    95     int numBins;                    ///< Number of bins in this histogram.
     83    const psVector *restrict bounds; ///< Bounds for the bins (type F32)
     84    psVector *nums;                  ///< Number in each of the bins (INT)
     85    int minNum;                      ///< Number below the minimum
     86    int maxNum;                      ///< Number above the maximum
     87    int uniform;                     ///< Is it a uniform distribution?
    9688}
    9789psHistogram;
     90
    9891
    9992/** Constructor \ingroup MathGroup */
     
    10194psHistogramAlloc(float lower,  ///< Lower limit for the bins
    10295                 float upper,  ///< Upper limit for the bins
    103                  float size    ///< Size of the bins
    104                 );
     96                 int n);       ///< Number of bins
     97
    10598
    10699/** Generic constructor \ingroup MathGroup */
    107 psHistogram *
    108 psHistogramAllocGeneric(const psVector *restrict lower, ///< Lower bounds for the bins
    109                         const psVector *restrict upper, ///< Upper bounds for the bins
    110                         float minVal,                   ///< Minimum value
    111                         float maxVal                    ///< Maximum value
    112                        );
     100psHistogram * psHistogramAllocGeneric(const psVector *restrict bounds); ///< Bounds for the bins
     101
    113102
    114103/** Destructor \ingroup MathGroup **/
    115 void
    116 psHistogramFree(psHistogram *restrict myHist          ///< Histogram to destroy
    117                );
     104void psHistogramFree(psHistogram *restrict myHist);          ///< Histogram to destroy
    118105
    119106
    120107/** Calculate a histogram \ingroup MathGroup **/
    121 psHistogram *
    122 psGetArrayHistogram(psHistogram *restrict myHist,     ///< Histogram data
    123                     const psVector *restrict myVector ///< Vector to analyse
    124                    );
     108psHistogram *psHistogramVector (psHistogram *out,   ///< Histogram data
     109                                psVector *in,       ///< Vector to analyse
     110                                psVector *mask,     ///< Mask dat for input vector
     111                                int maskVal);       ///< Mask value
     112
    125113
    126114#endif
Note: See TracChangeset for help on using the changeset viewer.