Index: /trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- /trunk/doc/pslib/psLibSDRS.tex	(revision 274)
+++ /trunk/doc/pslib/psLibSDRS.tex	(revision 275)
@@ -708,5 +708,5 @@
 
 \textbf{[If the magnitude terms serve to check CTI, then shouldn't we
-put them in the cell <--> chip section?]}
+put them in the cell $\leftrightarrow$ chip section?]}
 
 We require structures to contain each of the above transformations as
@@ -993,5 +993,5 @@
 
 \begin{figure}
-\psfig{file=coordinateFrames.ps,width=9in,angle=-90}
+\psfig{file=coordinateFrames.ps,height=7in,angle=-90}
 \caption{The coordinate systems in the \PS{} IPP, and the relation
 between each by transformations contained in the appropriate
@@ -1001,5 +1001,5 @@
 
 \begin{figure}
-\psfig{file=coordinateConv.ps,width=9in,angle=-90}
+\psfig{file=coordinateConv.ps,height=7in,angle=-90}
 \caption{Conversion between coordinate systems by PSLib.}
 \label{fig:cocoFunc}
@@ -1098,4 +1098,5 @@
 		   psCoord *coord	///< input Chip coordinate
 		   );
+\end{verbatim}
 
 \begin{verbatim}
@@ -1181,21 +1182,198 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \subsection{Dates and times}
+
+\textbf{[May be deferred.]}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \subsection{Image handling}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Gene
+Gene --- done.
 
 \subsection{Metadata}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Gene
+Gene --- done.
 
 \subsection{Detector and sky positions}
+
+Both detector and sky positions will be used extensively in the IPP.
+Since these both contain two coordinates with their associated errors,
+we bundle these into a single generic structure, \code{psCoord},
+containing \code{union}s to handle the semantic differences.
+
+\begin{verbatim}
+/** A point in 2-D space, with errors.
+ */
+typedef struct {
+    union {
+	double x;				//!< x position
+	double r;				//!< x position
+    } x;
+    union {
+	double xErr;				//!< Error in x position
+	double rErr;				//!< Error in x position
+    } dx;
+    union {
+	double y;				//!< y position
+	double d;				//!< y position
+    } y;
+    union {
+	double yErr;				//!< Error in y position
+	double dErr;				//!< Error in y position
+    } dy;
+} psCoord;
+\end{verbatim}
+
+\subsubsection{Transformations}
+
+We specify two types of transforms between coordinate systems.  The
+first consists simply of two 2D polynomials to transform both
+components; this will be used to apply the coordinate transformations
+between Cells, Chips and the Focal Plane.  The second consists of two
+4D polynomials; this will be used to apply position-, colour- and
+magnitude-dependent distortions between the Focal Plane and the
+Tangent Plane.
+
+\begin{verbatim}
+/** A polynomial transformation between coordinate frames.  This may be a linear relationship, or may
+ *  represent a higher-order transformation.
+ */
+typedef struct {
+    psDPolynomial2D *x;
+    psDPolynomial2D *y;
+} psCoordXform;
+\end{verbatim}
+
+\begin{verbatim}
+/** The optical distortion terms.  The lowest two terms are the x and y axis of the target system.  The higher
+ *  two terms represent magnitude and color terms.
+ */
+typedef struct {
+    psDPolynomial4D *x;
+    psDPolynomial4D *y;
+} psDistortion;
+\end{verbatim}
+
+We require corresponding functions to apply the transformations:
+
+\begin{verbatim}
+/** apply the coordinate transformation to the given coordinate */
+psCoord *psCoordXformApply (psCoordXform *frame, ///< coordinate transformation
+			    psCoord *coords) ///< input coordiate
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** apply the optical distortion to the given coordinate, magnitude, color */
+psCoord *psDistortionApply (psDistortion *pattern, ///< optical distortion pattern
+psCoord *coords,			///< input coordinate
+float mag,				///< magnitude of object
+float color)				///< color of object
+;
+\end{verbatim}
+
+
+\subsubsection{Offsets}
+
+We require a function to calculate the offset between two positions on
+the sky, as well as a function to apply an offset to a position.
+
+\begin{verbatim}
+/** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */
+psCoord *
+psGetOffset(const psCoord *restrict position1, //!< Position 1
+	    const psCoord *restrict position2, //!< Position 2
+	    char *system)
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Apply an offset to a position */
+psCoord *
+psApplyOffset(const psCoord *restrict position, //!< Position
+	      const psCoord *restrict offset, //!< Offset
+	      char *system)
+;
+\end{verbatim}
+
+
+\subsubsection{Positions of Major SS Objects}
+
+We require the ability to calculate the position of major Solar System
+objects, as well as Lunar phase.
+
+\begin{verbatim}
+/** Get Sun Position */
+psCoord *
+psGetSunPos(float mjd)			//!< MJD to get position for
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Get Moon position */
+psCoord *
+psGetMoonPos(float mjd,			//!< MJD to get position for
+	     double latitude,		//!< Latitude for apparent position
+	     double longitude)		//!< Longitude for apparent position
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Get Moon phase */
+float
+psGetMoonPhase(float mjd)		//!< MJD to get phase for
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Get Planet positions */
+psCoord *
+psGetSolarSystemPos(char *solarSystemObject, //!< Named S.S. object
+		    float mjd)		//!< MJD to get position for
+;
+\end{verbatim}
+
+\subsubsection{Celestial Coordinate Conversions}
+
+We need to be able to convert between ICRS, Galactic and Ecliptic
+coordinates.
+
+\begin{verbatim}
+/** Convert ICRS to Ecliptic */
+psCoord *
+psCoordinatesItoE(const psCoord *restrict coordinates) //!< ICRS coordinates to convert
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Convert Ecliptic to ICRS */
+psCoord *
+psCoordinatesEtoI(const psCoord *restrict coordinates) //!< Ecliptic coordinates to convert
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Convert ICRS to Galactic */
+psCoord *
+psCoordinatesItoG(const psCoord *restrict coordinates) //!< ICRS coordinates to convert
+;
+\end{verbatim}
+
+\begin{verbatim}
+/** Convert Galactic to ICRS */
+psCoord *
+psCoordinatesGtoI(const psCoord *restrict coordinates) //!< Galactic coordinates to convert
+;
+\end{verbatim}
+
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \subsection{Astronomical objects}
 
+\textbf{[Deferred.]}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \subsection{Photometry}
 
-Gene
+Gene --- done.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
