Index: /trunk/archive/pslib/include/Doxyfile
===================================================================
--- /trunk/archive/pslib/include/Doxyfile	(revision 256)
+++ /trunk/archive/pslib/include/Doxyfile	(revision 257)
@@ -564,5 +564,5 @@
 # Windows users are probably better off using the HTML help feature.
 
-GENERATE_TREEVIEW      = NO
+GENERATE_TREEVIEW      = YES
 
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
Index: /trunk/archive/pslib/include/psAstrom.h
===================================================================
--- /trunk/archive/pslib/include/psAstrom.h	(revision 256)
+++ /trunk/archive/pslib/include/psAstrom.h	(revision 257)
@@ -127,9 +127,10 @@
     
 
-/*** Functions ***********************************************************************/
-
-/***********************************************************************************************************/
-
-/* Calculating and applying astrometric solutions */
+/** Functions **************************************************************/
+/** \addtogroup AstroGroup Astronomy-Specific Utilities
+ *  \{
+ */
+
+/*** Calculating and applying astrometric solutions ***/
 
 /** returns Chip in FPA which contains the given FPA coordinate */
@@ -236,4 +237,6 @@
 psExposureFree(psExposure *restrict myExp //!< Object to destroy
 	       );
+/* \} */ // End of AstroGroup Functions
+
 #endif
 
Index: /trunk/archive/pslib/include/psBitMask.h
===================================================================
--- /trunk/archive/pslib/include/psBitMask.h	(revision 256)
+++ /trunk/archive/pslib/include/psBitMask.h	(revision 257)
@@ -12,4 +12,9 @@
     char *bits;				//!< The bits
 } psBitMask;
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
+ */
 
 /** Constructor */
@@ -44,3 +49,5 @@
     );
 
+/* \} */ // End of MathGroup Functions
+
 #endif 
Index: /trunk/archive/pslib/include/psDateTime.h
===================================================================
--- /trunk/archive/pslib/include/psDateTime.h	(revision 256)
+++ /trunk/archive/pslib/include/psDateTime.h	(revision 257)
@@ -11,9 +11,13 @@
  */
 
-/** Get current MJD, for a timestamp */
+/** \addtogroup AstroGroup Astronomy-Specific Utilities
+ *  \{
+ */
+
+/** Get current MJD, for a timestamp \ingroup AstroGroup */
 double
 psGetMJD(void);
 
-/** Get current sidereal time at longitude */
+/** Get current sidereal time at longitude \ingroup AstroGroup */
 double
 psGetSidereal(float mjd,		//!< MJD
@@ -53,5 +57,5 @@
 
 /***** convert to psTime *****/
-/** Convert ISOTime (Human-readable date/time string YYYY/MM/DD,HH:MM:SS.SSS) to psTime */
+/** Convert ISOTime (Human-readable date/time string YYYY/MM/DD,HH:MM:SS.SSS) to psTime \ingroup AstroGroup */
 psTime *
 psISOTimeToTime (char *input)		//!< Input ISOTime time
@@ -83,4 +87,6 @@
 ;
 
+/* \} end of AstroGroup */
+
 #endif
 
Index: /trunk/archive/pslib/include/psDlist.h
===================================================================
--- /trunk/archive/pslib/include/psDlist.h	(revision 256)
+++ /trunk/archive/pslib/include/psDlist.h	(revision 257)
@@ -31,73 +31,69 @@
 };
 
-/*****************************************************************************/
+/** Functions **************************************************************/
+/** \addtogroup DataGroup General Data Container Utilities  
+ *  \{
+ */
+
 /** Constructor */
-psDlist *psDlistAlloc(void *data	//!< initial data item; may be NULL
-    );
+psDlist *psDlistAlloc(void *data)	//!< initial data item; may be NULL
+;
 
 /** Destructor */
 void psDlistFree(psDlist *list,		//!< list to destroy
-		void (*elemFree)(void *) //!< destructor for data on list
-    );
+		void (*elemFree)(void *)) //!< destructor for data on list
+;
 
-/*
- * List maintainence functions
- */
+/**** List maintainence functions ****/
 
 /** Add to list */
 psDlist *psDlistAdd(psDlist *list,	//!< list to add to (may be NULL)
 		    void *data,		//!< data item to add
-		    int where		//!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
-    );
+		    int where)		//!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
+;
 
 /** Append to a list */
 psDlist *psDlistAppend(psDlist *list,	//!< list to append to (may be NULL)
-		       void *data	//!< data item to add
-    );
+		       void *data)	//!< data item to add
+;
 
 /** Remove from a list */
 void *psDlistRemove(psDlist *list,	//!< list to remove element from
 		    void *data,		//!< data item to remove
-		    int which		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
-					//!< PS_DLIST_PREV
-    );
+		    int which)		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
+;					//!< PS_DLIST_PREV
 
 /** Retrieve from a list */
 void *psDlistGet(const psDlist *list,	//!< list to retrieve element from
-		 int which		//!< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV
-    );
+		 int which)		//!< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV
+;
 
-/*
- * convenience functions to use psDlistGet as an iterator
- */
+/**** convenience functions to use psDlistGet as an iterator ******/
 
 /** Set the iterator */
 void psDlistSetIterator(psDlist *list,	//!< list to retrieve element from
 			int where,	//!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
-			int which	//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
-					//!< PS_DLIST_PREV
-    );
+			int which)	//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
+;					//!< PS_DLIST_PREV
 
 /** Get next element */
 void *psDlistGetNext(psDlist *list,	//!< list to retrieve element from
-		     int which		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
-					//!< PS_DLIST_PREV
-    );
+		     int which)		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
+;					//!< PS_DLIST_PREV
 
 /** Get previous element */
 void *psDlistGetPrev(psDlist *list,	//!< list to retrieve element from
-		     int which		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
-					//!< PS_DLIST_PREV
-    );
-
+		     int which)		//!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or
+;					//!< PS_DLIST_PREV
 
 /** Convert doubly-linked list to an array */
-psVoidPtrArray *psDlistToArray(psDlist *dlist //!< List to convert
-    );
+psVoidPtrArray *psDlistToArray(psDlist *dlist) //!< List to convert
+;
 
 /** Convert array to a doubly-linked list */
-psDlist *psArrayToDlist(psVoidPtrArray *arr //!< Array to convert
-    );
+psDlist *psArrayToDlist(psVoidPtrArray *arr) //!< Array to convert
+;
 
+/* \} */ // End of DataGroup Functions
 
 #endif
Index: /trunk/archive/pslib/include/psFFT.h
===================================================================
--- /trunk/archive/pslib/include/psFFT.h	(revision 256)
+++ /trunk/archive/pslib/include/psFFT.h	(revision 257)
@@ -5,4 +5,9 @@
  *  \brief Fourier Transform functions
  *  \ingroup MathGroup
+ */
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
  */
 
@@ -26,4 +31,5 @@
 	    );
 
+/* \} */ // End of MathGroup Functions
 
 #endif
Index: /trunk/archive/pslib/include/psFunctions.h
===================================================================
--- /trunk/archive/pslib/include/psFunctions.h	(revision 256)
+++ /trunk/archive/pslib/include/psFunctions.h	(revision 257)
@@ -50,4 +50,9 @@
 
 
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
+ */
+
 /** Constructors */
 psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms
@@ -101,4 +106,6 @@
 		   );
 
+/* \} */ // End of MathGroup Functions
+
 /************************************************************************************************************/
 
@@ -137,4 +144,9 @@
 } psDPolynomial4D;
 
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
+ */
+
 /** Constructors */
 psDPolynomial1D *psDPolynomial1DAlloc(int n //!< Number of terms
@@ -189,4 +201,5 @@
 		    );
 
+/* \} */ // End of MathGroup Functions
 
 #endif
Index: /trunk/archive/pslib/include/psHash.h
===================================================================
--- /trunk/archive/pslib/include/psHash.h	(revision 256)
+++ /trunk/archive/pslib/include/psHash.h	(revision 257)
@@ -8,25 +8,38 @@
 
 /** DO WE NEED TO DEFINE HashTable? */
-typedef struct HashTable psHash;	//!< Opaque type for a hash table
+typedef struct HashTable psHash;	///< Opaque type for a hash table
 
-psHash *psHashAlloc(int nbucket		//!< initial number of buckets
-    );
-void psHashFree(psHash *table,		//!< hash table to be freed
-		void (*itemFree)(void *item) //!< how to free hashed data; or NULL
-    );
+/** Functions **************************************************************/
+/** \addtogroup DataGroup General Data Container Utilities  
+ *  \{
+ */
 
-void *psHashInsert(psHash *table,	//!< table to insert in
-		   const char *key,	//!< key to use
-		   void *data,		//!< data to insert
-		   void (*itemFree)(void *item)	//!< how to free hashed data; or NULL
-    );
-void *psHashLookup(psHash *table,	//!< table to lookup key in
-		   const char *key	//!< key to lookup
-    );
+/// Allocate hash buckets in table.
+psHash *psHashAlloc(int nbucket)	///< initial number of buckets
+;
 
-void *psHashRemove(psHash *table,	//!< table to lookup key in
-		   const char *key	//!< key to lookup
-    );
+/// Free hash buckets from table.
+void psHashFree(psHash *table,		///< hash table to be freed
+		void (*itemFree)(void *item)) ///< how to free hashed data; or NULL
+;
 
+/// Insert entry into table.
+void *psHashInsert(psHash *table,	///< table to insert in
+		   const char *key,	///< key to use
+		   void *data,		///< data to insert
+		   void (*itemFree)(void *item)) ///< how to free hashed data; or NULL
+;
+
+/// Lookup key in table.
+void *psHashLookup(psHash *table,	///< table to lookup key in
+		   const char *key)	///< key to lookup
+;
+
+/// Remove key from table.
+void *psHashRemove(psHash *table,	///< table to lookup key in
+		   const char *key)	///< key to lookup
+;
+
+/* \} */ // End of DataGroup Functions
 
 #endif
Index: /trunk/archive/pslib/include/psImage.h
===================================================================
--- /trunk/archive/pslib/include/psImage.h	(revision 256)
+++ /trunk/archive/pslib/include/psImage.h	(revision 257)
@@ -5,8 +5,4 @@
  *  \brief Basic image definitions and operations.
  *  \ingroup AstroGroup
- */
-
-/** General image manipulation functions.
- *  These functions operate on individual 2D images
  */
 
@@ -32,13 +28,17 @@
 } psImage;
 
+/** Functions **************************************************************/
+/** \addtogroup AstroGroup Astronomy-Specific Utilities
+ *  \{
+ */
+
 /*** Image structure manipulation ***/
+
 /// Create an image of the specified size and type.
-typedef int PS_IMAGE_DEPTH;		// RHL Added this to make the psImage compile XXX
-
 psImage *
 psImageAlloc (int nx,			///< image width 
 	      int ny,			///< image height 
-	      PS_IMAGE_DEPTH depth	///< image depth 
-    );
+	      psType type)		///< image data type 
+;
 
 /// Create a subimage of the specified area.
@@ -68,6 +68,4 @@
 
 /*** various image pixel extractions ***/
-
-typedef enum { PS_STAT_MODE_MEDIAN } psStatMode;
 
 /// Extract pixels from rectlinear region to a vector.
@@ -271,4 +269,6 @@
 );
 
+/* \} */ // End of AstroGroup Functions
+
 # endif
 /* image overlay operations 
Index: /trunk/archive/pslib/include/psLogMsg.h
===================================================================
--- /trunk/archive/pslib/include/psLogMsg.h	(revision 256)
+++ /trunk/archive/pslib/include/psLogMsg.h	(revision 257)
@@ -7,14 +7,29 @@
  */
 
+/** Functions **************************************************************/
+/** \addtogroup SystemGroup System Utilities 
+ *  \{
+ */
+
+/// Sets the log destination 
+int psSetLogDestination(int dest);	
+
+/// Sets the log level
+int psSetLogLevel(int level);		
+
+/// sets the log format
+void psSetLogFormat(const char *fmt);	
+
+/// Logs a message
+void psLogMsg(const char *name, int level, const char *fmt, ...); 
+
+/// Logs a message from varargs
+void p_psVLogMsg(const char *name, int level, const char *fmt, va_list ap); 
+
+/* \} */ // End of SystemGroup Functions
+
 enum { PS_LOG_ABORT = 0, PS_LOG_ERROR, PS_LOG_WARN, PS_LOG_INFO }; //!< Status codes for log messages
 
 enum { PS_LOG_TO_STDERR, PS_LOG_TO_STDOUT }; //!< Destinations for log messages
 
-int psSetLogDestination(int dest);	//!< Sets the log destination
-int psSetLogLevel(int level);		//!< Sets the log level
-void psSetLogFormat(const char *fmt);	//!< sets the log format
-
-void psLogMsg(const char *name, int level, const char *fmt, ...); //!< Logs a message
-void p_psVLogMsg(const char *name, int level, const char *fmt, va_list ap); //!< Logs a message from varargs
-
 #endif
Index: /trunk/archive/pslib/include/psMath.h
===================================================================
--- /trunk/archive/pslib/include/psMath.h	(revision 256)
+++ /trunk/archive/pslib/include/psMath.h	(revision 257)
@@ -17,4 +17,9 @@
     } val;
 } p_psScalar;
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
+ */
 
 /** Perform a binary operation on two data items (psImage, psVector, psScalar). */
@@ -42,4 +47,6 @@
 	      ...			///< value (or values) of specified types
 );
+
+/* \} */ // End of MathGroup Functions
 
 /** the functions defined here can operate on the basic PSLib data types: psImage, psVector, XXX.  These data
Index: /trunk/archive/pslib/include/psMatrix.h
===================================================================
--- /trunk/archive/pslib/include/psMatrix.h	(revision 256)
+++ /trunk/archive/pslib/include/psMatrix.h	(revision 257)
@@ -12,4 +12,9 @@
     float *restrict *restrict value;	//!< Values in matrix
 } psMatrix;
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
+ */
 
 /** Constructor */
@@ -59,3 +64,5 @@
     );
 
+/* \} */ // End of MathGroup Functions
+
 #endif
Index: /trunk/archive/pslib/include/psMemory.h
===================================================================
--- /trunk/archive/pslib/include/psMemory.h	(revision 256)
+++ /trunk/archive/pslib/include/psMemory.h	(revision 257)
@@ -6,4 +6,6 @@
  *  \ingroup SystemGroup
  */
+
+// Structures ***********************************************************
 
 /** Book-keeping data for storage allocator.
@@ -21,94 +23,106 @@
 } psMemBlock;
 
-/** prototype of a basic callback used by memory functions */
+/// prototype of a basic callback used by memory functions 
 typedef int (*psMemCallback)(const psMemBlock *ptr);
 
-/** prototype of a callback used in error conditions */
+/// prototype of a callback used in error conditions 
 typedef void (*psMemProblemCallback)(const psMemBlock *ptr, const char *file, int lineno);
 
-/** prototype of a callback used when memory runs out */
+/// prototype of a callback used when memory runs out 
 typedef void *(*psMemExhaustedCallback)(size_t size);
 
-/*****************************************************************************/
+/** Functions **************************************************************/
+/** \addtogroup SystemGroup System Utilities
+ *  \{
+ */
 
-/** Memory allocation. Underlying private function called by macro psAlloc. */
+/// Memory allocation. Underlying private function called by macro psAlloc. 
 void *p_psAlloc(size_t size,		//!< Size required
 		const char *file,	//!< File of call
-		int lineno		//!< Line number of call
-    );
+		int lineno)		//!< Line number of call
+;
 
-/** Memory re-allocation.  Underlying private function called by macro psRealloc. */
+/// Memory re-allocation.  Underlying private function called by macro psRealloc. 
 void *p_psRealloc(void *ptr,		//!< Pointer to re-allocate
 		  size_t size,		//!< Size required
 		  const char *file,	//!< File of call
-		  int lineno		//!< Line number of call
-    );
+		  int lineno)		//!< Line number of call
+;
 
-/** Free memory.  Underlying private function called by macro psFree. */
+/// Free memory.  Underlying private function called by macro psFree. 
 void p_psFree(void *ptr,		//!< Pointer to free
 	      const char *file,		//!< File of call
-	      int lineno		//!< Line number of call
-    );
+	      int lineno)		//!< Line number of call
+;
 
-/** Memory allocation. psAlloc sends file and line number to p_psAlloc. */
+/// Check for memory leaks 
+int psMemCheckLeaks(int id0,		//!< don't list blocks with id < id0
+		    psMemBlock ***arr,	//!< pointer to array of pointers to leaked blocks, or NULL
+		    FILE *fd)		//!< print list of leaks to fd (or NULL)
+;
+
+/// Check for memory corruption 
+int psMemCheckCorruption(int abort_on_error) //!< Abort on detecting corruption?
+;
+
+/// Return reference counter 
+int psMemGetRefCounter(void *vptr)	//!< Pointer to get refCounter for
+;
+
+/// Increment reference counter and return the pointer 
+void *psMemIncrRefCounter(void *vptr)	//!< Pointer to increment refCounter, and return
+;
+
+/// Decrement reference counter and return the pointer 
+void *psMemDecrRefCounter(void *vptr)	//!< Pointer to decrement refCounter, and return
+;
+
+/// Set callback for problems 
+psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func) //!< Function to run
+;
+
+/// Set callback for out-of-memory 
+psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func) //!< Function to run
+;									
+
+/// Set call back for when a particular memory block is allocated 
+psMemCallback psMemAllocateSetCB(psMemCallback func)
+;
+
+/// Set call back for when a particular memory block is freed 
+psMemCallback psMemFreeSetCB(psMemCallback func)
+;
+
+/// get next memory ID 
+int psMemGetId(void)
+;
+
+/// set p_psMemAllocateID to id 
+long psMemSetAllocateID(long id)
+;
+
+/// set p_psMemFreeID to id 
+long psMemSetFreeID(long id)
+;
+
+/* \} */ // End of SystemGroup Functions
+
+/// Memory allocation. psAlloc sends file and line number to p_psAlloc. 
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
 
-/** Memory re-allocation.  psRealloc sends file and line number to p_psRealloc. */
+/// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc. 
 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
 
-/** Free memory.  psFree sends file and line number to p_psFree. */
+/// Free memory.  psFree sends file and line number to p_psFree. 
 #define psFree(size) p_psFree(size, __FILE__, __LINE__)
 
-/** prevent the use of 'malloc'. malloc is re-defined to throw an error in the C preprocessor */
+/// prevent the use of 'malloc'. malloc is re-defined to throw an error in the C preprocessor 
 #define malloc(S) for
 
-/** prevent the use of 'realloc'. realloc is re-defined to throw an error in the C preprocessor */
+/// prevent the use of 'realloc'. realloc is re-defined to throw an error in the C preprocessor 
 #define realloc(P,S) for
 
-/** prevent the use of 'free'. free is re-defined to throw an error in the C preprocessor */
+/// prevent the use of 'free'. free is re-defined to throw an error in the C preprocessor 
 #define free(P) for
 
-/*****************************************************************************/
-/** Check for memory leaks */
-int psMemCheckLeaks(int id0,		//!< don't list blocks with id < id0
-		    psMemBlock ***arr,	//!< pointer to array of pointers to leaked blocks, or NULL
-		    FILE *fd		//!< print list of leaks to fd (or NULL)
-    );
-
-/** Check for memory corruption */
-int psMemCheckCorruption(int abort_on_error //!< Abort on detecting corruption?
-    );
-
-/*****************************************************************************/
-
-/** Return reference counter */
-int psMemGetRefCounter(void *vptr	//!< Pointer to get refCounter for
-    );
-/** Increment reference counter and return the pointer */
-void *psMemIncrRefCounter(void *vptr	//!< Pointer to increment refCounter, and return
-    );
-/** Decrement reference counter and return the pointer */
-void *psMemDecrRefCounter(void *vptr	//!< Pointer to decrement refCounter, and return
-    );
-
-/*****************************************************************************/
-/*
- * Functions to set and control callbacks
- */
-
-/** Set callback for problems */
-psMemProblemCallback psMemProblemSetCB(psMemProblemCallback func //!< Function to run
-    );
-psMemExhaustedCallback psMemExhaustedSetCB(psMemExhaustedCallback func); //!< set call back for exhausted
-									 //!< memory
-
-psMemCallback psMemAllocateSetCB(psMemCallback func); //!< Set call back for when a particular memory block is
-						      //!< allocated
-psMemCallback psMemFreeSetCB(psMemCallback func); //!< set call back for when a particular memory block is
-						  //!< freed
-
-int psMemGetId(void);			//!< get next memory ID
-long psMemSetAllocateID(long id);	//!< set p_psMemAllocateID to id
-long psMemSetFreeID(long id);		//!< set p_psMemFreeID to id
-
 #endif
Index: /trunk/archive/pslib/include/psMetaData.h
===================================================================
--- /trunk/archive/pslib/include/psMetaData.h	(revision 256)
+++ /trunk/archive/pslib/include/psMetaData.h	(revision 257)
@@ -49,4 +49,9 @@
 } psMetaDataSet;
 
+/** Functions **************************************************************/
+/** \addtogroup AstroGroup Astronomy-Specific Utilities
+ *  \{
+ */
+
 /** Constructor */
 psMetaDataItem *psMetaDataItemAlloc(
@@ -80,3 +85,4 @@
 			 const psMetaDataItem *restrict ms, // item of metadata to print
 			 const char *prefix);	   // print this at the beginning of each line
+/* \} */ // End of AstroGroup Functions
 #endif
Index: /trunk/archive/pslib/include/psMinimize.h
===================================================================
--- /trunk/archive/pslib/include/psMinimize.h	(revision 256)
+++ /trunk/archive/pslib/include/psMinimize.h	(revision 257)
@@ -5,4 +5,9 @@
  *  \brief minimization operations
  *  \ingroup MathGroup
+ */
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
  */
 
@@ -32,3 +37,5 @@
     );
 
+/* \} */ // End of MathGroup Functions
+
 #endif
Index: /trunk/archive/pslib/include/psMisc.h
===================================================================
--- /trunk/archive/pslib/include/psMisc.h	(revision 256)
+++ /trunk/archive/pslib/include/psMisc.h	(revision 257)
@@ -7,25 +7,33 @@
  */
 
-#define PS_STRING(S) #S			//!< converts argument to string
+/** Functions **************************************************************/
+/** \addtogroup SystemGroup System Utilities
+ *  \{
+ */
 
-/** Prints an error message and aborts */
-void psAbort(const char *name,		//!< Category of code that caused the abort
-	     const char *fmt,		//!< Format
-	     ...			//!< Extra arguments to use format
-    );
-/** Prints an error message and doesn't abort */
-void psError(const char *name,		//!< Category of code that caused the abort
-	     const char *fmt,		//!< Format
-	     ...			//!< Extra arguments to use format
-    );
+/// Prints an error message and aborts
+void psAbort(const char *name,		///< Category of code that caused the abort
+	     const char *fmt,		///< Format
+	     ...)			///< Extra arguments to use format
+;
 
-/** Allocates and returns a copy of a string */
-char *psStringCopy(const char *str	//!< string to copy
-    );
+/// Prints an error message and doesn't abort
+void psError(const char *name,		///< Category of code that caused the abort
+	     const char *fmt,		///< Format
+	     ...)			///< Extra arguments to use format
+;
 
-/** Magic values for errors */
+/// Allocates and returns a copy of a string
+char *psStringCopy(const char *str)	///< string to copy
+;
+
+/* \} */ // End of SystemGroup Functions
+
+#define PS_STRING(S) #S			///< converts argument to string
+
+/// Magic values for errors
 enum {
-    PS_NO_VALUE = -111,			//!< Corresponding value not yet measured
-    PS_NO_ERROR = -222			//!< Corresponding value has no error
+    PS_NO_VALUE = -111,			///< Corresponding value not yet measured
+    PS_NO_ERROR = -222			///< Corresponding value has no error
 };
 
Index: /trunk/archive/pslib/include/psPosition.h
===================================================================
--- /trunk/archive/pslib/include/psPosition.h	(revision 256)
+++ /trunk/archive/pslib/include/psPosition.h	(revision 257)
@@ -6,4 +6,6 @@
  *  \ingroup AstroGroup
  */
+
+/** Structures *********************/
 
 /** A point in 2-D space, with errors.
@@ -29,5 +31,5 @@
 
 /** A polynomial transformation between coordinate frames.  This may be a linear relationship, or may
- * represent a higher-order transformation.
+ *  represent a higher-order transformation.
  */
 typedef struct {
@@ -37,5 +39,5 @@
 
 /** The optical distortion terms.  The lowest two terms are the x and y axis of the target system.  The higher
- * two terms represent magnitude and color terms.
+ *  two terms represent magnitude and color terms.
  */
 typedef struct {
@@ -44,11 +46,20 @@
 } psDistortion;
 
-psCoord *psCoordXformApply (psCoordXform *frame, psCoord *coords);
+/** Functions **************************************************************/
+/** \addtogroup AstroGroup Astronomy-Specific Utilities
+ *  \{
+ */
 
-psCoord *psDistortionApply (psCoordXform *frame, psCoord *coords);
+/** apply the coordinate transformation to the given coordinate */
+psCoord *psCoordXformApply (psCoordXform *frame, ///< coordinate transformation
+			    psCoord *coords) ///< input coordiate
+;
 
-/***********************************************************************************************************/
-
-/* Offsets */
+/** apply the optical distortion to the given coordinate, magnitude, color */
+psCoord *psDistortionApply (psDistortion *pattern, ///< optical distortion pattern
+psCoord *coords,			///< input coordinate
+float mag,				///< magnitude of object
+float color)				///< color of object
+;
 
 /** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */
@@ -56,6 +67,6 @@
 psGetOffset(const psCoord *restrict position1, //!< Position 1
 	    const psCoord *restrict position2, //!< Position 2
-	    char *system
-	    );
+	    char *system)
+;
 
 /** Apply an offset to a position */
@@ -63,8 +74,6 @@
 psApplyOffset(const psCoord *restrict position, //!< Position
 	      const psCoord *restrict offset, //!< Offset
-	      char *system
-    );
-
-/***********************************************************************************************************/
+	      char *system)
+;
 
 /* Positions of well-known objects */
@@ -72,6 +81,6 @@
 /** Get Sun Position */
 psCoord *
-psGetSunPos(float mjd			//!< MJD to get position for
-	    );
+psGetSunPos(float mjd)			//!< MJD to get position for
+;
 
 /** Get Moon position */
@@ -79,17 +88,17 @@
 psGetMoonPos(float mjd,			//!< MJD to get position for
 	     double latitude,		//!< Latitude for apparent position
-	     double longitude		//!< Longitude for apparent position
-	     );
+	     double longitude)		//!< Longitude for apparent position
+;
 
 /** Get Moon phase */
 float
-psGetMoonPhase(float mjd		//!< MJD to get phase for
-	       );
+psGetMoonPhase(float mjd)		//!< MJD to get phase for
+;
 
 /** Get Planet positions */
 psCoord *
 psGetSolarSystemPos(char *solarSystemObject, //!< Named S.S. object
-		    float mjd		//!< MJD to get position for
-    );
+		    float mjd)		//!< MJD to get position for
+;
 
 /***********************************************************************************************************/
@@ -99,22 +108,25 @@
 /** Convert ICRS to Ecliptic */
 psCoord *
-psCoordinatesItoE(const psCoord *restrict coordinates //!< ICRS coordinates to convert
-		  );
+psCoordinatesItoE(const psCoord *restrict coordinates) //!< ICRS coordinates to convert
+;
 
 /** Convert Ecliptic to ICRS */
 psCoord *
-psCoordinatesEtoI(const psCoord *restrict coordinates //!< Ecliptic coordinates to convert
-		  );
+psCoordinatesEtoI(const psCoord *restrict coordinates) //!< Ecliptic coordinates to convert
+;
 
 /** Convert ICRS to Galactic */
 psCoord *
-psCoordinatesItoG(const psCoord *restrict coordinates //!< ICRS coordinates to convert
-		  );
+psCoordinatesItoG(const psCoord *restrict coordinates) //!< ICRS coordinates to convert
+;
 
 /** Convert Galactic to ICRS */
 psCoord *
-psCoordinatesGtoI(const psCoord *restrict coordinates //!< Galactic coordinates to convert
-		  );
+psCoordinatesGtoI(const psCoord *restrict coordinates) //!< Galactic coordinates to convert
+;
 
 /***********************************************************************************************************/
+
+/* \} */ // End of AstroGroup Functions
+
 #endif
Index: /trunk/archive/pslib/include/psSort.h
===================================================================
--- /trunk/archive/pslib/include/psSort.h	(revision 256)
+++ /trunk/archive/pslib/include/psSort.h	(revision 257)
@@ -5,4 +5,9 @@
  *  \brief general sorting operations
  *  \ingroup MathGroup
+ */
+
+/** Functions **************************************************************/
+/** \addtogroup MathGroup Math Utilities
+ *  \{
  */
 
@@ -19,3 +24,5 @@
     );
 
+/* \} */ // End of MathGroup Functions
+
 #endif
Index: /trunk/archive/pslib/include/psStats.h
===================================================================
--- /trunk/archive/pslib/include/psStats.h	(revision 256)
+++ /trunk/archive/pslib/include/psStats.h	(revision 257)
@@ -70,5 +70,5 @@
 
 
-/** Do Statistics on an array.  Returns a status value. */
+/** Do Statistics on an array.  Returns a status value. \ingroup MathGroup */
 psStats *
 psArrayStats(const psFloatArray *restrict myArray, //!< Array to be analysed
@@ -81,5 +81,5 @@
 /***********************************************************************************************************/
 
-/** Histograms */
+/** Histograms  */
 typedef struct {
     const psFloatArray *restrict lower;	//!< Lower bounds for the bins
@@ -90,5 +90,5 @@
 } psHistogram;
 
-/** Constructor */
+/** Constructor \ingroup MathGroup */
 psHistogram *
 psHistogramAlloc(float lower,		//!< Lower limit for the bins
@@ -97,5 +97,5 @@
     );
 
-/** Generic constructor */
+/** Generic constructor \ingroup MathGroup */
 psHistogram *
 psHistogramAllocGeneric(const psFloatArray *restrict lower, //!< Lower bounds for the bins
@@ -105,5 +105,5 @@
     );
 
-/** Destructor */
+/** Destructor \ingroup MathGroup **/
 void
 psHistogramFree(psHistogram *restrict myHist //!< Histogram to destroy
@@ -111,5 +111,5 @@
 
 
-/** Calculate a histogram */
+/** Calculate a histogram \ingroup MathGroup **/
 psHistogram *
 psGetArrayHistogram(psHistogram *restrict myHist, //!< Histogram data
Index: /trunk/archive/pslib/include/psStdArrays.h
===================================================================
--- /trunk/archive/pslib/include/psStdArrays.h	(revision 256)
+++ /trunk/archive/pslib/include/psStdArrays.h	(revision 257)
@@ -79,13 +79,13 @@
 } psFloatArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psFloatArray *psFloatArrayAlloc(int s,	///< Total number of elements to make available
 				int n	///< Number of elements that will be used
     );
-/** Reallocator */
+/** Reallocator \ingroup DataGroup */
 psFloatArray *psFloatArrayRealloc(psFloatArray *myArray, ///< Array to reallocate
 				  int s	///< Total number of elements to make available
     );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psFloatArrayFree(psFloatArray *restrict myArray ///< Array to free
     );
@@ -109,13 +109,13 @@
 } psComplexArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psComplexArray *psComplexArrayAlloc(int s, ///< Total number of elements to make available
 				    int n	///< Number of elements that will be used
     );
-/** Reallocator */
+/** Reallocator \ingroup DataGroup */
 psComplexArray *psComplexArrayRealloc(psComplexArray *myArray, ///< Array to reallocate
 				      int s	///< Total number of elements to make available
     );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psComplexArrayFree(psComplexArray *restrict myArray ///< Array to free
     );
@@ -131,13 +131,13 @@
 } psIntArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psIntArray *psIntArrayAlloc(int s,	///< Total number of elements to make available
 			    int n	///< Number of elements that will be used
     );
-/** Reallocator */
+/** Reallocator \ingroup DataGroup */
 psIntArray *psIntArrayRealloc(psIntArray *myArray, ///< Array to reallocate
 			      int s	///< Total number of elements to make available
     );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psIntArrayFree(psIntArray *restrict myArray ///< Array to free
     );
@@ -153,13 +153,13 @@
 } psDoubleArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psDoubleArray *psDoubleArrayAlloc(int s, ///< Total number of elements to make available
 				  int n	///< Number of elements that will be used
     );
-/** Reallocator */
+/** Reallocator \ingroup DataGroup */
 psDoubleArray *psDoubleArrayRealloc(psDoubleArray *myArray, ///< Array to reallocate
 				    int s	///< Total number of elements to make available
     );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psDoubleArrayFree(psDoubleArray *restrict myArray ///< Array to free
     );
@@ -175,13 +175,13 @@
 } psVectorArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psVectorArray *psVectorArrayAlloc(int s, ///< Total number of elements to make available
 				  int n	///< Number of elements that will be used
     );
-/** Reallocator */
+/** Reallocator \ingroup DataGroup */
 psVectorArray *psVectorArrayRealloc(psVectorArray *myArray, ///< Array to reallocate
 				    int s	///< Total number of elements to make available
     );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psVectorArrayFree(psVectorArray *restrict myArray ///< Array to free
     );
@@ -200,13 +200,13 @@
 } psVoidPtrArray;
 
-/** Constructor */
+/** Constructor \ingroup DataGroup */
 psVoidPtrArray *psVoidPtrArrayAlloc(int n, //!< Number of elements to use
 				    int s //!< Total number of elements
 				    );
-/** Reallocate */
+/** Reallocate \ingroup DataGroup */
 psVoidPtrArray *psVoidPtrArrayRealloc(psVoidPtrArray *arr, //!< Array to reallocate
 				      int n //!< Number of elements
 				      );
-/** Destructor */
+/** Destructor \ingroup DataGroup */
 void psVoidPtrArrayFree(psVoidPtrArray *arr, //!< array to destroy
 			void (*elemFree)(void *) //!< destructor for array data
Index: /trunk/archive/pslib/include/psTrace.h
===================================================================
--- /trunk/archive/pslib/include/psTrace.h	(revision 256)
+++ /trunk/archive/pslib/include/psTrace.h	(revision 257)
@@ -7,5 +7,33 @@
  */
 
-//#define PS_NTRACE 1			//!< to turn off all tracing
+/** Functions **************************************************************/
+/** \addtogroup SystemGroup System Utilities 
+ *  \{
+ */
+
+/// Send a trace message
+void p_psTrace(const char *facil, 	///< facilty of interest
+	       int level,		///< desired trace level
+	       ...)			///< trace message arguments 
+;
+
+/// Set trace level 
+int psSetTraceLevel(const char *facil,	///< facilty of interest
+		    int level)		///< desired trace level
+;
+
+/// Get the trace level 
+int psGetTraceLevel(const char *name)	///< facilty of interest
+;
+
+/// turn off all tracing, and free trace's allocated memory 
+void psTraceReset(void);
+
+/// print trace levels 
+void psPrintTraceLevels(void);
+
+/* \} */ // End of SystemGroup Functions
+
+//#define PS_NTRACE 1			///< to turn off all tracing
 
 #if defined(PS_NTRACE)
@@ -16,24 +44,3 @@
 #endif
 
-/** Send a trace message */
-void p_psTrace(const char *facil, 	//!< facilty of interest
-	       int level,		//!< desired trace level
-	       ...			//!< trace message arguments 
-);
-
-/** Set trace level */
-int psSetTraceLevel(const char *facil,	//!< facilty of interest
-		    int level		//!< desired trace level
-);
-
-/** Get the trace level */
-int psGetTraceLevel(const char *name	//!< facilty of interest
-);
-
-/** turn off all tracing, and free trace's allocated memory */
-void psTraceReset(void);
-
-/** print trace levels */
-void psPrintTraceLevels(void);
-
 #endif
