Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 7298)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 7388)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.397 2006-06-02 21:17:04 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.398 2006-06-07 04:06:37 price Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -936,6 +936,6 @@
 // structure to carry a dynamic string
 typedef struct {
-    int NLINE;			// allocated length
-    int Nline;			// current lenght
+    long NLINE;			// allocated length
+    long Nline;			// current lenght
     char *line;			// character string data
 } psLine;
@@ -944,5 +944,5 @@
 The following function allocates a line object of length Nline.
 \begin{prototype}
-psLine *psLineAlloc (int Nline);
+psLine *psLineAlloc(long Nline);
 \end{prototype}
 
@@ -951,5 +951,5 @@
 If the function is passed \code{NULL}, the function returns \code{false}.
 \begin{prototype}
-bool psLineInit (psLine *line);
+bool psLineInit(psLine *line);
 \end{prototype}
 
@@ -958,5 +958,5 @@
 length.
 \begin{prototype}
-bool psLineAdd (psLine *line, char *format, ...);
+bool psLineAdd(psLine *line, const char *format, ...);
 \end{prototype}
 
@@ -2922,10 +2922,15 @@
 
 \begin{prototype}
+psBool psMetadataItemParseBool(const psMetadataItem *item);
 psF32 psMetadataItemParseF32(psMetadataItem *item);
 psF64 psMetadataItemParseF64(psMetadataItem *item);
+psS8  psMetadataItemParseS8(const psMetadataItem *item);
+psS16 psMetadataItemParseS16(const psMetadataItem *item);
 psS32 psMetadataItemParseS32(psMetadataItem *item);
+psU8  psMetadataItemParseU8(const psMetadataItem *item);
+psU16 psMetadataItemParseU16(const psMetadataItem *item);
+psU32 psMetadataItemParseU32(const psMetadataItem *item);
 psString psMetadataItemParseString(psMetadataItem *item);
 \end{prototype}
-
 
 Items may be retrieved from the metadata by their entry position.  The
@@ -3002,11 +3007,15 @@
 \code{NULL}.
 
-The following functio copies a single metadata item from one
-psMetadata to another:
-\begin{prototype}
-bool psMetadataItemTransfer (psMetadata *out, // Destination: copy is placed here
-			     psMetadata *in,  // Source: item comes from here
-			     char *key        // key to identify the metadata item
-    );
+The following function copies a single metadata item, specified by the
+\code{key} from the \code{in} metadata to the \code{out} metadata:
+\begin{prototype}
+bool psMetadataItemTransfer(psMetadata *out, const psMetadata *in, const char *key);
+\end{prototype}
+
+\code{psMetadataItemCompare} shall compare two metadata items, returning
+\code{true} if the names, and values are the same.
+\begin{prototype}
+bool psMetadataItemCompare(const psMetadataItem *compare,
+                           const psMetadataItem *template);
 \end{prototype}
 
@@ -3602,5 +3611,5 @@
 steps of \code{delta}.  The upper-end value is {\em exclusive}; the
 sequence is equivalent to \code{for (x = lower; x < upper; x +=
-  delta)}.  
+  delta)}.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3815,6 +3824,5 @@
 \code{regions}
 \begin{prototype}
-bool psRegionIsBad(psRegion region);
-bool psRegionIsNaN (psRegion region);
+bool psRegionIsNaN(psRegion region);
 \end{prototype}
 
@@ -4509,4 +4517,17 @@
 }
 \end{verbatim}
+
+\subsection{Vector Operations}
+
+\begin{prototype}
+psVector *psVectorSmooth(psVector *output, const psVector *input,
+                         double sigma, double Nsigma);
+\end{prototype}
+
+\code{psVectorSmooth} shall apply Gaussian smoothing to the
+\code{input} vector, with the result in the \code{output} vector
+(which shall be allocated and returned if \code{NULL}).  The Gaussian
+shall be specified by a standard deviation, \code{sigma}, and extend
+\code{Nsigma} standard deviations.
 
 
@@ -5242,4 +5263,40 @@
 \code{psF32}, \code{psF64}.
 
+\subsubsection{Additional polynomial functions}
+
+\tbd{EAM to explain in more detail}
+
+\begin{prototype}
+psPolynomial4D *psVectorChiClipFitPolynomial4D(
+    psPolynomial4D *poly,
+    psStats *stats,
+    const psVector *mask,
+    psMaskType maskValue,
+    const psVector *f,
+    const psVector *fErr,
+    const psVector *x,
+    const psVector *y,
+    const psVector *z,
+    const psVector *t);
+\end{prototype}
+
+\code{psVectorChiClipFitPolynomial4D} shall perform a vector clip-fit
+of a \code{poly}nomial to the input data (\code{f,fErr,x,y,z,t}),
+based on significance of deviations
+
+\begin{prototype}
+psPolynomial2D *psImageBicubeFit (psImage *image, int x, int y);
+\end{prototype}
+
+\code{psImageBicubeFit} shall fit a 2D second order polynomial to the
+9 pixels centered on (\code{x},\code{y}).
+
+\begin{prototype}
+psPlane psImageBicubeMin (psPolynomial2D *poly);
+\end{prototype}
+
+\code{psImageBicubeMin} shall detemine the minimum of the special 2D
+second order polynomial.
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -5312,7 +5369,6 @@
 identical to a 180\degree\ rotation.
 \begin{prototype}
-psImage *psImageFlip(psImage *image,  // Image to flip
-                     bool xFlip,
-		     bool yFlip);
+psImage *psImageFlip(psImage *output, const psImage *image,
+                     bool xFlip, bool yFlip);
 \end{prototype}
 
@@ -5573,4 +5629,10 @@
 \code{psF64}.
 
+\tbd{Description required for psImageUnbin}
+\begin{prototype}
+psImage *psImageUnbin(psImage *out, psImage *in, int DX, int DY, int dx, int dy);
+\end{prototype}
+\tbd{Can ``out'' be NULL?  I'm not sure this is the best way to specify this function for a library.}
+
 
 \subsubsection{Image Statistical Functions}
@@ -5642,4 +5704,27 @@
 setup macro which pre-calculates certain values which would be reused
 in a loop.
+
+\begin{prototype}
+psStats *psImageBackground(const psImage *image, // Image for which to get the background
+                           const psImage *mask, // Mask image
+                           psMaskType maskValue, // Mask pixels which this mask value
+                           double fmin, // Fraction to return in the lower quartile field (0.25 for LQ)
+                           double fmax, // Fraction to return in the upper quartile field (0.75 for LQ)
+                           long nMax,   // Maximum number of pixels to subsample
+                           psRandom *rng // Random number generator (for pixel selection)
+    );
+\end{prototype}
+\code{psImageBackground} shall measure the median background level for
+the input \code{image} from a random subsample of pixels, with the
+median in the \code{robustMedian} of the returned \code{psStats}.  If
+\code{mask} is non-\code{NULL}, then pixels with a corresponding mask
+value with the \code{maskValue} set shall be excluded from the
+calculation.  A maximum of \code{nMax} pixels shall be selected
+randomly from the image, using the provided random number generator,
+\code{rng}.  The function shall also set the values for which the
+cumulative fractions are \code{fmin} and \code{fmax} in the
+\code{robustLQ} and \code{robustUQ} fields of the returned
+\code{psStats}, respectively.
+
 
 \subsubsection{Image Pixel Manipulations}
@@ -5739,5 +5824,4 @@
 \begin{datatype}
 typedef struct {
-    psString name;
     psVector *red;
     psVector *green;
@@ -6414,7 +6498,7 @@
 
 \begin{prototype}
-psEllipseAxes psEllipseMomentsToAxes (psEllipseMoments moments);
-psEllipseShape psEllipseAxesToShape (psEllipseAxes axes);
-psEllipseAxes psEllipseShapeToAxes (psEllipseShape shape);
+psEllipseAxes psEllipseMomentsToAxes(psEllipseMoments moments);
+psEllipseShape psEllipseAxesToShape(psEllipseAxes axes);
+psEllipseAxes psEllipseShapeToAxes(psEllipseShape shape);
 \end{prototype}
 
