Index: trunk/doc/modules/CameraImages.tex
===================================================================
--- trunk/doc/modules/CameraImages.tex	(revision 5486)
+++ trunk/doc/modules/CameraImages.tex	(revision 5709)
@@ -698,22 +698,16 @@
 image to the tangent plane); and the projection.
 
-\begin{verbatim}
-bool pmAstrometryReadWCS(psPlaneTransform **transform, // Output transformation
-                         psProjection **projection, // Output projection
-                         psMetadata *header // Input FITS header
-                         );
-bool pmAstrometryWriteWCS(psMetadata *header, // Output FITS header
-                          psPlaneTransform *transform, // Input transformation
-                          psProjection *projection, // Input projection
-                          double color, // Mean color to use
-                          double magnitude, // Mean magnitude to use
-                          );
-bool pmAstrometrySimplify(psPlaneTransform **transform, // Output transformation
-                          psProjection **projection, // Output projection
-                          pmCell *cell // Cell for which to generate transform and projection
-                          );
-\end{verbatim}
-
-\code{pmReadAstrometry} shall parse the specified FITS \code{header},
+\begin{prototype}
+bool pmAstromReadWCS(psPlaneTransform **transform, // Output transformation
+                     psProjection **projection, // Output projection
+                     psMetadata *header // Input FITS header
+);
+bool pmAstromWriteWCS(psMetadata *header, // Output FITS header
+                      psPlaneTransform *transform, // Input transformation
+                      psProjection *projection // Input projection
+);
+\end{prototype}
+
+\code{pmAstromReadWCS} shall parse the specified FITS \code{header},
 returning new instances of the \code{transform} and \code{projection}
 that represent the WCS.  The function shall return \code{true} if it
@@ -721,9 +715,16 @@
 return \code{false}.
 
-\code{pmWriteAstrometry} shall add WCS keywords to the supplied FITS
+\code{pmAstromWriteWCS} shall add WCS keywords to the supplied FITS
 \code{header} that implement the given \code{transform} and
 \code{projection}.  The function shall return \code{true} if it was
 able to successfully generate the output; otherwise it shall return
 \code{false}.
+
+\begin{verbatim}
+bool pmAstrometrySimplify(psPlaneTransform **transform, // Output transformation
+                          psProjection **projection, // Output projection
+                          pmCell *cell // Cell for which to generate transform and projection
+);
+\end{verbatim}
 
 \code{pmSimplifyAstrometry} shall take a \code{cell} and simplify the
@@ -875,5 +876,5 @@
 rotations.  We define the following function to apply this matching algorithm: 
 \begin{prototype}
-psArray *pmAstromGridMatch (psArray *starlist1, psArray *starlist2, psMetadata *options);
+pmAstromStats pmAstromGridMatch (psArray *raw, psArray *ref, psMetadata *options);
 \end{prototype}
 The input sources must have been projected to the Focal Plane
@@ -887,49 +888,47 @@
 \item \code{GRID.DEL.ANGLE} : relative rotation step size
 \end{itemize}
-Note that the angles are defined as counter-clockwise rotations of
-starlist 1 relative to starlist 2.
-
-This function returns all matched pairs identified in the grid cell.
-It also adds to the \code{options} metadata several elements defining
-the statistics of the best-fit (rotation and offset grid cell):
-\begin{itemize}
-\item \code{GRID.FIT.ANGLE}
-\item \code{GRID.FIT.LOFF}
-\item \code{GRID.FIT.MOFF}
-\item \code{GRID.FIT.METRIC}
-\item \code{GRID.FIT.VARIANCE}
-\item \code{GRID.FIT.NMATCH}
-\end{itemize}
-The elements \code{GRID.FIT.ANGLE}, \code{GRID.FIT.LOFF},
-\code{GRID.FIT.MOFF} define the best rotation and offset; the element
-\code{GRID.FIT.NMATCH} indicates the number of matched sources which
-fell within the match bin; the element \code{GRID.FIT.VAR} defines the
-variance of the sources within the match bin; the element
-\code{GRID.FIT.METRIC} specifies the value of the selection metric for
-the matched bin.  Note that the metric of choice may not necessarily
-be either the simple number of sources or the varience.  We find that
-a combination based on both which enhances the importance of having a
-well-populated bin with a minimal variance gives good results:
-$\mbox{metric} = \mbox{var} \times N^{-4}$.  
-
-The result of a \code{pmAstromGridMatch} may be used to modify the
-astrometry transformation information for a \code{pmFPA} image
-hierarchy structure.  The result of \code{pmAstromGridMatch} defines
-the adjustments which should be made to the reference coordinate of
-the projection (\code{pmFPA.projection.R,D}) and the effective
-rotation of the Focal Plane.  The rotation implies modification of the
-linear terms of the \code{pmFPA.toTangentPlane} transformation.  These
-two adjustments are made using the function:
-\begin{prototype}
-bool pmAstromApplyGridMatch (pmFPA *fpa, pmAstromGridMatchStats stats);
-\end{prototype}
-This function modifies the supplied \code{pmFPA} entry as described
-above.
-
-We define two additional functions which are used in two build
+Note that the angles are defined as clockwise rotations of \code{raw}
+relative to \code{ref}.
+
+This function returns values in the \code{pmAstromStats} structure, defined as: 
+\begin{datatype}
+typedef struct {
+    psPlane center;
+    psPlane offset;
+    double  angle;
+    double  minMetric;
+    double  minVar;
+    int     nMatch;
+} pmAstromStats;
+\end{datatype}
+The elements \code{angle} and \code{offset} define the best rotation
+and offset; the element \code{nMatch} indicates the number of matched
+sources which fell within the match bin; the element \code{minVar}
+specifies the variance of the sources within the match bin; the
+element \code{minMetric} specifies the value of the selection metric
+for the matched bin.  Note that the metric of choice may not
+necessarily be either the simple number of sources or the varience.
+We find that a combination based on both which enhances the importance
+of having a well-populated bin with a minimal variance gives good
+results: $\mbox{metric} = \mbox{var} \times N^{-4}$.  The element
+\code{center} defines the center of rotation used for rotating the
+\code{raw} stars relative to the \code{ref} stars.
+
+The result of a \code{pmAstromGridMatch} may be used to modify a
+\code{psPlaneTransform} structure \code{map}.  The result of
+\code{pmAstromGridMatch} can be translated into adjustments of the
+\code{psPlaneTransform} (ie the rotation and offset).  This adjustment
+is made using the function:
+\begin{prototype}
+bool pmAstromGridApply (psPlaneTransform *map, pmAstromStats stats);
+\end{prototype}
+This function modifies the supplied \code{map} entry assuming the
+adjustments are relative to the provided transformation.
+
+We define two additional functions which are used in
 \code{pmAstromGridMatch}, but which may be useful on their own:
 
 \begin{prototype}
-psArray *pmAstromGridMatchAngle (psArray *starlist1, psArray *starlist2, psMetadata *options);
+pmAstromStats pmAstromGridAngle (psArray *raw, psArray *ref, psMetadata *options);
 \end{prototype}
 This function is identical to \code{pmAstromGridMatch}, but is valid
@@ -939,10 +938,9 @@
 
 \begin{prototype}
-psArray *pmAstromRotateObj (psArray *old, double angle, double pCenter, double qCenter);
+psArray *pmAstromRotateObj (psArray *old, psPlane center, double angle);
 \end{prototype}
 This function accepts an array of \code{pmAstromObj} objects and
 rotates them by the given \code{angle} about the given center
-coordinate \code{pCenter,qCenter} in the Focal Plane Array
-coordinates.  
+coordinate \code{center} in the Focal Plane Array coordinates.
 
 \subsubsection{Astrometry Fitting Routines}
