Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 3067)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 3069)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.167 2005-01-20 03:46:48 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.168 2005-01-20 08:25:55 price Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -2717,7 +2717,19 @@
     PS_INTERPOLATE_BILINEAR, 
     PS_INTERPOLATE_BICUBIC, 
-    PS_INTERPOLATE_SINC 
+    PS_INTERPOLATE_SINC,
+    PS_INTERPOLATE_BILINEAR_VARIANCE,
+    PS_INTERPOLATE_BICUBIC_VARIANCE,
+    PS_INTERPOLATE_SINC_VARIANCE
 } psImageInterpolateMode mode;
 \end{verbatim}
+
+The first four are fairly straightforward.  The last three, however,
+require some explanation.  When attempting to account for noise in a
+CCD image, it is customary to carry an additional image containing the
+variance for each pixel.  When operating on the CCD image (performing
+some transformation), we want to perform the same operation on the
+variance image, but the weights of the different input pixels
+contributing to the output pixel must be squared in order to propagate
+the noise (adding in quadrature).
 
 \begin{verbatim}
@@ -2792,4 +2804,31 @@
 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64},
 \code{psC32}, \code{psC64}.
+
+\begin{verbatim}
+psImage *psImageTransform(psImage *output, const psImage *input, const psImage *inputMask, int inputMaskVal,
+                          const psPlaneTransform *outToIn, const psImage *combineMask, int combineMaskVal);
+\end{verbatim}
+Transform the \code{input} image according the supplied
+transformation.  In the event that the \code{output} is \code{NULL},
+the smallest possible image capable of containing the entire
+transformed \code{input} image is to be returned; otherwise only the
+image size specified in the \code{output} image is to be used.  If the
+\code{inputMask} is not \code{NULL}, those pixels in the
+\code{inputMask} matching \code{inputMaskVal} are to be ignored in the
+transformation.  The \code{inputMask} must be of type \code{psU8}, and
+of the same size as the \code{input}, otherwise the function shall
+generate an error and return \code{NULL}.  The transformation
+\code{outToIn} specifies the coordinates in the input image of a pixel
+in the output image --- note that this is the reverse of what might be
+naively expected, but it is what is required in order to use
+\code{psImagePixelInterpolate}.  If \code{combineMask} is not
+\code{NULL}, then those pixels that match \code{combineMaskVal} are
+not transformed.  \code{combineMask} must be of type \code{psU8} and
+of the same size as the \code{output}, otherwise the function shall
+generate an error and return \code{NULL}.  This function must be
+capable of handling the following types for the \code{input} (with
+corresponding types for the \code{output}): \code{psF32},
+\code{psF64}.
+
 
 \subsubsection{Image Statistical Functions}
@@ -4554,4 +4593,52 @@
                              float mag, float color);
 \end{verbatim}
+
+
+The following functions perform operations on transformations:
+
+\begin{verbatim}
+psPlaneTransform *psPlaneTransformInvert(psPlaneTransform *out, const psPlaneTransform *in, float xMin,
+                                         float xMax, float yMin, float yMax, int nSamples);
+psPlaneTransform *psPlaneTransformCombine(psPlaneTransform *out, const psPlaneTransform *trans1,
+                                          const psPlaneTransform *trans2);
+bool psPlaneTranformFit(psPlaneTransform *trans, const psArray *source, const psArray *dest, int nRejIter,
+                        float sigmaClip);
+\end{verbatim}
+
+\code{psPlaneTransformInvert} shall return the transformation that
+inverts the given transformation.  It may assume that the input
+transformation is one-to-one, and that the inverse transformation may
+be specified through using polynomials of the same type and order as
+the forward transformation.  In the event that the input
+transformation is linear, an exact solution may be calculated;
+otherwise \code{nSamples} samples in each axis, ranging from
+\code{xMin} to \code{xMax} and \code{yMin} to \code{yMax} shall be
+used as a grid to fit the best inverse transformation.  The function
+shall return \code{NULL} if it was unable to generate the inverse
+transformation; otherwise it shall return the inverse transformation.
+In the event that \code{out} is \code{NULL}, a new
+\code{psPlaneTransform} shall be allocated and returned.
+
+\code{psPlaneTransformSubsume} takes two transformations
+(\code{trans1} and \code{trans2}) and returns a single transformation
+that has the effect of performing \code{trans1} followed by
+\code{trans2}.  The function shall return \code{NULL} if it was unable
+to generate the transformation; otherwise it shall return the
+transformation.  \tbd{Not sure on the algorithm yet --- it may be the
+same as for \code{psPlaneTransformInvert}, in which case we will need
+the ranges and number of samples as well.}
+
+\code{psPlaneTransform} takes two arrays containing matched
+coordinates (i.e., coordinates the \code{source} correspond to the
+appropriate coordinates in the \code{dest}) and returns the
+best-fitting transformation.  The \code{source} and \code{dest} will
+contain \code{psCoord}s.  In the event that the number of coordinates
+in each is not identical, the function shall generate a warning, and
+extra coordinates in the longer of the two shall be ignored.  The
+\code{trans} transform may not be \code{NULL}, since it specifies the
+desired order, polynomial type and any polynomial terms to mask.
+\code{nRejIter} rejection iterations shall be performed, wherein
+coordinates lying more than \code{sigmaClip} standard deviations from
+the fit shall be rejected.
 
 \subsubsection{Celestial Coordinate Conversions}
