Index: /trunk/archive/pslib/include/psStats.h
===================================================================
--- /trunk/archive/pslib/include/psStats.h	(revision 248)
+++ /trunk/archive/pslib/include/psStats.h	(revision 249)
@@ -9,27 +9,30 @@
 /** statistics which may be calculated */
 typedef enum {
-    PS_STAT_SAMPLE_MEAN           = 0x000001,
-    PS_STAT_SAMPLE_MEAN_ERROR     = 0x000002,
-    PS_STAT_SAMPLE_MEDIAN         = 0x000004,
-    PS_STAT_SAMPLE_MEDIAN_ERROR   = 0x000008,
-    PS_STAT_SAMPLE_STDEV          = 0x000010,
-    PS_STAT_SAMPLE_UQ 		  = 0x000020, 
-    PS_STAT_SAMPLE_LQ 		  = 0x000040,
-    PS_STAT_ROBUST_MEAN           = 0x000080,
-    PS_STAT_ROBUST_MEAN_ERROR     = 0x000100,
-    PS_STAT_ROBUST_MEAN_NVALUES   = 0x000200,
-    PS_STAT_ROBUST_MEDIAN         = 0x000400,
-    PS_STAT_ROBUST_MEDIAN_ERROR   = 0x000800,
-    PS_STAT_ROBUST_MEDIAN_NVALUES = 0x001000,
-    PS_STAT_ROBUST_STDEV          = 0x002000,
-    PS_STAT_ROBUST_UQ 		  = 0x004000, 
-    PS_STAT_ROBUST_LQ 		  = 0x008000,
-    PS_STAT_CLIPPED_MEAN          = 0x010000,
-    PS_STAT_CLIPPED_MEAN_ERROR    = 0x020000,
-    PS_STAT_CLIPPED_MEAN_NVALUES  = 0x040000,
-    PS_STAT_CLIPPED_MEAN_NSIGMA   = 0x080000,
-    PS_STAT_MAX     		  = 0x100000,     
-    PS_STAT_MIN     		  = 0x200000,
-    PS_STAT_NVALUES 		  = 0x400000
+    PS_STAT_SAMPLE_MEAN           = 0x0000001,
+    PS_STAT_SAMPLE_MEDIAN         = 0x0000002,
+    PS_STAT_SAMPLE_MODE           = 0x0000004,
+    PS_STAT_SAMPLE_STDEV          = 0x0000008,
+    PS_STAT_SAMPLE_UQ 		  = 0x0000010, 
+    PS_STAT_SAMPLE_LQ 		  = 0x0000020,
+    PS_STAT_ROBUST_MEAN           = 0x0000040,
+    PS_STAT_ROBUST_MEAN_ERROR     = 0x0000080,
+    PS_STAT_ROBUST_MEAN_NVALUES   = 0x0000100,
+    PS_STAT_ROBUST_MEDIAN         = 0x0000200,
+    PS_STAT_ROBUST_MEDIAN_ERROR   = 0x0000400,
+    PS_STAT_ROBUST_MEDIAN_NVALUES = 0x0000800,
+    PS_STAT_ROBUST_MODE           = 0x0001000,
+    PS_STAT_ROBUST_MODE_ERROR     = 0x0002000,
+    PS_STAT_ROBUST_MODE_NVALUES   = 0x0004000,
+    PS_STAT_ROBUST_STDEV          = 0x0008000,
+    PS_STAT_ROBUST_UQ 		  = 0x0010000, 
+    PS_STAT_ROBUST_LQ 		  = 0x0020000,
+    PS_STAT_CLIPPED_MEAN          = 0x0040000,
+    PS_STAT_CLIPPED_MEAN_ERROR    = 0x0080000,
+    PS_STAT_CLIPPED_MEAN_NVALUES  = 0x0100000,
+    PS_STAT_CLIPPED_MEAN_NSIGMA   = 0x0200000,
+    PS_STAT_CLIPPED_STDEV         = 0x0400000,
+    PS_STAT_MAX     		  = 0x0800000,     
+    PS_STAT_MIN     		  = 0x1000000,
+    PS_STAT_NVALUES 		  = 0x2000000
 } psStatsOptions;    			  
 
@@ -37,7 +40,6 @@
 typedef struct {
     double sampleMean;			//<! formal mean of sample
-    double sampleMeanError;		//<! error on formal mean
     double sampleMedian;		//<! formal median of sample
-    double sampleMedianError;		//<! error on formal median
+    double sampleMode;			//!< Formal mode of sample
     double sampleStdev;			//<! standard deviation of sample
     double sampleUQ;			//<! upper quartile of sample
@@ -49,4 +51,7 @@
     double robustMedianError;		//<! error on robust median
     int    robustMedianNvalues;		//<! number of measurements used for robust median
+    double robustMode;			//!< Robust mode of array
+    double robustModeErr;		//!< Error in robust mode
+    int    robustModeNvalues;		//!< Number of measurements used for robust mode
     double robustStdev;			//<! robust standard deviation of array
     double robustUQ;			//<! robust upper quartile
@@ -55,5 +60,7 @@
     double clippedMeanError;		//<! error on clipped mean
     int    clippedMeanNvalues;		//<! number of data points used for clipped mean
-    double clippedMeanNsigma;		//<! Nsigma clip used for clipped mean
+    double clippedStdev;		//!< standard deviation after clipping
+    double clipSigma;			//<! Nsigma used for clipping; user input
+    int    clipIter;			//!< Number of clipping iterations; user input
     double min;				//<! minimum data value in array
     double max;				//<! maximum data value in array
@@ -70,5 +77,5 @@
 	     unsigned int maskVal,	//!< Only mask elements with one of these bits set in maskArray
 	     psStats *stats		//!< stats structure defines stats to be calculated and how
-);
+    );
 
 /***********************************************************************************************************/
@@ -86,6 +93,6 @@
 psHistogram *
 psHistogramAlloc(float lower,		//!< Lower limit for the bins
-	       float upper,		//!< Upper limit for the bins
-	       float size		//!< Size of the bins
+		 float upper,		//!< Upper limit for the bins
+		 float size		//!< Size of the bins
     );
 
@@ -93,7 +100,7 @@
 psHistogram *
 psHistogramAllocGeneric(const psFloatArray *restrict lower, //!< Lower bounds for the bins
-		      const psFloatArray *restrict upper, //!< Upper bounds for the bins
-		      float minVal,	//!< Minimum value
-		      float maxVal	//!< Maximum value
+			const psFloatArray *restrict upper, //!< Upper bounds for the bins
+			float minVal,	//!< Minimum value
+			float maxVal	//!< Maximum value
     );
 
