Index: trunk/doc/pslib/psLibADD.tex
===================================================================
--- trunk/doc/pslib/psLibADD.tex	(revision 3721)
+++ trunk/doc/pslib/psLibADD.tex	(revision 3772)
@@ -1,3 +1,3 @@
-%%% $Id: psLibADD.tex,v 1.72 2005-04-19 23:44:43 eugene Exp $
+%%% $Id: psLibADD.tex,v 1.73 2005-04-27 19:59:04 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -14,5 +14,5 @@
 \project{Pan-STARRS Image Processing Pipeline}
 \organization{Institute for Astronomy}
-\version{10}
+\version{11}
 \docnumber{PSDC-430-006}
 
@@ -41,4 +41,5 @@
 09 & 2005 Feb 14 & Frozen for Cycle 5 \\ \hline
 10 & 2005 Apr 19 & Frozen for Cycle 6 \\ \hline
+11 & 2005 Apr 27 & Update for Cycle 6 \\ \hline
 \RevisionsEnd
 
@@ -1553,6 +1554,4 @@
 the quarternion for this transformation.
 
-\tbd{can we drop this, since we do this with the quaternion?}
-
 The relevant trigonometric relationships are:
 %
@@ -1611,7 +1610,7 @@
 \phi_p & = & 90^\circ + 0^\circ.6406161\, T + 0^\circ.0003041\, T^2 + 0^\circ.0000051\, T^3
 \end{eqnarray}
-where $T$ is $($MJD$_{\rm out} -$ MJD$_{\rm in})/36525$ is the difference
-between the two epochs, in Julian centuries.
-
+where $T$ is $($MJD$_{\rm out} -$ MJD$_{\rm in})/36525$ is the
+difference between the two epochs, in Julian centuries.  This
+precession form shall be used to implement \code{PS_PRECESS_ROUGH}.
 
 \subsubsection{Suggested test cases}
@@ -1648,11 +1647,10 @@
 There are two reference implementatins 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 32.  This
-document and the code can be downloaded from
-http://maia.usno.navy.mil/conv2003.html .  The second reference
-implementation is the SOFA software package managed by the IAU and
-available at http://www.iau-sofa.rl.ac.uk Only the 2003-04-29 version
-of SOFA should be used.  The IERS code requires a few of the rotation
-matrix utility routines from SOFA.
+provided by the IERS to accompany chaper 5 of IERS Bulletin
+32.\footnote{http://maia.usno.navy.mil/conv2003.html} The second
+reference implementation is the SOFA software package managed by the
+IAU.\footnote{http://www.iau-sofa.rl.ac.uk} Only the 2003-04-29
+version of SOFA should be considered.  The IERS code requires a few of
+the rotation matrix utility routines from SOFA.
 
 Both implementations are in FORTRAN 77. The SOFA code has a more
@@ -1663,5 +1661,6 @@
 reference for psLib should be the IERS code.  Note that the IERS code
 calculates the transform from terrestrial to celestial coordinates,
-while the SOFA code calculates its inverse.
+while the SOFA code calculates its inverse.  This code may be using as
+a comparison for testing purposes.
 
 \subsubsection{Coordinate Systems}
@@ -1711,13 +1710,13 @@
 
 The X axes of the intermediate coordinate systems are known as the
-Celestial and Terrestrial Ephemeris Origins. (CEO and TEO). Both are defined
-to be non-rotating origins. A non-rotating origin is a point on the equator
-whose instantaneous motion is always orthogonal to the equator
-(Kaplan 2003 IAU XXV Joint Discussion 16
-\footnote{http://aa.usno.navy.mil/kaplan/NROs\%5BJD16proc\%5D.pdf}).
-Thus the CEO is defined by its position in the GCRS at some epoch and by the
-motion of the CIP in the GCRS since that date. Similarly the TEO is
-defined by its position in the ITRS at some epoch and the motion of the
-CIP in the ITRS since that date.
+Celestial and Terrestrial Ephemeris Origins. (CEO and TEO). Both are
+defined to be non-rotating origins. A non-rotating origin is a point
+on the equator whose instantaneous motion is always orthogonal to the
+equator (Kaplan 2003 IAU XXV Joint Discussion
+16\footnote{http://aa.usno.navy.mil/kaplan/NROs\%5BJD16proc\%5D.pdf}).
+Thus the CEO is defined by its position in the GCRS at some epoch and
+by the motion of the CIP in the GCRS since that date. Similarly the
+TEO is defined by its position in the ITRS at some epoch and the
+motion of the CIP in the ITRS since that date.
 
 \subsubsection{ICRS - GCRS}
@@ -1793,5 +1792,5 @@
 
 This section is largely a summary of Chapter 5 of IERS Technical Note
-32 \footnote{http://maia.usno.navy.mil/conv2003.html} (hereafter
+32\footnote{http://maia.usno.navy.mil/conv2003.html} (hereafter
 IERS32), which is a description of the implementation of the
 Resoltions of the XXIVth General Assembly of the IAU, available from
@@ -1807,4 +1806,6 @@
 accurate to the 0.2 mas level.  For higher accuracy the user must
 apply corrections to the model, which are tabulated by the IERS.
+
+\subparagraph{IAU 200A Precession/Nutation Model : {\tt psEOC\_PrecessionModel}}
 
 The IAU 2000A precession-nutation model may be calculated in the
@@ -1855,7 +1856,7 @@
 The constants $p_j$, $w_{i,j,k}$, $(a_{{\rm s},j})_i$, and $(a_{{\rm c},j})_i$
 are given in the ASCII files:
-tab5.2a.txt \footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2a.txt} (for $X$),
-tab5.2b.txt \footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2b.txt} (for $Y$), and
-tab5.2c.txt \footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2c.txt} (for $s+XY/2$).
+tab5.2a.txt\footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2a.txt} (for $X$),
+tab5.2b.txt\footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2b.txt} (for $Y$), and
+tab5.2c.txt\footnote{http://maia.usno.navy.mil/conv2000/chapter5/tab5.2c.txt} (for $s+XY/2$).
 Note that the expansion is given for $s+XY/2$, since this series converges
 more rapidly than the one for $s$ alone.
@@ -1876,10 +1877,12 @@
 
 A FORTRAN reference implementation for the precession/nutation model
-is available from the IERS
-\footnote{http://maia.usno.navy.mil/conv2000/chapter5/XYS2000A.f}.
-The psLib results should agree with the reference implementation to within
-the limits of numerical precision.
-
-Next, corrections to $X$, and $Y$ may be obtained from the IERS as
+is available from the
+IERS.\footnote{http://maia.usno.navy.mil/conv2000/chapter5/XYS2000A.f}
+The psLib results should agree with the reference implementation to
+within the limits of numerical precision.
+
+\subparagraph{Corrections to the Model : {\tt psEOC\_PrecessionCorr}}
+
+Corrections to $X$, and $Y$ may be obtained from the IERS as
 part of Bulletin A, or B. It is recommended to use the values
 published daily by USNO in the table
@@ -1895,24 +1898,28 @@
 the result as instantaneous values.
 
-The final step is to use $X$, $Y$, and $s$ to calculate the rotation
-matrix from the CIP/CEO system to the GCRS using IERS32 equation (10),
-reproduced below:
-
-\begin{equation}
+\subparagraph{Spherical Rotation from Polar Coordinates : {\tt psSphereRot\_CEOtoGCRS}}
+
+In order to relate the values $X$, $Y$, and $s$ to the rotation
+components, the rotation matrix below must be used.  The definitions
+of $X$, $Y$, and $s$ transform from the CIP/CEO system to the GCRS
+using IERS32 equation (10), reproduced below:
+
+\begin{equation}
+\label{CEOtoGCRS}
 \begin{pmatrix}1-aX^2& -aXY& X\cr -aXY& 1-aY^2& Y\cr -X& -Y&
 1-a(X^2+Y^2)\cr
 \end{pmatrix} \cdot R_3(s),
 \end{equation}
-where $R_3$ denotes a rotation about the Z axis,
-$a = 1/(1+\sqrt{1 - X^2 + Y^2})$,
-and $X$ and $Y$ are expressed in radians.
-A FORTRAN reference implementation for this calculation is given
-by the IERS \footnote{http://maia.usno.navy.mil/conv2000/chapter5/BPN2000.f}.
-
-Note that above we gave the expression for the transform toward celestial
-coordinates (upward in figure X), in order to match the IERS reference code.
-The inverse transform may be found by inverting the resulting rotation.
-
-\paragraph{Rotation of the Earth}
+where $R_3$ denotes a rotation about the Z axis, $a = 1/(1+\sqrt{1 -
+(X^2 + Y^2})$, and $X$ and $Y$ are expressed in radians.  A FORTRAN
+reference implementation for this calculation is given by the
+IERS.\footnote{http://maia.usno.navy.mil/conv2000/chapter5/BPN2000.f}  
+
+Note that above we gave the expression for the transform toward
+celestial coordinates (upward in Figure~\ref{earthrot}), in order to
+match the IERS reference code.  The inverse transform may be found by
+inverting the resulting rotation.
+
+\paragraph{Earth Rotation}
 
 The transform from the CIP/CEO to CIP/TEO coordinate systems is a
@@ -1931,11 +1938,14 @@
 motion''. Similarly to precession/nutation, the instantaneous position
 of the CIP in the ITRS is specified by the quantites $x_p$, and $y_p$,
-and a third quantity, $s'$, gives the position of the TEO with respect
-to the ITRS.  The values of $x_p$ and $y_p$ are published daily by the
-IERS\footnote{http://maia.usno.navy.mil/ser7/finals2000A.daily}, with
+and a third quantity, $s'$, which give the position of the TEO with
+respect to the ITRS.  The values of $x_p$ and $y_p$ are published
+daily by the
+IERS,\footnote{http://maia.usno.navy.mil/ser7/finals2000A.daily} with
 a format described by their
 \code{readme.finals2000A}\footnote{http://maia.usno.navy.mil/ser7/readme.finals2000A}.
 The UT1$-$UTC, and the precession/nutation corrections (discussed
 elsewhere in this document) come from this same source.
+
+\subparagraph{Polar Motion from Bulletin : {\tt psEOC\_GetPolarMotion}}
 
 The polar motion coordinates should be interpolated using a third
@@ -1953,5 +1963,7 @@
 The tidal effects should be included by using the Ray tidal model
 given in IERS Gazette \#13. The definition of this correction is
-provided below.
+provided below (Section~\ref{Raymodel}).
+
+\subparagraph{Polar Motion Nutation Correction : {\tt psEOC\_NutationCorr}}
 
 By definition of the CIP, nutation terms with periods less than 2 days
@@ -1966,4 +1978,6 @@
 over this century by $s' = -4.7 \times 10^{-5} t$ in arcseconds. There
 is no need to apply short timescale corrections to $s'$.
+
+\subparagraph{Spherical Rotation from Polar Motion : {\tt psSphereRot\_ITRStoTEO}}
 
 The transform from the ITRS to the CIP/TEO frame can be constructed by
@@ -2009,5 +2023,5 @@
 correction from the Ray Tidal Model applied.
 
-\subsubsection{Ray Tidal Model}
+\subsubsection{Ray Tidal Model : {\tt psEOC\_PolarTideCorr}}
 
 The Ray Model tidal corrections to X, Y, and dT are given by the the
