Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 2383)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 2502)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.153 2004-11-18 23:54:32 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.154 2004-11-27 01:48:23 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -19,4 +19,7 @@
 \maketitle
 \sloppy
+
+% make a margin comment:
+% \marginpar{note!}
 
 % -- Revision History --
@@ -35,5 +38,6 @@
 06 & 2004 Aug 19 & revision for cycle 3 \\ \hline
 07 & 2004 Sep 07 & final for cycle 3 \\ \hline
-08 & 2004 Oct 12 & draft for start of cycle 4 \\
+08 & 2004 Oct 12 & draft for start of cycle 4 \\ \hline
+09 & 2004 Nov 15 & final for cycle 4 \\
 \RevisionsEnd
 
@@ -307,4 +311,5 @@
 follows:
 %
+\filbreak
 \begin{verbatim}
 typedef struct {
@@ -700,4 +705,5 @@
 reference counter and returns.}  An example destructor is shown below:
 
+\filbreak
 \begin{verbatim}
 void psMyTypeFree(psMyType *myType)
@@ -1466,4 +1472,14 @@
 
 \begin{verbatim}
+psArray *psArrayAdd(psArray *array, int delta, void *value);
+\end{verbatim}
+
+This function adds a value to the end of an array.  If the current
+length of the array (\code{psArray.n}) is at the limit of the
+allocated space, additional space is allocated.  The value of
+\code{delta} defines how many elements to add on each pass (if this
+value is less than 1, 10 shall be used).
+
+\begin{verbatim}
 psArray *psArraySort(psArray *array, int (*compare)(const void **a, const void **b) );
 \end{verbatim}
@@ -1646,6 +1662,6 @@
 
 \begin{verbatim}
-psArray *psListToArray(psList *list);
-psList  *psArrayToList(psArray *array);
+psArray *psArrayFromList(psList *list);
+psList  *psListFromArray(psArray *array);
 \end{verbatim}
 These two functions are available to convert between the
@@ -1746,4 +1762,14 @@
 returns the complete list of defined keys associated with the
 \code{psHash} table as a linked list.
+
+\begin{verbatim}
+psArray *psArrayFromHash(psHash *hash);
+\end{verbatim}
+This function is available place the data in a \code{psHash} into a
+\code{psArray} container.  This function does not free the elements or
+destroy the input collection.  Rather, it increments the reference
+counter for each of the elements.  The resulting array does not have
+any information about the has key values, and the order is not
+significant.
 
 \subsection{Lookup Tables}
@@ -2120,5 +2146,5 @@
 psHistogram *psVectorHistogram(psHistogram *out, 
                                const psVector *values,
-			       const psVector *errors,
+                               const psVector *errors,
                                const psVector *mask,
                                unsigned int maskVal);
@@ -2367,5 +2393,5 @@
 bool psMinimizeLMChi2(psMinimization *min, psImage *covar, psVector *params,
                       const psVector *paramMask, const psArray *x, const psVector *y,
-		      const psVector *yErr, psMinimizeLMChi2Func func);
+                      const psVector *yErr, psMinimizeLMChi2Func func);
 \end{verbatim}
 
@@ -3738,4 +3764,5 @@
 
 We define an item of metadata with the following structure:
+\filbreak
 \begin{verbatim}
 typedef struct {
@@ -3767,4 +3794,5 @@
 \code{psMetadataType}:
 %
+\filbreak
 \begin{verbatim}
 typedef enum {                          ///< type of item.data is:
@@ -3889,4 +3917,14 @@
 \end{verbatim}
 
+Several utility functions are provided for simple cases.  These
+functions perform the effort of casting the data to the appropriate
+type.  The numerical functions shall return 0.0 if their key is not
+found.
+\begin{verbatim}
+void *psMetadataLookupPtr(const psMetadata *md, const char *key);
+psS32 psMetadataLookupS32(const psMetadata *md, const char *key);
+psF64 psMetadataLookupF64(const psMetadata *md, const char *key);
+\end{verbatim}
+
 Items may be retrieved from the metadata by their entry position.  The
 value of which specifies the desired entry in the fashion of
@@ -4015,4 +4053,5 @@
 
 Here are some examples of lines of a valid configuration file:
+\filbreak
 \begin{verbatim}
 Double     F64     1.23456789      # This is a comment
@@ -4064,4 +4103,20 @@
 Figure~\ref{fig:metadata}.
 
+We further extend \code{psMetadataParseConfig} to allow the definition
+of a \code{psMetadata} entry using a sequence of successive lines to
+define the values of the \code{psMetadataItem} entries.  The initial
+line defines the new \code{psMetadata} entry and its name.  The
+following lines have the same format as the other metadata config file
+entries.  The sequence is terminated with a line with a single word
+\code{END}.  For example, a metadata entry may be defined as:
+\begin{verbatim}
+CELL      METADATA
+ EXTNAME   STR   CCD00
+ BIASSEC   STR   BSEC-00
+ CHIP      STR   CHIP.00
+ NCELL     S32   24
+END
+\end{verbatim}
+
 A BNF-like grammar of the configuration file is contained in
 \S\ref{sec:configgrammar}.
@@ -4151,5 +4206,5 @@
 
 \begin{verbatim}
-psHash *psFitsReadHeaderSet (psFits *fits);
+psMetadata *psFitsReadHeaderSet (psFits *fits);
 \end{verbatim}
 Load a complete set of headers from the \code{psFits} file pointer.
