Index: /trunk/doc/pslib/ChangeLogADD.tex
===================================================================
--- /trunk/doc/pslib/ChangeLogADD.tex	(revision 4529)
+++ /trunk/doc/pslib/ChangeLogADD.tex	(revision 4530)
@@ -65,3 +65,5 @@
 \item Removed all references to slalib.
 \item Updated section on rotations.
+\item Divided the robust statistics into robust and fitted statistics,
+modified the algorithm somewhat. 
 \end{itemize}
Index: /trunk/doc/pslib/ChangeLogSDRS.tex
===================================================================
--- /trunk/doc/pslib/ChangeLogSDRS.tex	(revision 4529)
+++ /trunk/doc/pslib/ChangeLogSDRS.tex	(revision 4530)
@@ -1,3 +1,3 @@
-%%% $Id: ChangeLogSDRS.tex,v 1.156 2005-06-28 21:31:24 price Exp $
+%%% $Id: ChangeLogSDRS.tex,v 1.157 2005-07-11 19:17:38 eugene Exp $
 
 \subsection{Changes from version 00 to version 01}
@@ -749,3 +749,5 @@
 \item Making various integers \code{unsigned} in the various
   \code{psPolynomial} types and \code{psSpline1D} (bug 460).
-\end{itemize}
+\item Adjusted \code{psStats} to reflect robust / fitted statistics as defined in the ADD.
+\end{itemize}
+
Index: /trunk/doc/pslib/psLibADD.tex
===================================================================
--- /trunk/doc/pslib/psLibADD.tex	(revision 4529)
+++ /trunk/doc/pslib/psLibADD.tex	(revision 4530)
@@ -1,3 +1,3 @@
-%%% $Id: psLibADD.tex,v 1.82 2005-07-09 02:25:56 eugene Exp $
+%%% $Id: psLibADD.tex,v 1.83 2005-07-11 19:17:38 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -1811,7 +1811,7 @@
 is broken down into a number of steps as described below.
 
-\paragraph{Reference Implementations}
-
-There are two reference implementatins for the code to account for the
+\subsubsection{Reference Implementations}
+
+There are two reference implementations for the code to account for the
 motion of the Earth in space. The first are the sample routines
 provided by the IERS to accompany chaper 5 of IERS Bulletin
@@ -2234,8 +2234,8 @@
 
 \paragraph{Atmospheric Refraction}
+\newcommand\citep[1]{\textit{#1}}
+\newcommand\citet[1]{\textit{#1}}
 
 {\em The following discussion is adapted from an article by Ken Chambers}
-\newcommand\citep{\em}
-\newcommand\citet{\em}
 
 The hypsometric structure and index of refraction of the Earth's
@@ -2313,5 +2313,5 @@
 divided into separate subsections.
 
-\subsection{Observatory height}
+\subparagraph{Observatory height}
 
 The height of the observatory from the geometric center 
@@ -2330,5 +2330,5 @@
       (i.e. a local plumb line). 
 
-\subsection{The magnitude of normal gravity at the observatory }
+\subparagraph{The magnitude of normal gravity at the observatory }
                                                                                 
 The local magnitude of normal gravity
@@ -2391,5 +2391,5 @@
 
 
-\subsection{The scale height above the observatory} 
+\subparagraph{The scale height above the observatory} 
 
 The scale height of the atmosphere above the observatory is
@@ -2496,5 +2496,5 @@
 \end{equation}
 
-\subsection{The index of refraction of moist air at the observatory}
+\subparagraph{The index of refraction of moist air at the observatory}
 
 The Ciddor equation for the index of refraction of moist air 
@@ -2594,6 +2594,5 @@
 \end{table}
 
-
-\subsection{The tropopause term in the equation of refraction}
+\subparagraph{The tropopause term in the equation of refraction}
 
 The final term in the Refraction Equation (2) 
@@ -2625,6 +2624,6 @@
 \end{equation}
 
-\subsection{Calculating the atmospheric refraction from both 
-            the observed and true zenith angle} 
+\subparagraph{Calculating the atmospheric refraction from both 
+  the observed and true zenith angle}
 
 The monochromatic refraction can now be calculated for any given wavelength
@@ -2671,13 +2670,5 @@
 \end{equation}
 
-\section{Atmospheric Dispersion}    
-
-The atmospheric dispersion is then
-\begin{equation}
-{ \overline{(R- \bar R)^2}}  = {{\int (R - \bar R)^2 N_{\lambda} d \lambda} \over 
-                           {\int N_{\lambda} d\lambda}}  
-\end{equation}
-
-\section{Air Mass and Extinction}    
+\subsubsection{Air Mass and Extinction}    
 
 By Laplace's theorem, the monochromatic airmass (mass per unit area
@@ -2715,22 +2706,4 @@
 accurate expression for airmass should lead to improved extinction
 corrections at high airmass.  
-
-\section{Limits to ground based relative and absolute astrometry}   
-
-The limits to ground based astrometry may well be our abilitiy to 
-measure the atmospheric profile along the line of sight of a given 
-observation, and the systematic limit of the telescope axes encoders
-(and sophistication of the telescope mount model.) 
-The refratction model above requires only the additional data of
-the temperature, height, and presure of the tropopause, but much more
-detailed atmospheric information will be available for PS1 from our sky
-probes which measure atmospheric absorption for each field and even,
-phase drifts of GPS clocks from Rubidium or Cesium standard clocks. 
-These can be converted directly into a nearby line of sight index of refraction
-at optical wavelengths. Thus we encourage wide field survey telescopes to
-err on the side of over instrumenting the accuracy and repeatibility 
-of the axes encoders.  
-
-
 
 \subsection{Projections}
Index: /trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- /trunk/doc/pslib/psLibSDRS.tex	(revision 4529)
+++ /trunk/doc/pslib/psLibSDRS.tex	(revision 4530)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.311 2005-07-06 03:39:01 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.312 2005-07-11 19:17:38 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -1434,7 +1434,7 @@
                       unsigned int lineno, 
                       const char *func, 
-		      psErrorCode code,
+                      psErrorCode code,
                       bool new, 
-		      const char *format, ...);
+                      const char *format, ...);
 \end{prototype}
 \begin{datatype}
@@ -3987,25 +3987,27 @@
 We require a very general statistics function, which, given a vector
 of floating-point values, will be able to calculate the following
-statistics:
+population statistics:
 \begin{itemize}
+\item Minimum value;
+\item Maximum value;
 \item Sample mean;
 \item Sample median;
 \item Sample standard deviation;
 \item Sample upper and lower quartiles;
-\item Robust mean and number of values used to calculate;
+\item Clipped mean and number of values used to calculate;
+\item Clipped standard deviation; 
 \item Robust median and number of values used to calculate;
-\item Robust mode and number of values used to calculate;
 \item Robust standard deviation;
 \item Robust upper and lower quartiles;
-\item Clipped mean and number of values used to calculate;
-\item Clipped standard deviation; and
-\item Minimum and maximum value in vector.
+\item Fitted mean and number of values used to calculate;
+\item Fitted standard deviation;
 \end{itemize}
 
 For definitions of each of these, see the accompanying Algorithms
 Definition Document (ADD), but in general, ``sample'' refers to the
-entire vector, ``robust'' refers to fitting the distribution in the
-vector with a model, and ``clipped'' refers to clipping the
-distribution.  Each of these must be available from a single
+entire vector, ``clipped'' refers to clipping the distribution,
+``robust'' refers to determining the quantities from the cumulative
+histogram, and ``fitted'' refers to fitting the data histogram with a
+Gaussian model.  Each of these must be available from a single
 function:
 
@@ -4015,6 +4017,5 @@
                        const psVector *errors,
                        const psVector *mask,
-                       psMaskType maskVal
-                       );
+                       psMaskType maskVal);
 \end{prototype}
 %
@@ -4024,6 +4025,10 @@
 and a \code{psStats} structure, which will be altered and returned.
 The \code{psStats} structure includes several fields which are used
-for both input and output: \code{min} and \code{max} may be used to
-specify a value range for which the statistics are calculated.
+for both input and output: \code{nSubsample} (default value of
+100,000) specifies the maximum number of data points to be used for
+the statistics calculation.  If more points than this are available,
+then the input vector must be randomly sampled to provide
+\code{nSubsample} measurements.  \code{min} and \code{max} may be used
+to specify a value range for which the statistics are calculated.
 \code{binsize} specifies a choice for the robust statistics histogram
 bin size.  If these are to be used, the user must set the
@@ -4050,5 +4055,4 @@
 
 \begin{datatype}
-/** generic statistics structure */
 typedef struct {
     double sampleMean;                  ///< formal mean of sample
@@ -4057,12 +4061,12 @@
     double sampleUQ;                    ///< upper quartile of sample
     double sampleLQ;                    ///< lower quartile of sample
-    double robustMean;                  ///< robust mean of data
     double robustMedian;                ///< robust median of data
-    double robustMode;                  ///< Robust mode of data
     double robustStdev;                 ///< robust standard deviation of data
     double robustUQ;                    ///< robust upper quartile
     double robustLQ;                    ///< robust lower quartile
     int    robustN50;                   ///< Number of points UQ-LQ
-    int    robustNfit;                  ///< Number of points in Gauss. fit
+    double fittedMean;                  ///< robust mean of data
+    double fittedStdev;                 ///< robust standard deviation of data
+    int    fittedNfit;                  ///< Number of points in Gauss. fit
     double clippedMean;                 ///< Nsigma clipped mean
     double clippedStdev;                ///< standard deviation after clipping
@@ -4073,4 +4077,5 @@
     double max;                         ///< maximum data value in data; input range
     double binsize;                     ///< binsize for robust fit (input/output)
+    int    nSubsample;                  ///< maximum number of measuremenst (input)
     psStatsOptions options;             ///< bitmask of calculated values
 } psStats;
@@ -4080,5 +4085,4 @@
 
 \begin{datatype}
-/** statistics which may be calculated */
 typedef enum {
     PS_STAT_SAMPLE_MEAN           = 0x000001,
@@ -4086,9 +4090,9 @@
     PS_STAT_SAMPLE_STDEV          = 0x000004,
     PS_STAT_SAMPLE_QUARTILE       = 0x000008, 
-    PS_STAT_ROBUST_MEAN           = 0x000010,
-    PS_STAT_ROBUST_MEDIAN         = 0x000020,
-    PS_STAT_ROBUST_MODE           = 0x000040,
-    PS_STAT_ROBUST_STDEV          = 0x000080,
-    PS_STAT_ROBUST_QUARTILE       = 0x000100, 
+    PS_STAT_ROBUST_MEDIAN         = 0x000010,
+    PS_STAT_ROBUST_STDEV          = 0x000020,
+    PS_STAT_ROBUST_QUARTILE       = 0x000040, 
+    PS_STAT_FITTED_MEAN           = 0x000080,
+    PS_STAT_FITTED_STDEV          = 0x000100,
     PS_STAT_CLIPPED_MEAN          = 0x000200,
     PS_STAT_CLIPPED_STDEV         = 0x000400,
@@ -6362,4 +6366,11 @@
 corrections for the short-period motion of the Earth's pole.  
 
+\begin{figure}
+\begin{center}
+\psfig{file=earthrot.ps,height=4in}
+\caption{Earth Orientation Coordinate Frames\label{CoordinateSystems}}
+\end{center}
+\end{figure}
+
 \subsubsection{Transformation from ICRS to GCRS}
 
