Index: /trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- /trunk/doc/pslib/psLibSDRS.tex	(revision 4244)
+++ /trunk/doc/pslib/psLibSDRS.tex	(revision 4245)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.277 2005-06-14 03:07:19 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.278 2005-06-14 03:29:12 price Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -1369,5 +1369,5 @@
 \code{p_psError}.  The \code{code} is an enumerated type which lists
 the possible \textit{classes} of errors (e.g. \code{PS_ERR_IO}) that
-\PS{} code can generate (see section \ref{psErrorCodes}). The
+\PS{} code can generate (see section~\ref{psErrorCodes}). The
 \code{new} argument takes a boolean which, if \code{true} specifies
 that the error was set initially at this location, and if \code{false}
@@ -1686,5 +1686,5 @@
 
 All data items placed onto lists must have their reference counters
-(section \ref{secMemRefcounter}) incremented.  When elements are
+(section~\ref{secMemRefcounter}) incremented.  When elements are
 removed from a list, they must have their reference counters
 decremented.  The action of retrieving data from a list (with one of
@@ -2913,4 +2913,6 @@
 } psMath;
 \end{datatype}
+
+\tbd{Why do we need this?  Can't we use psMathType instead?}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2984,11 +2986,12 @@
 In this structure, the argument \code{n} is the length of the array
 (the number of elements); \code{nalloc} is the number of elements
-allocated ($nalloc \ge n$).  The allocated memory is available in the
-union \code{data} which consists of pointers to each of the defined
-primitive data types.  Note the parallelism in the names of the types,
-union elements, and the \code{psElemType} names.  This parallelism
-allows us to use automatic construction mechanisms effectively.  The
-data type is defined by the first element, \code{psMathType}.  The
-structure is associated with a constructor and reallocator:
+allocated (\code{nalloc} $\ge$ \code{n}).  The allocated memory is
+available in the union \code{data} which consists of pointers to each
+of the defined primitive data types.  Note the parallelism in the
+names of the types, union elements, and the \code{psElemType} names.
+This parallelism allows us to use automatic construction mechanisms
+effectively.  The data type is defined by the first element,
+\code{psMathType}.  The structure is associated with a constructor and
+reallocator:
 %
 \begin{prototype}
@@ -3020,9 +3023,10 @@
 \end{prototype}
 
-This function increments \code{psVector.n}, the number of elements in
-the vector by \code{nExtend}.  If the current length of the vector
-plus {\em twice} the number of new elements is greater than the
-allocated space, an additional \code{delta} elements are allocated.
-If the value of \code{delta} is less than 1, 10 shall be used.  
+This function increments \code{psVector.n} (the number of elements in
+the vector) by \code{nExtend}.  If the current length of the vector
+plus {\em twice} the number of new elements (\code{nExtend}) is
+greater than the allocated space, an additional \code{delta} elements
+are allocated.  If the value of \code{delta} is less than 1, 10 shall
+be used.
 
 Here is an example of how \code{psVectorExtend} is used to
@@ -3030,5 +3034,5 @@
 \begin{verbatim}
   // create data vector
-  psVector *y = psVectorAlloc (100);
+  psVector *y = psVectorAlloc(100);
   y->n = 0;
   for (int i = 0; i < 1000; i++) {
@@ -3036,6 +3040,6 @@
     y->data.F32[y->n + 1] = 2*i;
     y->data.F32[y->n + 2] = 2*i;
-    psVectorExtend (y, 100, 3);
-    // increments n by 1, extends length if needed by 100
+    y = psVectorExtend (y, 100, 3);
+    // increments n by 3, extends length by 100 if needed
   }
 \end{verbatim}
@@ -3092,4 +3096,5 @@
         psC32 **C32;                    ///< Pointers to complex floating-point data
         psC64 **C64;                    ///< Pointers to complex floating-point data
+	psPtr V;                        ///< Pointers to raw data
     } data;
     const struct psImage *parent;       ///< parent, if a subimage 
@@ -3102,20 +3107,25 @@
 pixels.  The size of this array is given by the elements
 \code{(numRows, numCols)}.  The data type of the pixel is defined in
-the \code{psMathType type} entry (specifically, the
-\code{psElemType} member, \code{type}; see \ref{sec:arithmetic}).
-(n.b. that for FITS images, these values are restricted to the
-datatypes equivalent to the valid BITPIX values 8, 16, 32, -32, -64).
-The image represented in the data structure may represent a subset of
-the pixels in a complete array, in which case the image is considered
-to be the child of that parent array.  The offset of the \code{(0,0)}
-pixel in this array relative to the parent array is given by the
-elements \code{(col0,row0)}: \code{col0} is the starting column number
-in the parent image while \code{row0} is the starting row number.  The
+the \code{psMathType type} entry (specifically, the \code{psElemType}
+member, \code{type}; see \S\ref{sec:arithmetic}).  (N.B.\ that for
+FITS images, these values are restricted to the datatypes equivalent
+to the valid BITPIX values 8, 16, 32, -32, -64).  The image
+represented in the data structure may represent a subset of the pixels
+in a complete array, in which case the image is considered to be the
+child of that parent array.  The offset of the \code{(0,0)} pixel in
+this array relative to the parent array is given by the elements
+\code{(col0,row0)}: \code{col0} is the starting column number in the
+parent image while \code{row0} is the starting row number.  The
 structure may include references to subrasters (\code{children})
 and/or to a containing array (\code{parent}).  Unless this image is a
 child of another image (represents a subset of the pixels of another
-image), the image data is allocated in a contiguous block.  We define
-the following supporting functions, which are valid for data types
-\code{psS8, psS16, psU8, psU16, psF32, psF64, psC32, psC64}.
+image), the image data is allocated in a contiguous block
+(\code{data.V}).
+
+\subsubsection{Support Functions}
+
+We define the following supporting functions for images, which are
+valid for data types \code{psS8, psS16, psU8, psU16, psF32, psF64,
+psC32, psC64}.
 
 \begin{prototype}
@@ -3126,6 +3136,4 @@
 types and not restrict to the valid FITS BITPIX types.  The image
 dimensionality must be 2.  
-
-\subsubsection{Support Functions}
 
 \begin{prototype}
@@ -3176,10 +3184,10 @@
 We define two functions to set and return the value of a
 \code{psRegion}.  The first defines the region by the corner
-coordinates.  The second function converts the IRAF description of a
-region in the form \code{[x0:x1,y0:y1]}, used for header entries such
-as \code{BIASSEC}, into the corresponding \code{psRegion} structure
-(any values that do not parse correctly shall be returned as
-\code{NaN}).  We also define a function that converts a
-\code{psRegion} to the corresponding IRAF description.
+coordinates.  The second function converts the IRAF description region
+in the form \code{[x0:x1,y0:y1]}, used for header entries such as
+\code{BIASSEC}, into the corresponding \code{psRegion} structure (any
+values that do not parse correctly shall be returned as \code{NaN}).
+We also define a function that converts a \code{psRegion} to the
+corresponding IRAF description.
 
 \begin{prototype}
