Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 1571)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 1592)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.81 2004-08-19 01:30:33 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.82 2004-08-19 04:32:24 price Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -1137,5 +1137,5 @@
 determine the type of the data on the basis of the data.  
 Supported data types must be defined by a structure in which
-the first element is always of type \code{psType}:  
+the first element is always of type \code{psType}:
 \begin{verbatim}
 typedef struct {
@@ -1171,5 +1171,5 @@
     PS_TYPE_C32,                        ///< Complex numbers consisting of floats
     PS_TYPE_C64,                        ///< Complex numbers consisting of doubles
-    PS_TYPE_OTHER,                      ///< Not supported for arithmetic
+    PS_TYPE_OTHER                       ///< Not supported for arithmetic
 } psElemType;
 \end{verbatim}
@@ -1248,10 +1248,9 @@
 to use automatic construction mechanisms effectively.  The data type
 is defined by the first element, \code{psType}.  The structure is
-associated with a constructor and a destructor:
+associated with a constructor and reallocator:
 %
 \begin{verbatim}
 psVector *psVectorAlloc(int nalloc, psElemType type);
 psVector *psVectorRealloc(const psVector *vector, int nalloc);
-void p_psVectorFree(psVector *restrict vector);
 \end{verbatim}
 %
@@ -1327,10 +1326,4 @@
 dimensionality must be 2.  
 
-\begin{verbatim}
-void p_psImageFree(psImage *restrict image);
-\end{verbatim}
-Free the memory associated with a specific image, including the pixel
-data. Free the children of the image if they exist.
-
 \subsection{Simple Arrays}
 
@@ -1355,7 +1348,6 @@
 %
 \begin{verbatim}
-psArray *psArrayAlloc(int nalloc, psElemType type);
+psArray *psArrayAlloc(int nalloc);
 psArray *psArrayRealloc(const psArray *array, int nalloc);
-void p_psArrayFree(psArray *restrict array);
 \end{verbatim}
 %
@@ -1409,5 +1401,5 @@
    struct psListElem *prev;            ///< previous link in list
    struct psListElem *next;            ///< next link in list
-   void *data;                          ///< real data item
+   void *data;                         ///< real data item
 } psListElem;
 \end{verbatim}
@@ -1427,4 +1419,7 @@
 \code{NULL}, then an empty list, with both pointers are set to
 \code{NULL} should be created.
+
+The destructor function for \code{psList} must free the data
+associated with the entire list.
 
 \begin{verbatim}
@@ -1469,10 +1464,4 @@
 data from a list (with \code{psListGet}) also increments the reference
 counter.
-
-\begin{verbatim}
-void p_psListFree(psList *list);
-\end{verbatim}
-This function frees the data associated with the entire list.  This
-function is used by psFree to free a list with its associated data.
 
 \begin{verbatim}
@@ -1534,6 +1523,6 @@
 \begin{verbatim}
 typedef struct {
-    int nbucket;                        // number of buckets
-    psHashBucket **buckets;             // the buckets themselves
+    int nbucket;                        ///< number of buckets
+    psHashBucket **buckets;             ///< the buckets themselves
 } psHash;
 \end{verbatim}
@@ -1545,7 +1534,7 @@
 \begin{verbatim}
 typedef struct psHashBucket {
-    char *key;                          // key for this item of data
-    void *data;                         // the data itself
-    struct psHashBucket *next;          // list of other possible keys
+    char *key;                          ///< key for this item of data
+    void *data;                         ///< the data itself
+    struct psHashBucket *next;          ///< list of other possible keys
 } psHashBucket;
 \end{verbatim}
@@ -1561,7 +1550,9 @@
 the buckets.
 
+The destructor for \code{psHash} must free all data associated with a complete hash table.
+
 A data item may be added to the hash table with the function:
 \begin{verbatim}
-bool psHashAdd(psHash *table, char *key, void *data);
+bool psHashAdd(psHash *table, const char *key, void *data);
 \end{verbatim}
 In this function, the value of the string \code{key} is used to
@@ -1574,5 +1565,5 @@
 The data associated with a given key may be found with the function:
 \begin{verbatim}
-void *psHashLookup(psHash *table, char *key);
+void *psHashLookup(psHash *table, const char *key);
 \end{verbatim}
 which returns the data value pointed to by the element associated with
@@ -1580,13 +1571,8 @@
 a specific key may be removed (deleted) with the function:
 \begin{verbatim}
-bool psHashRemove(psHash *table, char *key);
+bool psHashRemove(psHash *table, const char *key);
 \end{verbatim}
 The function returns a value of \code{true} if the operation was
 successfull, and \code{false} otherwise.
-
-The data associated with a complete hash table may be freed by calling:
-\begin{verbatim}
-void p_psHashFree(psHash *table);
-\end{verbatim}
 
 The function
@@ -1636,5 +1622,4 @@
 \begin{verbatim}
 psBitSet *psBitSetAlloc(int n);
-void p_psBitSetFree(psBitSet *restrict myBits);
 \end{verbatim}
 where \code{n} is the requested number of bits.
@@ -1650,11 +1635,11 @@
 
 \begin{verbatim}
-psBitSet *psBitSetSet(psBitSet *restrict myBits, int bit);
+psBitSet *psBitSetSet(psBitSet *myBits, int bit);
 psBitSet *psBitSetOp(psBitSet *outBits, 
-                     const psBitSet *restrict inBits1,
+                     const psBitSet *inBits1,
                      char *operator, 
-                     const psBitSet *restrict inBits2);
+                     const psBitSet *inBits2);
 psBitSet *psBitSetNot(psBitSet *out, psBitSet *in);
-bool psBitSetTest(const psBitSet *restrict checkBits, int bit);
+bool psBitSetTest(const psBitSet *checkBits, int bit);
 \end{verbatim}
 
@@ -1689,5 +1674,5 @@
 
 \begin{verbatim}
-psVector *psVectorSort(psVector *out, const psVector *restrict in);
+psVector *psVectorSort(psVector *out, const psVector *in);
 \end{verbatim}
 
@@ -1703,5 +1688,5 @@
 
 \begin{verbatim}
-psVector *psVectorSortIndex(psVector *restrict out; const psVector *restrict in);
+psVector *psVectorSortIndex(psVector *out; const psVector *in);
 \end{verbatim}
 
@@ -1748,6 +1733,6 @@
 \begin{verbatim}
 psStats *psVectorStats(psStats *stats,
-                       const psVector *restrict in, 
-                       const psVector *restrict mask, 
+                       const psVector *in, 
+                       const psVector *mask, 
                        unsigned int maskVal);
 \end{verbatim}
@@ -1783,5 +1768,4 @@
     double sampleUQ;                    ///< upper quartile of sample
     double sampleLQ;                    ///< lower quartile of sample
-    double sampleLimit;                 ///< Number of datapoints to 
     double robustMean;                  ///< robust mean of data
     double robustMedian;                ///< robust median of data
@@ -1827,9 +1811,8 @@
 \end{verbatim}
 
-Associated constructors and destructors are also required:
-
+A constructor is also required:
+%
 \begin{verbatim}
 psStats *psStatsAlloc(psStatsOptions options);
-void p_psStatsFree(psStats *restrict stats);
 \end{verbatim}
 
@@ -1842,8 +1825,8 @@
 \begin{verbatim}
 typedef struct {
-    const psVector *restrict bounds;    ///< Bounds for the bins
+    const psVector *bounds;             ///< Bounds for the bins
     psVector *nums;                     ///< Number in each of the bins
     int minNum, maxNum;                 ///< Number below minimum / above maximum
-    bool uniform;                        ///< Is it a uniform distribution?
+    bool uniform;                       ///< Is it a uniform distribution?
 } psHistogram;
 \end{verbatim}
@@ -1872,5 +1855,5 @@
 following constructor:
 \begin{verbatim}
-psHistogram *psHistogramAllocGeneric(const psVector *restrict bounds);
+psHistogram *psHistogramAllocGeneric(const psVector *bounds);
 \end{verbatim}
 where the \code{psVector *bounds} (of type \code{psF32}) is defined by
@@ -1878,9 +1861,4 @@
 constructor sets the value of \code{uniform} to be false.
 
-A histogram is free with the destructor:
-\begin{verbatim}
-void p_psHistogramFree(psHistogram *restrict myHist);
-\end{verbatim}
-
 The following function populates the histogram bins from the specified
 vector (\code{in}).  It alters and returns the histogram \code{out}
@@ -1888,6 +1866,6 @@
 \begin{verbatim}
 psHistogram *psVectorHistogram(psHistogram *out, 
-                               const psVector *restrict in,
-                               const psVector *restrict mask,
+                               const psVector *in,
+                               const psVector *mask,
                                unsigned int maskVal);
 \end{verbatim}
@@ -1942,5 +1920,4 @@
 
 \begin{verbatim}
-/** Type of polynomial */
 typedef enum {
     PS_POLYNOMIAL_ORD,			///< Ordinary polynomial
@@ -1977,8 +1954,7 @@
 naming convention exampled above.
 
-The constructor and destructor are:
+The constructor is:
 \begin{verbatim}
 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY, psPolynomialType type);
-void p_psDPolynomial2DFree(psDPolynomial2D *restrict myPoly);
 \end{verbatim}
 where \code{nX} and \code{nY} are the number of terms in x and y
@@ -1992,5 +1968,6 @@
 In the event that several evaluations are required, we also define:
 \begin{verbatim}
-psVector *psDPolynomial2DEvalVector(psVector *x, psVector *y, const psDPolynomial2D *restrict myPoly);
+psVector *psDPolynomial2DEvalVector(const psVector *x, const psVector *y,
+                                    const psDPolynomial2D *myPoly);
 \end{verbatim}
 If the \code{x} and \code{y} vectors do not match the precision of the
@@ -2010,8 +1987,7 @@
 
 \begin{verbatim}
-/** A 1D cubic-spline */
 typedef struct {
     int n;                              ///< Number of spline pieces
-    psPolynomial1D *spline;		///< Array of n splines
+    psPolynomial1D **spline;		///< Array of n pointers to splines
     float *domains;                     ///< The boundaries between each spline piece.  Size is n+1.
 } psSpline1D;
@@ -2055,5 +2031,5 @@
 \begin{verbatim}
 float psSpline1DEval(const psSpline1D *spline, float x);
-psVector *psSpline1DEvalVector(psVector *x, const psSpline1D *spline);
+psVector *psSpline1DEvalVector(const psVector *x, const psSpline1D *spline);
 \end{verbatim}
 
@@ -2274,8 +2250,8 @@
 
 \begin{verbatim}
-psPolynomial1D *psVectorFitPolynomial1D(psPolynomial1D *myPoly, 
-                                        const psVector *restrict x,
-                                        const psVector *restrict y,
-                                        const psVector *restrict yErr);
+psPolynomial1D *psVectorFitPolynomial1D(psPolynomial1D *myPoly,
+                                        const psVector *x,
+                                        const psVector *y,
+                                        const psVector *yErr);
 \end{verbatim}
 \code{psVectorFitPolynomial1d} returns the polynomial that best fits the
@@ -2329,5 +2305,5 @@
 
 \begin{verbatim}
-psImage *psImageSubsection(const psImage *image, const *section);
+psImage *psImageSubsection(const psImage *image, const char *section);
 \end{verbatim}
 Similar to \code{psImageSubset}, but uses an image \code{section}, of
@@ -2365,14 +2341,14 @@
 \begin{verbatim}
 typedef enum {
-    PS_CUT_X_POS;
-    PS_CUT_X_NEG;
-    PS_CUT_Y_POS;
-    PS_CUT_Y_NEG;
+    PS_CUT_X_POS,
+    PS_CUT_X_NEG,
+    PS_CUT_Y_POS,
+    PS_CUT_Y_NEG
 } psImageCutDirection;
 
 psVector *psImageSlice(psVector *out, 
                        psVector *coords,
-                       const psImage *restrict input, 
-                       const psImage *restrict mask, 
+                       const psImage *input, 
+                       const psImage *mask, 
                        unsigned int maskVal,
                        unsigned int x, 
@@ -2399,5 +2375,5 @@
 \begin{verbatim}
 psVector *psImageCut(psVector *out, const psImage *input, 
-                     const psImage *restrict mask, 
+                     const psImage *mask, 
                      unsigned int maskVal,
                      float xs, float ys, float xe, float ye, 
@@ -2420,5 +2396,5 @@
 \begin{verbatim}
 psVector *psImageRadialCut(psVector *out, const psImage *input, 
-                           const psImage *restrict mask, 
+                           const psImage *mask, 
                            unsigned int maskVal,
                            float x, float y,
@@ -2485,5 +2461,6 @@
 
 \begin{verbatim}
-psImage *psImageRotate(psImage *out, const psImage *input, float angle, psC64 exposed, psImageInterpolateMode mode);
+psImage *psImageRotate(psImage *out, const psImage *input, float angle,
+                       psC64 exposed, psImageInterpolateMode mode);
 \end{verbatim}
 Rotate the input image by given angle, specified in degrees.  The
@@ -2525,6 +2502,6 @@
 \begin{verbatim}
 psStats *psImageStats(psStats *stats, 
-                      const psImage *restrict in,
-                      const psImage *restrict mask,
+                      const psImage *in,
+                      const psImage *mask,
 		      unsigned int maskVal);
 \end{verbatim}
@@ -2538,6 +2515,6 @@
 \begin{verbatim}
 psHistogram *psImageHistogram(psHistogram *out, 
-                              const psImage *restrict in, 
-                              const psImage *restrict mask, 
+                              const psImage *in, 
+                              const psImage *mask, 
 			      unsigned int maskVal);
 \end{verbatim}
@@ -2566,5 +2543,6 @@
 
 \begin{verbatim}
-psF64 psImagePixelInterpolate (const psImage *input, float x, float y, psC64 unexposedValue, psImageInterpolateMode mode);
+psF64 psImagePixelInterpolate (const psImage *input, float x, float y,
+                               psC64 unexposedValue, psImageInterpolateMode mode);
 \end{verbatim}
 Perform interpolation of image pixel values to the given fractional
@@ -2649,5 +2627,6 @@
 
 \begin{verbatim}
-int psImageClipComplexRegion(psImage *input, complex double min, complex double vmin, complex double max, complex double vmax);
+int psImageClipComplexRegion(psImage *input, complex double min, complex double vmin,
+                             complex double max, complex double vmax);
 \end{verbatim}
 Clip image values outside of range to given values.  All pixels with
@@ -2791,5 +2770,5 @@
 
 \begin{verbatim}
-psImage *psMatrixInvert(psImage *out, const psImage *in, float *restrict determinant);
+psImage *psMatrixInvert(psImage *out, const psImage *in, float *determinant);
 \end{verbatim}
 \code{psMatrixInvert} returns the inverse of the specified matrix
@@ -2803,5 +2782,5 @@
 types \code{psF32, psF64}.
 \begin{verbatim}
-float psMatrixDeterminant(const psImage *restrict in);
+float psMatrixDeterminant(const psImage *in);
 \end{verbatim}
 
@@ -2833,6 +2812,6 @@
 should match.
 \begin{verbatim}
-psVector *psMatrixToVector(psVector *out, psImage *in);
-psImage *psVectorToMatrix(psImage *out, psVector *in);
+psVector *psMatrixToVector(psVector *out, const psImage *in);
+psImage *psVectorToMatrix(psImage *out, const psVector *in);
 \end{verbatim}
 
@@ -3079,5 +3058,5 @@
 
 \begin{verbatim}
-psTime *psTimeGetTime(psTimeType);
+psTime *psTimeGetTime(psTimeType type);
 \end{verbatim}
 
@@ -3089,5 +3068,6 @@
 \end{verbatim}
 This function may be used to convert between \code{PS_TIME_TAI} and
-\code{PS_TIME_UTC} time representations.  
+\code{PS_TIME_UTC} time representations.  The \code{time} is modified
+and returned.
 
 To convert to or from Local Mean Sidereal Time, it is necessary to
@@ -3096,15 +3076,16 @@
 \begin{verbatim}
 psTime *psTimeToLST(psTime *time, double longitude);
-psTime *psLSTToTime(psTime *time, double longitude);
-\end{verbatim}
-%
-The functions may accept either \code{psTimeType}.  Note that this
-function must supply the value UT1-UTC, which is available externally
-The value UT1-UTC is necessary for this an various other SLALIB
-functions.  The following utility function encapsulates the PSLib
-mechanism to extract the value of UT1-UTC:
-\begin{verbatim}
-double psGetUT1Delta(psTime *time);
-psSphere *psGetPoleCoords(psTime *time);
+psTime *psTimeFromLST(psTime *time, double longitude);
+\end{verbatim}
+%
+The functions may accept either \code{psTimeType}.  The \code{time} is
+modified and returned.  Note that this function must supply the value
+UT1-UTC, which is available externally.  The value UT1-UTC is
+necessary for this an various other SLALIB functions.  The following
+utility function encapsulates the PSLib mechanism to extract the value
+of UT1-UTC:
+\begin{verbatim}
+double psTimeGetUT1Delta(const psTime *time);
+psSphere *psTimeGetPoleCoords(const psTime *time);
 \end{verbatim}
 
@@ -3115,8 +3096,8 @@
 
 \begin{verbatim}
-psF64 psTimeToJD(psTime *time);
-psF64 psTimeToMJD(psTime *time);
-char *psTimeToISOTime(psTime *time);
-struct timeval *psTimeToTimeval(psTime *time);
+psF64 psTimeToJD(const psTime *time);
+psF64 psTimeToMJD(const psTime *time);
+char *psTimeToISOTime(const psTime *time);
+timeval *psTimeToTimeval(const psTime *time);
 \end{verbatim}
 
@@ -3127,19 +3108,22 @@
 
 \begin{verbatim}
-psTime *psJDToTime(psF64 input);
-psTime *psMJDToTime(psF64 input);
-psTime *psISOTimeToTime(char *input);
-psTime *psTimevalToTime(struct timeval *input);
+psTime *psTimeFromJD(psF64 input);
+psTime *psTimeFromMJD(psF64 input);
+psTime *psTimeFromISO(const char *input);
+psTime *psTimeFromTimeval(const timeval *input);
 \end{verbatim}
 
 \subsubsection{Date and Time Math}
 
+\begin{verbatim}
+psTime *psTimeAdd(const psTime *tai1, psF64 delta);
+psF64 psTimeSubtract(const psTime *time1, const psTime *time2);
+psF64 psTimeDelta(const psTime *time1, const psTime *time2);
+\end{verbatim}
+\code{psTimeAdd} adds some time to a \code{psTime}.
+\code{psTimeSubtract} subtracts two times.  \code{psTimeDelta} gives
+the absolute time difference between two times.
+
 Time math is only done on the \code{psTime} TAI type.
-
-\begin{verbatim}
-psTime *psTAIAdd(psTime *tai1, psTime *tai2);
-psTime *psTAISub(psTime *tai1, psTime *tai2);
-psTime *psTAIDelta(psTime *tai1, psTime *tai2);
-\end{verbatim}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3260,5 +3244,5 @@
 typedef struct {
     const int id;                       ///< unique ID for this item
-    char *restrict name;                ///< Name of item
+    const char *name;                   ///< Name of item
     psMetadataType type;                ///< type of this item
     const union {
@@ -3269,5 +3253,5 @@
     } data;                             ///< value of metadata
     char *comment;                      ///< optional comment ("", not NULL)
-    psList *restrict items;            ///< list of psMetadataItems with the same name
+    psList *items;                      ///< list of psMetadataItems with the same name
 } psMetadataItem;
 \end{verbatim}
@@ -3301,6 +3285,6 @@
 \begin{verbatim}
 typedef struct {
-    psList *restrict list;             ///< list of psMetadataItem
-    psHash *restrict table;             ///< hash table of the same metadata
+    psList *list;                       ///< list of psMetadataItem
+    psHash *table;                      ///< hash table of the same metadata
 } psMetadata;
 \end{verbatim}
@@ -3356,14 +3340,4 @@
 \end{verbatim}
 
-The \code{psMetadataItem} destructor is specified below.  Note that
-the destructor for \code{psMetadataItem} must call the appropriate
-destructor for the \code{data.item} (recall that it is the duty of the
-\code{psMyTypeFree}s to decrement the \code{refCounter} and free the
-memory if and only if the \code{refCounter == 1} --- see
-\S\ref{sec:free}).
-\begin{verbatim}
-void p_psMetadataItemFree(psMetadataItem *item);
-\end{verbatim}
-
 The constructor for the collection of metadata, \code{psMetadata},
 simply returns an empty metadata container (employing the constructors
@@ -3372,5 +3346,4 @@
 \begin{verbatim}
 psMetadata *psMetadataAlloc(void);
-void p_psMetadataFree(psMetadata *md);
 \end{verbatim}
 
@@ -3389,8 +3362,6 @@
 %
 \begin{verbatim}
-bool psMetadataAddItem(psMetadata *restrict md, int where,
-                       psMetadataItem *restrict item);
-bool psMetadataAdd(psMetadata *restrict md, int where, 
-                   const char *name, int format, const char *comment, ...);
+bool psMetadataAddItem(psMetadata *md, int where, psMetadataItem *item);
+bool psMetadataAdd(psMetadata *md, int where, const char *name, int format, const char *comment, ...);
 \end{verbatim}
 
@@ -3405,5 +3376,5 @@
 %
 \begin{verbatim}
-bool psMetadataRemove(psMetadata *restrict md, int where, const char *restrict key);
+bool psMetadataRemove(psMetadata *md, int where, const char *key);
 \end{verbatim}
 
@@ -3411,6 +3382,5 @@
 event that the key is non-unique, the first item is returned.
 \begin{verbatim}
-psMetadataItem *psMetadataLookup(const psMetadata *restrict md, 
-                                 const char *restrict key);
+psMetadataItem *psMetadataLookup(const psMetadata *md, const char *key);
 \end{verbatim}
 
@@ -3419,5 +3389,5 @@
 \code{psList}.
 \begin{verbatim}
-psMetadataItem *psMetadataGet(const psMetadata *restrict md, int which);
+psMetadataItem *psMetadataGet(const psMetadata *md, int which);
 \end{verbatim}
 
@@ -3434,6 +3404,6 @@
 \begin{verbatim}
 void psMetadataSetIterator(psMetadata *md, int where);
-psMetadataItem *psMetadataGetNext(psMetadata *restrict md, const char *restrict match, int which);
-psMetadataItem *psMetadataGetPrevious(psMetadata *restrict md, const char *restrict match, int which);
+psMetadataItem *psMetadataGetNext(psMetadata *md, const char *match, int which);
+psMetadataItem *psMetadataGetPrevious(psMetadata *md, const char *match, int which);
 \end{verbatim}
 
@@ -3447,10 +3417,10 @@
 data type, printing is not allowed.
 \begin{verbatim}
-void psMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *restrict md);
+void psMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *md);
 \end{verbatim}
 
 \begin{verbatim}
 psMetadata *psMetadataReadHeader(psMetadata *output, const char *extname, 
-                              int extnum, const char *filename);
+                                 int extnum, const char *filename);
 \end{verbatim}
 Read header data from a FITS image file into a \code{psMetadata}
@@ -3462,5 +3432,5 @@
 \begin{verbatim}
 psMetadata *psMetadataFReadHeader(psMetadata *output, const char *extname, 
-                               int extnum, FILE *f);
+                                  int extnum, FILE *f);
 \end{verbatim}
 Read header data from a FITS image file descriptor into a
@@ -3587,11 +3557,11 @@
 %
 \begin{verbatim}
-psPlane *psPlaneTransformApply (psPlane *out, 
-                                const psPlaneTransform *transform, 
-                                const psPlane *coords);
-psPlane *psPlaneDistortApply (psPlane *out, 
-                              const psPlaneDistort *distort, 
-                              const psPlane *coords, 
-                              float term3, float term4);
+psPlane *psPlaneTransformApply(psPlane *out, 
+                               const psPlaneTransform *transform, 
+                               const psPlane *coords);
+psPlane *psPlaneDistortApply(psPlane *out, 
+                             const psPlaneDistort *distort, 
+                             const psPlane *coords, 
+                             float mag, float color);
 \end{verbatim}
 
@@ -3624,8 +3594,7 @@
 \end{verbatim}
 
-The constructor and destructor are defined as follows:
+The constructor is defined as follows:
 \begin{verbatim}
 psSphereTransform *psSphereTransformAlloc(double NPlon, double NPlat, double ZP);
-void p_psSphereTransformFree(psSphereTransform *trans);
 \end{verbatim}
 where \code{NPlon} and \code{NPlat} define the coordinates in the
@@ -3666,5 +3635,4 @@
 \item AIT
 \item PAR
-\item GLS
 \end{itemize}
 
@@ -3712,24 +3680,24 @@
 
 \begin{verbatim}
-psSphere *psSphereGetOffset(const psSphere *restrict position1, 
-                            const psSphere *restrict position2, 
+psSphere *psSphereGetOffset(const psSphere *position1, 
+                            const psSphere *position2, 
                             psSphereOffsetMode mode,
                             psSphereOffsetUnit unit);
 
-psSphere *psSphereSetOffset(const psSphere *restrict position,
-                            const psSphere *restrict offset,
+psSphere *psSphereSetOffset(const psSphere *position,
+                            const psSphere *offset,
                             psSphereOffsetMode mode,
                             psSphereOffsetUnit unit);
 
 typedef enum {
- PS_SPHERICAL;
- PS_LINEAR;
+    PS_SPHERICAL;			///< Offset on a sphere
+    PS_LINEAR;				///< Linear offset
 } psSphereOffsetMode;
 
 typedef enum {
- PS_ARCSEC;
- PS_ARCMIN;
- PS_DEGREE;
- PS_RADIAN;
+    PS_ARCSEC;				///< Arcseconds
+    PS_ARCMIN;				///< Arcminutes
+    PS_DEGREE;				///< Degrees
+    PS_RADIAN;				///< Radians
 } psSphereOffsetUnit;
 \end{verbatim}
@@ -3814,23 +3782,20 @@
 \subsubsection{Positions of Major SS Objects}
 
-We require the ability to calculate the position of major Solar System
-objects, as well as Lunar phase.  These functions all take the
-specified modified julian date, \code{mjd}, and the latitude/longitude
-of the observer.
-
-\begin{verbatim}
-psSphere *psSunGetPos(psTime time);
-psTime *psSunGetRise (psTime *twi15, psTime *twi18, psTime time);
-psTime *psSunGetSet (psTime *twi15, psTime *twi18, psTime time);
+\tbd{We require the ability to calculate the position of major Solar System
+objects, as well as Lunar phase.}
+
+\begin{verbatim}
+psSphere *psSunGetPos(psTime *time);
+psTime *psSunGetRise (psTime *twi15, psTime *twi18, const psTime *time);
+psTime *psSunGetSet (psTime *twi15, psTime *twi18, const psTime *time);
 
 psSphere *psMoonGetPos(psTime time, psSphere location);
-psTime *psMoonGetRise (psTime *twi15, psTime *twi18, psTime time);
-psTime *psMoonGetSet (psTime *twi15, psTime *twi18, psTime time);
+psTime *psMoonGetRise (psTime *twi15, psTime *twi18, psTime *time);
+psTime *psMoonGetSet (psTime *twi15, psTime *twi18, psTime *time);
 float psGetMoonPhase(psTime time);
 
 psSphere *psPlanetGetPos(psTime time, psSphere location);
-psTime *psPlanetGetRise (psTime *twi15, psTime *twi18, psTime time);
-psTime *psPlanetGetSet (psTime *twi15, psTime *twi18, psTime time);
-
+psTime *psPlanetGetRise (psTime *twi15, psTime *twi18, psTime *time);
+psTime *psPlanetGetSet (psTime *twi15, psTime *twi18, psTime *time);
 \end{verbatim}
 
