Changeset 215 for trunk/archive/pslib/include/psStats.h
- Timestamp:
- Mar 11, 2004, 10:34:23 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psStats.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psStats.h
r160 r215 5 5 #include "psStdArrays.h" 6 6 7 typedef enum { 8 PS_STAT_SAMPLE_MEAN = 0x000001, 9 PS_STAT_SAMPLE_MEAN_ERROR = 0x000002, 10 PS_STAT_SAMPLE_MEDIAN = 0x000004, 11 PS_STAT_SAMPLE_MEDIAN_ERROR = 0x000008, 12 PS_STAT_SAMPLE_STDEV = 0x000010, 13 PS_STAT_SAMPLE_UQ = 0x000020, 14 PS_STAT_SAMPLE_LQ = 0x000040, 15 PS_STAT_ROBUST_MEAN = 0x000080, 16 PS_STAT_ROBUST_MEAN_ERROR = 0x000100, 17 PS_STAT_ROBUST_MEAN_NVALUES = 0x000200, 18 PS_STAT_ROBUST_MEDIAN = 0x000400, 19 PS_STAT_ROBUST_MEDIAN_ERROR = 0x000800, 20 PS_STAT_ROBUST_MEDIAN_NVALUES = 0x001000, 21 PS_STAT_ROBUST_STDEV = 0x002000, 22 PS_STAT_ROBUST_UQ = 0x004000, 23 PS_STAT_ROBUST_LQ = 0x008000, 24 PS_STAT_CLIPPED_MEAN = 0x010000, 25 PS_STAT_CLIPPED_MEAN_ERROR = 0x020000, 26 PS_STAT_CLIPPED_MEAN_NVALUES = 0x040000, 27 PS_STAT_CLIPPED_MEAN_NSIGMA = 0x080000, 28 PS_STAT_MAX = 0x100000, 29 PS_STAT_MIN = 0x200000, 30 PS_STAT_NVALUES = 0x400000 31 } psStatsOptions; 32 33 /** generic statistics structure */ 34 typedef struct { 35 double sampleMean //<! formal mean of sample 36 double sampleMeanError; //<! error on formal mean 37 double sampleMedian //<! formal median of sample 38 double sampleMedianError; //<! error on formal median 39 double sampleStdev; //<! standard deviation of sample 40 double sampleUQ; //<! upper quartile of sample 41 double sampleLQ; //<! lower quartile of sample 42 double robustMean //<! robust mean of array 43 double robustMeanError; //<! error on robust mean 44 int robustMeanNvalues; //<! number of measurements used for robust mean 45 double robustMedian //<! robust median of array 46 double robustMedianError; //<! error on robust median 47 int robustMedianNvalues; //<! number of measurements used for robust median 48 double robustStdev; //<! robust standard deviation of array 49 double robustUQ; //<! robust upper quartile 50 double robustLQ; //<! robust lower quartile 51 double clippedMean //<! Nsigma clipped mean 52 double clippedMeanError; //<! error on clipped mean 53 int clippedMeanNvalues; //<! number of data points used for clipped mean 54 double clippedMeanNsigma; //<! Nsigma clip used for clipped mean 55 double min; //<! minimum data value in array 56 double max; //<! maximum data value in array 57 int nValues; //<! number of data values in array 58 psStatsOptions options; //<! bitmask of calculated values 59 } psStats; 60 61 7 62 /** Do Statistics on an array. Returns a status value. */ 8 int 63 psStats * 9 64 psArrayStats(const psFloatArray *restrict myArray, //!< Array to be analysed 10 65 const psIntArray *restrict maskArray, //!< Ignore elements where (maskArray & maskVal) != 0 11 66 //!< May be NULL 12 67 unsigned int maskVal, //!< Only mask elements with one of these bits set in maskArray 13 int numIter, //!< Number of clipping iterations (0 not to clip) 14 float numSD, //!< Number of s.d. to clip at 15 float *restrict mean, //!< Mean of array (or NULL) 16 float *restrict sd, //!< Standard deviation (or NULL) 17 float *restrict med //!< Median (or NULL) 18 ); 68 psStats *stats //!< stats structure defines stats to be calculated and how 69 ); 19 70 20 71 /***********************************************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.
