Index: /trunk/ppArith/src/ppArith.c
===================================================================
--- /trunk/ppArith/src/ppArith.c	(revision 21243)
+++ /trunk/ppArith/src/ppArith.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppArith.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -11,9 +23,9 @@
 int main(int argc, char *argv[])
 {
-    psExit exitValue = PS_EXIT_SUCCESS; // Exit value
+    psExit exitValue = PS_EXIT_SUCCESS; ///< Exit value
     psTimerStart("ppArith");
     psLibInit(NULL);
 
-    pmConfig *config = pmConfigRead(&argc, argv, PPARITH_RECIPE); // Configuration
+    pmConfig *config = pmConfigRead(&argc, argv, PPARITH_RECIPE); ///< Configuration
     if (!config) {
         psErrorStackPrint(stderr, "Error reading configuration.");
Index: /trunk/ppArith/src/ppArith.h
===================================================================
--- /trunk/ppArith/src/ppArith.h	(revision 21243)
+++ /trunk/ppArith/src/ppArith.h	(revision 21244)
@@ -1,32 +1,58 @@
+/** @file ppArith.h
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
+
 #ifndef PP_ARITH_H
 #define PP_ARITH_H
 
-#define PPARITH_RECIPE "PPARITH"            /// Name of the recipe to use
+/// @addtogroup ppArith
+/// @{
+#define PPARITH_RECIPE "PPARITH"            ///< Name of the recipe to use
 
-/// Parse the arguments
-bool ppArithArguments(int argc, char *argv[], ///< Command-line arguments
-                      pmConfig *config    ///< Configuration
+/**
+ * Parse the arguments
+ */
+bool ppArithArguments(int argc, char *argv[], ///< Command-line arguments 
+                      pmConfig *config    ///< Configuration 
     );
 
-/// Parse the camera input
-bool ppArithCamera(pmConfig *config       ///< Configuration
+/**
+ * Parse the camera input
+ */
+bool ppArithCamera(pmConfig *config       ///< Configuration 
     );
 
-/// Loop over the FPA hierarchy
-bool ppArithLoop(pmConfig *config         ///< Configuration
+/**
+ * Loop over the FPA hierarchy
+ */
+bool ppArithLoop(pmConfig *config         ///< Configuration 
     );
 
-/// Perform arithmetic on the readout
-bool ppArithReadout(pmReadout *output,  ///< Output readout
-                    const pmReadout *input1, ///< Input readout
-                    const pmReadout *input2, ///< Input readout
-                    const pmConfig *config, ///< Configuration
-                    const pmFPAview *view ///< View of readout on which to operate
+/**
+ * Perform arithmetic on the readout
+ */
+bool ppArithReadout(pmReadout *output,  ///< Output readout 
+                    const pmReadout *input1, ///< Input readout 
+                    const pmReadout *input2, ///< Input readout 
+                    const pmConfig *config, ///< Configuration 
+                    const pmFPAview *view ///< View of readout on which to operate 
     );
 
-/// Put the program version information into a metadata
+/**
+ * Put the program version information into a metadata
+ */
 void ppArithVersionMetadata(psMetadata *metadata ///< Metadata to populate
     );
 
+///@}
 
 #endif
Index: /trunk/ppArith/src/ppArithArguments.c
===================================================================
--- /trunk/ppArith/src/ppArithArguments.c	(revision 21243)
+++ /trunk/ppArith/src/ppArithArguments.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppArithArguments.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -10,8 +22,10 @@
 #include "ppArith.h"
 
-// Print usage information and die
-static void usage(const char *program,  // Name of the program
-                  psMetadata *arguments, // Command-line arguments
-                  pmConfig *config      // Configuration
+/**
+ * Print usage information and die
+ */
+static void usage(const char *program,  ///< Name of the program
+                  psMetadata *arguments, ///< Command-line arguments
+                  pmConfig *config      ///< Configuration
     )
 {
@@ -28,12 +42,14 @@
 }
 
-// Get a string value from the command-line and add it to the target
-static bool valueArgStr(psMetadata *arguments, // Command-line arguments
-                        const char *argName, // Argument name in the command-line arguments
-                        const char *mdName, // Name for value in the metadata
-                        psMetadata *target // Target metadata to which to add value
+/**
+ * Get a string value from the command-line and add it to the target
+ */
+static bool valueArgStr(psMetadata *arguments, ///< Command-line arguments
+                        const char *argName, ///< Argument name in the command-line arguments
+                        const char *mdName, ///< Name for value in the metadata
+                        psMetadata *target ///< Target metadata to which to add value
                         )
 {
-    psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest
+    psString value = psMetadataLookupStr(NULL, arguments, argName); ///< Value of interest 
     if (value && strlen(value) > 0) {
         return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
@@ -42,12 +58,14 @@
 }
 
-// Add a single filename to the arguments as an array, so that it can be used with pmFPAfileBindFromArgs, etc
-static void fileList(const char *file, // The symbolic name for the file
-                     const char *name, // The name of the file
-                     const char *comment, // Description of the file
-                     pmConfig *config // Configuration
+/**
+ * Add a single filename to the arguments as an array, so that it can be used with pmFPAfileBindFromArgs, etc
+ */
+static void fileList(const char *file, ///< The symbolic name for the file
+                     const char *name, ///< The name of the file
+                     const char *comment, ///< Description of the file
+                     pmConfig *config ///< Configuration
     )
 {
-    psArray *files = psArrayAlloc(1); // Array with file names
+    psArray *files = psArrayAlloc(1); ///< Array with file names
     files->data[0] = psStringCopy(name);
     psMetadataAddArray(config->arguments, PS_LIST_TAIL, file, 0, comment, files);
@@ -60,5 +78,5 @@
     assert(config);
 
-    psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
+    psMetadata *arguments = psMetadataAlloc(); ///< Command-line arguments
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-file1", 0, "First image", NULL);
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-op", 0, "Operation to perform", NULL);
@@ -73,6 +91,6 @@
     bool isMask = psMetadataLookupBool(NULL, arguments, "-mask"); // Are we dealing with masks?
     psMetadataAddBool(config->arguments, PS_LIST_TAIL, "MASK", 0, "Produce a mask image?", isMask);
-    const char *inFilerule = isMask ? "PPARITH.INPUT.MASK" : "PPARITH.INPUT.IMAGE"; // Input file rule
-    const char *outFilerule = isMask ? "PPARITH.OUTPUT.MASK" : "PPARITH.OUTPUT.IMAGE"; // Output file rule
+    const char *inFilerule = isMask ? "PPARITH.INPUT.MASK" : "PPARITH.INPUT.IMAGE"; ///< Input file rule
+    const char *outFilerule = isMask ? "PPARITH.OUTPUT.MASK" : "PPARITH.OUTPUT.IMAGE"; ///< Output file rule
     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "FILERULE.INPUT", 0,
                      "File rule for input", inFilerule);
@@ -80,8 +98,8 @@
                      "File rule for output", outFilerule);
 
-    bool status = false;                // Status for file definition
+    bool status = false;                ///< Status for file definition 
 
     // First file
-    const char *name1 = psMetadataLookupStr(NULL, arguments, "-file1"); // Name of first image
+    const char *name1 = psMetadataLookupStr(NULL, arguments, "-file1"); ///< Name of first image
     if (!name1 || strlen(name1) == 0) {
         psError(PS_ERR_UNEXPECTED_NULL, true, "No input image specified.");
@@ -100,5 +118,5 @@
 
     // Second file is optional (won't be one for unary operations)
-    const char *name2 = psMetadataLookupStr(NULL, arguments, "-file2"); // Name of second image
+    const char *name2 = psMetadataLookupStr(NULL, arguments, "-file2"); ///< Name of second image
     if (name2 && strlen(name2) > 0) {
         fileList("INPUT2", name2, "Name of the second input image", config);
Index: /trunk/ppArith/src/ppArithLoop.c
===================================================================
--- /trunk/ppArith/src/ppArithLoop.c	(revision 21243)
+++ /trunk/ppArith/src/ppArithLoop.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppArithLoop.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -16,10 +28,10 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    bool mdok;                          // Status of MD lookup
-    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics
-    psMetadata *stats = NULL;           // Container for statistics
-    FILE *statsFile = NULL;             // File stream for statistics
+    bool mdok;                          ///< Status of MD lookup
+    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); ///< Filename for statistics
+    psMetadata *stats = NULL;           ///< Container for statistics
+    FILE *statsFile = NULL;             ///< File stream for statistics
     if (statsName && strlen(statsName) > 0) {
-        psString resolved = pmConfigConvertFilename(statsName, config, true, true); // Resolved filename
+        psString resolved = pmConfigConvertFilename(statsName, config, true, true); ///< Resolved filename
         statsFile = fopen(resolved, "w");
         if (!statsFile) {
@@ -33,14 +45,14 @@
     }
 
-    const char *outName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.OUTPUT"); // Output filerule
-    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
+    const char *outName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.OUTPUT"); ///< Output filerule
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
     assert(output);                     // We added it earlier
 
-    const char *inName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.INPUT"); // Input filerule
-    pmFPAfile *input1 = NULL, *input2 = NULL; // Input files
-    psString fileRegex = NULL;          // Regular expression to find input files
+    const char *inName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.INPUT"); ///< Input filerule
+    pmFPAfile *input1 = NULL, *input2 = NULL; ///< Input files
+    psString fileRegex = NULL;   ///< Regular expression to find input files
     psStringAppend(&fileRegex, "^%s$", inName);
-    psMetadataIterator *iter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, fileRegex); // Iterator
-    psMetadataItem *item = psMetadataGetAndIncrement(iter); // Item from iteration
+    psMetadataIterator *iter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, fileRegex); ///< Iterator
+    psMetadataItem *item = psMetadataGetAndIncrement(iter); ///< Item from iteration
     input1 = item->data.V;
     assert(input1);                     // It should be there!
@@ -51,6 +63,6 @@
     psFree(iter);
 
-    pmFPAview *view = pmFPAviewAlloc(0); // Pointer into FPA hierarchy
-    pmHDU *lastHDU = NULL;              // Last HDU that was updated
+    pmFPAview *view = pmFPAviewAlloc(0); ///< Pointer into FPA hierarchy
+    pmHDU *lastHDU = NULL;              ///< Last HDU that was updated
 
     // Iterate over the FPA hierarchy
@@ -59,8 +71,8 @@
     }
 
-    pmChip *outChip;                    // Output chip of interest
+    pmChip *outChip;                    ///< Output chip of interest
     while ((outChip = pmFPAviewNextChip(view, output->fpa, 1)) != NULL) {
-        pmChip *inChip1 = pmFPAviewThisChip(view, input1->fpa); // Input chip of interest
-        pmChip *inChip2 = input2 ? pmFPAviewThisChip(view, input2->fpa) : NULL; // Input chip of interest
+        pmChip *inChip1 = pmFPAviewThisChip(view, input1->fpa); ///< Input chip of interest
+        pmChip *inChip2 = input2 ? pmFPAviewThisChip(view, input2->fpa) : NULL; ///< Input chip of interest
         if (inChip2 && ((!inChip1->file_exists && inChip2->file_exists) ||
                         (inChip1->file_exists && !inChip2->file_exists))) {
@@ -78,8 +90,8 @@
         }
 
-        pmCell *outCell;                // Cell of interest
+        pmCell *outCell;                ///< Cell of interest
         while ((outCell = pmFPAviewNextCell(view, output->fpa, 1)) != NULL) {
-            pmCell *inCell1 = pmFPAviewThisCell(view, input1->fpa); // Input cell of interest
-            pmCell *inCell2 = input2 ? pmFPAviewThisCell(view, input2->fpa) : NULL; // Input cell of interest
+            pmCell *inCell1 = pmFPAviewThisCell(view, input1->fpa); ///< Input cell of interest
+            pmCell *inCell2 = input2 ? pmFPAviewThisCell(view, input2->fpa) : NULL; ///< Input cell of interest
             if (inCell2 && ((!inCell1->file_exists && inCell2->file_exists) ||
                             (inCell1->file_exists && !inCell2->file_exists))) {
@@ -105,12 +117,12 @@
             }
 
-            pmReadout *outRO;           // Readout of interest
+            pmReadout *outRO;           ///< Readout of interest
             while ((outRO = pmFPAviewNextReadout(view, output->fpa, 1))) {
                 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
                     return false;
                 }
-                pmReadout *inRO1 = pmFPAviewThisReadout(view, input1->fpa);// Input readout of interest
+                pmReadout *inRO1 = pmFPAviewThisReadout(view, input1->fpa);///< Input readout of interest
                 pmReadout *inRO2 = input2 ? pmFPAviewThisReadout(view, input2->fpa) :
-                    NULL;// Input readout of interest
+                    NULL;///< Input readout of interest
 
                 if (inRO2 && ((!inRO1->data_exists && inRO2->data_exists) ||
Index: /trunk/ppArith/src/ppArithReadout.c
===================================================================
--- /trunk/ppArith/src/ppArithReadout.c	(revision 21243)
+++ /trunk/ppArith/src/ppArithReadout.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppArithReadout.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -17,9 +29,9 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
 
-    bool mdok;                          // Status of MD lookup
+    bool mdok;                          ///< Status of MD lookup
     bool isMask = psMetadataLookupBool(&mdok, config->arguments, "MASK");
 
-    psImage *inImage1;  // Input image 1
-    psImage *outImage;  // Output image
+    psImage *inImage1;  ///< Input image 1
+    psImage *outImage;  ///< Output image
     if (isMask) {
         inImage1 = input1->mask;
@@ -42,5 +54,5 @@
     PS_ASSERT_IMAGE_NON_NULL(inImage1, false);
 
-    psImage *inImage2 = NULL;           // Input image 2
+    psImage *inImage2 = NULL;           ///< Input image 2
     if (input2) {
         inImage2 = isMask ? input2->mask : input2->image;
@@ -61,5 +73,5 @@
 
     // Look up appropriate values
-    const char *op = psMetadataLookupStr(NULL, config->arguments, "OPERATION"); // Operation to perform
+    const char *op = psMetadataLookupStr(NULL, config->arguments, "OPERATION"); ///< Operation to perform
 
     if (input2) {
Index: /trunk/ppArith/src/ppArithVersion.c
===================================================================
--- /trunk/ppArith/src/ppArithVersion.c	(revision 21243)
+++ /trunk/ppArith/src/ppArithVersion.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppArithVersion.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppArith
+ *
+ *  @author IfA
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:40:52 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -10,9 +22,9 @@
 #include "ppArith.h"
 
-static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
+static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name
 
 psString ppArithVersion(void)
 {
-    psString version = NULL;            // Version, to return
+    psString version = NULL;            ///< Version, to return
     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
     return version;
@@ -21,6 +33,6 @@
 psString ppArithVersionLong(void)
 {
-    psString version = ppArithVersion(); // Version, to return
-    psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
+    psString version = ppArithVersion(); ///< Version, to return
+    psString tag = psStringStripCVS(cvsTag, "Name"); ///< CVS tag
     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
     psFree(tag);
@@ -33,13 +45,13 @@
     PS_ASSERT_METADATA_NON_NULL(metadata,);
 
-    psString pslib = psLibVersionLong();// psLib version
-    psString psmodules = psModulesVersionLong(); // psModules version
-    psString ppStats = ppStatsVersionLong(); // ppStats version
-    psString ppArith = ppArithVersionLong(); // ppArith version
+    psString pslib = psLibVersionLong();///< psLib version
+    psString psmodules = psModulesVersionLong(); ///< psModules version
+    psString ppStats = ppStatsVersionLong(); ///< ppStats version
+    psString ppArith = ppArithVersionLong(); ///< ppArith version
 
-    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
-    psString timeString = psTimeToISO(time); // The time in an ISO string
+    psTime *time = psTimeGetNow(PS_TIME_TAI); ///< The time now
+    psString timeString = psTimeToISO(time); ///< The time in an ISO string
     psFree(time);
-    psString head = NULL;               // Head string
+    psString head = NULL;               ///< Head string
     psStringAppend(&head, "ppArith processing at %s. Component information:", timeString);
     psFree(timeString);
Index: /trunk/ppMerge/src/ppMerge.c
===================================================================
--- /trunk/ppMerge/src/ppMerge.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMerge.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMerge.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
@@ -12,7 +24,7 @@
     psTimerStart(TIMERNAME);
 
-    psExit exitValue = PS_EXIT_SUCCESS; // Exit value for program
+    psExit exitValue = PS_EXIT_SUCCESS; ///< Exit value for program
 
-    pmConfig *config = pmConfigRead(&argc, argv, PPMERGE_RECIPE); // Configuration
+    pmConfig *config = pmConfigRead(&argc, argv, PPMERGE_RECIPE); ///< Configuration
     if (!config) {
         psErrorStackPrint(stderr, "Error reading configuration.");
@@ -27,5 +39,5 @@
     }
 
-    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
+    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
     switch (type) {
       case PPMERGE_TYPE_MASK:
@@ -58,9 +70,9 @@
 
     // Output the statistics
-    bool mdok;                          // Status of MD lookup
-    psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); // Statistics file name
+    bool mdok;                          ///< Status of MD lookup
+    psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); ///< Statistics file name
     if (mdok && statsName && strlen(statsName) > 0) {
-        psString resolved = pmConfigConvertFilename(statsName, config, true, true); // Resolved filename
-        FILE *statsFile = fopen(resolved, "w"); // Output statistics file
+        psString resolved = pmConfigConvertFilename(statsName, config, true, true); ///< Resolved filename
+        FILE *statsFile = fopen(resolved, "w"); ///< Output statistics file
         if (!statsFile) {
             psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.", resolved);
@@ -70,5 +82,5 @@
         }
         psFree(resolved);
-        psMetadata *stats = psMetadataLookupMetadata(&mdok, config->arguments, "STATS.DATA"); // Statistics
+        psMetadata *stats = psMetadataLookupMetadata(&mdok, config->arguments, "STATS.DATA"); ///< Statistics
         if (!stats) {
             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find statistics");
@@ -76,5 +88,5 @@
             goto die;
         }
-        psString statsOut = psMetadataConfigFormat(stats); // String to write out
+        psString statsOut = psMetadataConfigFormat(stats); ///< String to write out
         fprintf(statsFile, "%s", statsOut);
         psFree(statsOut);
Index: /trunk/ppMerge/src/ppMerge.h
===================================================================
--- /trunk/ppMerge/src/ppMerge.h	(revision 21243)
+++ /trunk/ppMerge/src/ppMerge.h	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMerge.h
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifndef PP_MERGE_H
 #define PP_MERGE_H
@@ -13,107 +25,145 @@
 #include <ppStats.h>
 
-#define TIMERNAME "ppMerge"             // Name for timer
-#define PPMERGE_RECIPE "PPMERGE"        // Recipe name
-#define THREADED 1                      // Compile with threads?
+/// @addtogroup ppArith
+/// @{
 
-// Type of frame to merge
+#define TIMERNAME "ppMerge"             ///< Name for timer 
+#define PPMERGE_RECIPE "PPMERGE"        ///< Recipe name 
+#define THREADED 1                      ///< Compile with threads? 
+
+/**
+ * Type of frame to merge
+ */
 typedef enum {
-    PPMERGE_TYPE_UNKNOWN,               // Unknown type
-    PPMERGE_TYPE_BIAS,                  // Bias frame
-    PPMERGE_TYPE_DARK,                  // (Multi-)Dark frame
-    PPMERGE_TYPE_MASK,                  // Mask frame
-    PPMERGE_TYPE_SHUTTER,               // Shutter frame
-    PPMERGE_TYPE_FLAT,                  // Flat-field frame (dome or sky)
-    PPMERGE_TYPE_FRINGE,                // Fringe frame
+    PPMERGE_TYPE_UNKNOWN,               ///< Unknown type 
+    PPMERGE_TYPE_BIAS,                  ///< Bias frame 
+    PPMERGE_TYPE_DARK,                  ///< (Multi-)Dark frame 
+    PPMERGE_TYPE_MASK,                  ///< Mask frame 
+    PPMERGE_TYPE_SHUTTER,               ///< Shutter frame 
+    PPMERGE_TYPE_FLAT,                  ///< Flat-field frame (dome or sky)
+    PPMERGE_TYPE_FRINGE,                ///< Fringe frame 
 } ppMergeType;
 
-// Files, for activation
+/**
+ * Files, for activation
+ */
 typedef enum {
-    PPMERGE_FILES_ALL,                  // All files
-    PPMERGE_FILES_INPUT,                // Input files
-    PPMERGE_FILES_OUTPUT                // Output files
+    PPMERGE_FILES_ALL,                  ///< All files 
+    PPMERGE_FILES_INPUT,                ///< Input files 
+    PPMERGE_FILES_OUTPUT                ///< Output files 
 } ppMergeFiles;
 
-// Group of files to read
-//
-// Each file contributes a readout, into which is read a chunk from that file
+/**
+ * \brief Group of files to read
+ *
+ * Each file contributes a readout, into which is read a chunk from that file
+ */
 typedef struct {
-    psArray *readouts;                  // Input readouts
-    bool read;                          // Has the scan been read?
-    bool busy;                          // Is the scan being processed?
-    int firstScan;                      // First row of the chunk to be read for this group
-    int lastScan;                       // Last row of the chunk to be read for this group
+    psArray *readouts;                  ///< Input readouts 
+    bool read;                          ///< Has the scan been read? 
+    bool busy;                          ///< Is the scan being processed? 
+    int firstScan;                      ///< First row of the chunk to be read for this group 
+    int lastScan;                       ///< Last row of the chunk to be read for this group 
 } ppMergeFileGroup;
 
-// Parse command-line arguments and recipe
-bool ppMergeArguments(int argc, char *argv[], // Command-line arguments
-                      pmConfig *config  // Configuration
+/**
+ * Parse command-line arguments and recipe
+ */
+bool ppMergeArguments(int argc, char *argv[], ///< Command-line arguments
+                      pmConfig *config  ///< Configuration 
     );
 
-// Set up camera files
-bool ppMergeCamera(pmConfig *config     // Configuration
+/**
+ * Set up camera files
+ */
+bool ppMergeCamera(pmConfig *config     ///< Configuration 
     );
 
-// Measure scale and zero-points
-bool ppMergeScaleZero(pmConfig *config  // Configuration
+/**
+ * Measure scale and zero-points
+ */
+bool ppMergeScaleZero(pmConfig *config  ///< Configuration 
     );
 
-// Main loop to do the merging
-bool ppMergeLoop(pmConfig *config       // Configuration
+/**
+ * Main loop to do the merging
+ */
+bool ppMergeLoop(pmConfig *config       ///< Configuration 
     );
 
-// Main loop for masks
-bool ppMergeMask(pmConfig *config       // Configuration
+/**
+ * Main loop for masks
+ */
+bool ppMergeMask(pmConfig *config       ///< Configuration 
     );
 
-// Read nominated input file
-bool ppMergeFileReadInput(pmConfig *config, // Configuration
-                          pmReadout *readout, // Readout into which to read
-                          int num,      // Number of file in sequence
-                          int rows      // Number of rows to read at once
+/**
+ * Read nominated input file
+ */
+bool ppMergeFileReadInput(pmConfig *config, ///< Configuration 
+                          pmReadout *readout, ///< Readout into which to read 
+                          int num,      ///< Number of file in sequence 
+                          int rows      ///< Number of rows to read at once 
     );
 
-// Open nominated input file
-bool ppMergeFileOpenInput(pmConfig *config, // Configuration
-                          const pmFPAview *view, // View to open
-                          int num       // Number of file in sequence
+/**
+ * Open nominated input file
+ */
+bool ppMergeFileOpenInput(pmConfig *config, ///< Configuration 
+                          const pmFPAview *view, ///< View to open 
+                          int num       ///< Number of file in sequence 
     );
 
-// Set the data level for files specified by name; return an array of the files
-psArray *ppMergeFileDataLevel(const pmConfig *config, // Configuration
-                              const char *name, // Name of files
-                              pmFPALevel level // Level for file data level
+/**
+ * Set the data level for files specified by name; return an array of the files
+ */
+psArray *ppMergeFileDataLevel(const pmConfig *config, ///< Configuration
+                              const char *name, ///< Name of files
+                              pmFPALevel level ///< Level for file data level
     );
 
-// Activate/deactivate a list of files
-bool ppMergeFileActivate(const pmConfig *config, // Configuration
-                         ppMergeFiles files, // Files to turn on/off
-                         bool state     // Activation state
+/**
+ * Activate/deactivate a list of files
+ */
+bool ppMergeFileActivate(const pmConfig *config, ///< Configuration
+                         ppMergeFiles files, ///< Files to turn on/off
+                         bool state     ///< Activation state
     );
 
-// Activate/deactivate a single element for a list; return array of files
-psArray *ppMergeFileActivateSingle(const pmConfig *config, // Configuration
-                                   ppMergeFiles files, // Files to turn on/off
-                                   bool state,   // Activation state
-                                   int num // Number of file in sequence
+/**
+ * Activate/deactivate a single element for a list; return array of files
+ */
+psArray *ppMergeFileActivateSingle(const pmConfig *config, ///< Configuration
+                                   ppMergeFiles files, ///< Files to turn on/off
+                                   bool state,   ///< Activation state
+                                   int num ///< Number of file in sequence
     );
 
-// Return name of output pmFPAfile
-psString ppMergeOutputFile(const pmConfig *config // Configuration
+/**
+ * Return name of output pmFPAfile
+ */
+psString ppMergeOutputFile(const pmConfig *config ///< Configuration
     );
 
 
-// Allocator for group of files
+/**
+ * Allocator for group of files
+ */
 ppMergeFileGroup *ppMergeFileGroupAlloc(void);
 
-// Read chunk into the first available file group
-ppMergeFileGroup *ppMergeReadChunk(bool *status, // Status of read
-                                   psArray *fileGroups, // All groups
-                                   pmConfig *config, // Configuration
-                                   int numChunk // Chunk number (only for interest)
+/**
+ * Read chunk into the first available file group
+ */
+ppMergeFileGroup *ppMergeReadChunk(bool *status, ///< Status of read
+                                   psArray *fileGroups, ///< All groups
+                                   pmConfig *config, ///< Configuration
+                                   int numChunk ///< Chunk number (only for interest)
     );
 
-// Set up thread handling
+/**
+ * Set up thread handling
+ */
 bool ppMergeSetThreads(void);
 
+///@}
 #endif
Index: /trunk/ppMerge/src/ppMergeArguments.c
===================================================================
--- /trunk/ppMerge/src/ppMergeArguments.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeArguments.c	(revision 21244)
@@ -1,7 +1,21 @@
+/** @file ppMergeArguments.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
-// Print usage information and die
-static void usage(const char *program,  // Name of the program
-                  psMetadata *arguments // Command-line arguments
+/**
+ * Print usage information and die
+ */
+static void usage(const char *program,  ///< Name of the program
+                  psMetadata *arguments ///< Command-line arguments
     )
 {
@@ -18,5 +32,7 @@
 }
 
-// Get a float-point value from the command-line or recipe, and add it to the arguments
+/**
+ * Get a float-point value from the command-line or recipe, and add it to the arguments
+ */
 #define VALUE_ARG_RECIPE_FLOAT(ARGNAME, RECIPENAME, TYPE) { \
     ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
@@ -33,5 +49,7 @@
 }
 
-// Get an integer value from the command-line or recipe, and add it to the arguments
+/**
+ * Get an integer value from the command-line or recipe, and add it to the arguments
+ */
 #define VALUE_ARG_RECIPE_INT(ARGNAME, RECIPENAME, TYPE, UNSET) { \
     ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
@@ -48,5 +66,7 @@
 }
 
-// Get a boolean from the command-line or recipe, and add it to the arguments if either is set
+/**
+ * Get a boolean from the command-line or recipe, and add it to the arguments if either is set
+ */
 #define VALUE_ARG_RECIPE_BOOL(ARGNAME, RECIPENAME) { \
     bool value = (psMetadataLookupBool(NULL, arguments, ARGNAME) || \
@@ -55,5 +75,7 @@
 }
 
-// Get a statistic name from the command-line or recipe, and add the enum to the arguments
+/**
+ * Get a statistic name from the command-line or recipe, and add the enum to the arguments
+ */
 #define VALUE_ARG_RECIPE_STAT(ARGNAME, RECIPENAME) { \
     const char *stat = psMetadataLookupStr(NULL, arguments, ARGNAME); \
@@ -69,5 +91,7 @@
 }
 
-// Get a string from the command-line or recipe, and add to the arguments
+/**
+ * Get a string from the command-line or recipe, and add to the arguments
+ */
 #define VALUE_ARG_RECIPE_STR(ARGNAME, RECIPENAME) { \
     const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
@@ -83,5 +107,7 @@
 }
 
-// Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
+/**
+ * Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
+ */
 #define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \
     const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
@@ -98,12 +124,14 @@
 }
 
-// Get a string value from the command-line and add it to the target
-static bool valueArgStr(psMetadata *arguments, // Command-line arguments
-                        const char *argName, // Argument name in the command-line arguments
-                        const char *mdName, // Name for value in the metadata
-                        psMetadata *target // Target metadata to which to add value
+/**
+ * Get a string value from the command-line and add it to the target
+ */
+static bool valueArgStr(psMetadata *arguments, ///< Command-line arguments
+                        const char *argName, ///< Argument name in the command-line arguments
+                        const char *mdName, ///< Name for value in the metadata
+                        psMetadata *target ///< Target metadata to which to add value
                         )
 {
-    psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest
+    psString value = psMetadataLookupStr(NULL, arguments, argName); ///< Value of interest
     if (value && strlen(value) > 0) {
         return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
@@ -116,5 +144,5 @@
     assert(config);
 
-    psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
+    psMetadata *arguments = psMetadataAlloc(); ///< Command-line arguments
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Type of calibration frame", NULL);
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "MDC file to hold statistics ", NULL);
@@ -136,5 +164,5 @@
     psMetadataAddStr(arguments, PS_LIST_TAIL, "-stdev",    0, "Statistic to use to measure the stdev", NULL);
 
-    // Fringe construction parameters
+    /** Fringe construction parameters */
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-num",     0, "Number of fringe regions", 0);
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-size",    0, "Half-size of fringe regions", 0);
@@ -142,10 +170,10 @@
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-ysmooth", 0, "Number of smoothing regions in y", 0);
 
-    // Shutter construction parameters
+    /** Shutter construction parameters */
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-size", 0, "Size for shutter measurement regions", 0);
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-iter", 0, "Number of iterations for shutter", 0);
     psMetadataAddF32(arguments, PS_LIST_TAIL, "-shutter-rej",  0, "Rejection limit for shutter", NAN);
 
-    // Mask construction parameters
+    /** Mask construction parameters */
     psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-suspect",  0, "Threshold for suspect pixels (sigma)", NAN);
     psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-bad",      0, "Threshold for bad pixels (sigma)", NAN);
@@ -189,6 +217,6 @@
     }
 
-    unsigned int numBad = 0;                     // Number of bad lines
-    psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); // Information about inputs
+    unsigned int numBad = 0;                     ///< Number of bad lines
+    psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); ///< Information about inputs
     if (!inputs || numBad > 0) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to cleanly read MDC file with inputs.");
@@ -205,10 +233,10 @@
 
     // Set the type of calibration frame
-    const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Type of calibration
+    const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); ///< Type of calibration
     if (!typeStr || strlen(typeStr) <= 0) {
       psError(PS_ERR_UNKNOWN, false, "No -type specified.");
       goto ERROR;
     }
-    ppMergeType type = PPMERGE_TYPE_UNKNOWN; // Enumerated type for frame type
+    ppMergeType type = PPMERGE_TYPE_UNKNOWN; ///< Enumerated type for frame type
     if (strcasecmp(typeStr, "BIAS") == 0) {
       type = PPMERGE_TYPE_BIAS;
@@ -258,5 +286,5 @@
     }
 
-    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); // Recipe for ppSim
+    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); ///< Recipe for ppSim
     if (!recipe) {
         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPMERGE_RECIPE);
@@ -264,5 +292,5 @@
     }
 
-    // Standard combination parameters
+    /** Standard combination parameters */
     VALUE_ARG_RECIPE_INT("-rows",       "ROWS",     S32, 0);
     VALUE_ARG_RECIPE_INT("-sample",     "SAMPLE",   S32, 0);
@@ -281,5 +309,5 @@
     VALUE_ARG_RECIPE_STAT("-stdev",     "STDEV");
 
-    // Fringe construction parameters
+    /** Fringe construction parameters */
     VALUE_ARG_RECIPE_INT("-fringe-num",     "FRINGE.NUM",     S32, 0);
     VALUE_ARG_RECIPE_INT("-fringe-size",    "FRINGE.SIZE",    S32, 0);
@@ -287,8 +315,8 @@
     VALUE_ARG_RECIPE_INT("-fringe-ysmooth", "FRINGE.YSMOOTH", S32, 0);
 
-    // Shutter construction parameters
+    /** Shutter construction parameters */
     VALUE_ARG_RECIPE_INT("-shutter-size",  "SHUTTER.SIZE", S32, 0);
 
-    // Mask construction parameters
+    /** Mask construction parameters */
     VALUE_ARG_RECIPE_FLOAT("-mask-suspect", "MASK.SUSPECT", F32);
     VALUE_ARG_RECIPE_FLOAT("-mask-bad",     "MASK.BAD",     F32);
@@ -300,5 +328,5 @@
     VALUE_ARG_RECIPE_FLOAT("-mask-smooth-scale", "MASK.SMOOTH.SCALE", F32);
 
-    const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); // Mode to identify bad pix
+    const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); ///< Mode to identify bad pix
     if (!maskModeStr) {
         maskModeStr = psMetadataLookupStr(NULL, recipe, "MASK.MODE");
@@ -318,13 +346,13 @@
 
     if (type == PPMERGE_TYPE_DARK) {
-        psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); // Ordinates info
-        psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); // Translated version
-
-        psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); // Iterator
-        psMetadataItem *item;           // Item from iteration
+        psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); ///< Ordinates info
+        psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); ///< Translated version
+
+        psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); ///< Iterator
+        psMetadataItem *item;           ///< Item from iteration
         while ((item = psMetadataGetAndIncrement(iter))) {
-            int order = 0;              // Polynomial order
-            bool scale = false;         // Scale values?
-            float min = NAN, max = NAN; // Minimum and maximum values for scaling
+            int order = 0;              ///< Polynomial order
+            bool scale = false;         ///< Scale values?
+            float min = NAN, max = NAN; ///< Minimum and maximum values for scaling
             switch (item->type) {
               case PS_TYPE_S32:
@@ -333,5 +361,5 @@
               case PS_DATA_METADATA:
                 order = psMetadataLookupS32(NULL, item->data.md, "ORDER");
-                bool mdok;                  // Status of MD lookup
+                bool mdok;                  ///< Status of MD lookup
                 scale = psMetadataLookupBool(&mdok, item->data.md, "SCALE");
                 min = psMetadataLookupF32(&mdok, item->data.md, "MIN");
@@ -361,7 +389,7 @@
         psMetadataAddArray(config->arguments, PS_LIST_TAIL, "DARK.ORDINATES", 0,
                            "Ordinates to fit for dark", translated);
-        psFree(translated);             // Drop reference
-
-        psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); // Normalisation concept
+        psFree(translated);             ///< Drop reference
+
+        psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); ///<Normalisation concept
         if (darkNorm && strcmp(darkNorm, "NONE") != 0) {
             psMetadataAddStr(config->arguments, PS_LIST_TAIL, "DARK.NORM", 0,
Index: /trunk/ppMerge/src/ppMergeCamera.c
===================================================================
--- /trunk/ppMerge/src/ppMergeCamera.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeCamera.c	(revision 21244)
@@ -1,11 +1,25 @@
+/** @file ppMergeCamera.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
-// Define an output file, with its own FPA
-bool outputFile(pmConfig *config,       // Configuration
-                const char *name,       // Name of output file
-                pmFPAfileType type,     // Type of file
-                const char *description, // Description of file
-                psMetadata *format,     // Camera format
-                pmFPAview *view         // View for PHU
+/**
+ * Define an output file, with its own FPA
+ */
+bool outputFile(pmConfig *config,       ///< Configuration
+                const char *name,       ///< Name of output file
+                pmFPAfileType type,     ///< Type of file
+                const char *description, ///< Description of file
+                psMetadata *format,     ///< Camera format
+                pmFPAview *view         ///< View for PHU
     )
 {
@@ -15,5 +29,5 @@
 
     // Output image
-    pmFPA *fpa = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
+    pmFPA *fpa = pmFPAConstruct(config->camera, config->cameraName); ///< FPA to contain the output
     if (!fpa) {
         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
@@ -84,9 +98,9 @@
     bool haveWeights = false;           // Do we have weight maps?
 
-    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
-    psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
-    psMetadataIterator *iter = psMetadataIteratorAlloc(inputs, PS_LIST_HEAD, NULL); // Iterator
-    psMetadataItem *item;               // Item from iteration
-    int numFiles = 0;                   // Number of files
+    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
+    psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); ///< The inputs info
+    psMetadataIterator *iter = psMetadataIteratorAlloc(inputs, PS_LIST_HEAD, NULL); ///< Iterator
+    psMetadataItem *item;               ///< Item from iteration
+    int numFiles = 0;                   ///< Number of files
     while ((item = psMetadataGetAndIncrement(iter))) {
         if (item->type != PS_DATA_METADATA) {
@@ -97,7 +111,7 @@
         }
 
-        psMetadata *input = item->data.md; // The input metadata of interest
-
-        psString image = psMetadataLookupStr(NULL, input, "IMAGE"); // Name of image
+        psMetadata *input = item->data.md; ///< The input metadata of interest
+
+        psString image = psMetadataLookupStr(NULL, input, "IMAGE"); ///< Name of image
         if (!image || strlen(image) == 0) {
             psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks IMAGE of type STR", item->name);
@@ -107,9 +121,9 @@
 
         bool mdok;
-        psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask
-        psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
+        psString mask = psMetadataLookupStr(&mdok, input, "MASK"); ///< Name of mask
+        psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); ///< Name of weight map
 
         // Add the image file
-        psArray *imageFiles = psArrayAlloc(1); // Array of filenames for this FPA
+        psArray *imageFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
         imageFiles->data[0] = psMemIncrRefCounter(image);
         psMetadataAddArray(config->arguments, PS_LIST_TAIL, "IMAGE.FILENAMES", PS_META_REPLACE,
@@ -130,5 +144,5 @@
         // Optionally add the mask file
         if (mask && strlen(mask) > 0) {
-            psArray *maskFiles = psArrayAlloc(1); // Array of filenames for this FPA
+            psArray *maskFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
             maskFiles->data[0] = psMemIncrRefCounter(mask);
             psMetadataAddArray(config->arguments, PS_LIST_TAIL, "MASK.FILENAMES", PS_META_REPLACE,
@@ -153,5 +167,5 @@
         if (weight && strlen(weight) > 0) {
             haveWeights = true;
-            psArray *weightFiles = psArrayAlloc(1); // Array of filenames for this FPA
+            psArray *weightFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
             weightFiles->data[0] = psMemIncrRefCounter(weight);
             psMetadataAddArray(config->arguments, PS_LIST_TAIL, "WEIGHT.FILENAMES", PS_META_REPLACE,
@@ -219,17 +233,17 @@
 }
 
-    psMetadata *format = NULL;          // Camera format
-    pmFPAview *phuView = NULL;          // View to PHU
+    psMetadata *format = NULL;          ///< Camera format
+    pmFPAview *phuView = NULL;          ///< View to PHU
     for (int i = 0; i < numFiles; i++) {
-        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // File of interest
-        pmFPA *fpa = input->fpa;        // FPA of interest
+        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< File of interest
+        pmFPA *fpa = input->fpa;        ///< FPA of interest
         CHECK_LEVEL(fpa->hdu, -1, -1);
-        psArray *chips = fpa->chips;    // Array of chips
+        psArray *chips = fpa->chips;    ///< Array of chips
         for (int j = 0; j < chips->n; j++) {
-            pmChip *chip = chips->data[j]; // Chip of interest
+            pmChip *chip = chips->data[j]; ///< Chip of interest
             CHECK_LEVEL(chip->hdu, j, -1);
-            psArray *cells = chip->cells;   // Array of cells
+            psArray *cells = chip->cells;   ///< Array of cells
             for (int k = 0; k < cells->n; k++) {
-                pmCell *cell = cells->data[k]; // Cell of interest
+                pmCell *cell = cells->data[k]; ///< Cell of interest
                 CHECK_LEVEL(cell->hdu, j, k);
             }
@@ -245,14 +259,14 @@
     // Otherwise the abundance of metadata in the concepts (esp. for GPC) can overload the memory
     for (int i = 0; i < numFiles; i++) {
-        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // File of interest
-        pmFPA *fpa = input->fpa;        // FPA of interest
-        psArray *chips = fpa->chips; // Array of chips in output
+        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< File of interest
+        pmFPA *fpa = input->fpa;        ///< FPA of interest
+        psArray *chips = fpa->chips; ///< Array of chips in output
         for (int i = 0; i < chips->n; i++) {
-            pmChip *chip = chips->data[i]; // Chip of interest
-            psArray *cells = chip->cells; // Array of cells
-            int culled = 0;             // Number of culled cells
+            pmChip *chip = chips->data[i]; ///< Chip of interest
+            psArray *cells = chip->cells; ///< Array of cells
+            int culled = 0;             ///< Number of culled cells
             for (int j = 0; j < cells->n; j++) {
                 pmCell *cell = cells->data[j];
-                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU for cell
+                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); ///< HDU for cell
                 if (!hdu || hdu->blankPHU) {
                     cell->data_exists = false;
@@ -278,14 +292,14 @@
     // Count the cells
     {
-        int numCells = 0;               // Number of cells
-        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", 0); // Representative file
-        pmFPA *fpa = input->fpa;        // FPA for file
-        psArray *chips = fpa->chips; // Array of chips
+        int numCells = 0;               ///< Number of cells
+        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", 0); ///< Representative file
+        pmFPA *fpa = input->fpa;        ///< FPA for file
+        psArray *chips = fpa->chips; ///< Array of chips
         for (int i = 0; i < chips->n; i++) {
-            pmChip *chip = chips->data[i]; // Chip of interest
-            psArray *cells = chip->cells; // Array of cells
+            pmChip *chip = chips->data[i]; ///< Chip of interest
+            psArray *cells = chip->cells; ///< Array of cells
             for (int j = 0; j < cells->n; j++) {
-                pmCell *cell = cells->data[j]; // Cell of interest
-                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU that would have data
+                pmCell *cell = cells->data[j]; ///< Cell of interest
+                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); ///< HDU that would have data
                 if (hdu && !hdu->blankPHU) {
                     numCells++;
@@ -298,7 +312,7 @@
     }
 
-    psString outName = ppMergeOutputFile(config); // Name of output file
-
-    pmFPAfileType fileType = PM_FPA_FILE_NONE; // Type of output file
+    psString outName = ppMergeOutputFile(config); ///< Name of output file
+
+    pmFPAfileType fileType = PM_FPA_FILE_NONE; ///< Type of output file
     switch (type) {
       case PPMERGE_TYPE_BIAS:
Index: /trunk/ppMerge/src/ppMergeErrorCodes.c.in
===================================================================
--- /trunk/ppMerge/src/ppMergeErrorCodes.c.in	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeErrorCodes.c.in	(revision 21244)
@@ -1,2 +1,17 @@
+/** @file ppMergeErrorCodes.c.in
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
+#include "pslib.h"
+#include "ppMergeErrorCodes.h"
+
 /*
  * The line
@@ -5,7 +20,4 @@
  * will be replaced by values from errorCodes.dat
  */
-#include "pslib.h"
-#include "ppMergeErrorCodes.h"
-
 void ppMergeErrorRegister(void)
 {
@@ -14,5 +26,5 @@
        { PPMERGE_ERR_${ErrorCode}, "${ErrorDescription}"},
     };
-    static int nerror = PPMERGE_ERR_NERROR - PPMERGE_ERR_BASE; // number of values in enum
+    static int nerror = PPMERGE_ERR_NERROR - PPMERGE_ERR_BASE; ///< number of values in enum
 
     for (int i = 0; i < nerror; i++) {
@@ -21,5 +33,5 @@
        *tmp = errors[i];
        psErrorRegister(tmp, 1);
-       psFree(tmp);			/* it's on the internal list */
+       psFree(tmp);			// it's on the internal list
     }
     nerror = 0;			                // don't register more than once
Index: /trunk/ppMerge/src/ppMergeErrorCodes.h.in
===================================================================
--- /trunk/ppMerge/src/ppMergeErrorCodes.h.in	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeErrorCodes.h.in	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeErrorCodes.h.in
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #if !defined(PPMERGE_ERROR_CODES_H)
 #define PPMERGE_ERROR_CODES_H
Index: /trunk/ppMerge/src/ppMergeFileGroup.c
===================================================================
--- /trunk/ppMerge/src/ppMergeFileGroup.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeFileGroup.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeFileGroup.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 # include "ppMerge.h"
 
Index: /trunk/ppMerge/src/ppMergeFiles.c
===================================================================
--- /trunk/ppMerge/src/ppMergeFiles.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeFiles.c	(revision 21244)
@@ -1,13 +1,27 @@
+/** @file ppMergeFiles.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
                            "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
-                           NULL };      // All files
+                           NULL };      ///< All files
 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
-                             NULL };    // Input files
+                             NULL };    ///< Input files
 const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
-                              NULL };   // Output files
-
-// Select file list based on enum
+                              NULL };   ///< Output files
+
+/**
+ * Select file list based on enum
+ */
 static const char **selectFiles(ppMergeFiles files)
 {
Index: /trunk/ppMerge/src/ppMergeLoop.c
===================================================================
--- /trunk/ppMerge/src/ppMergeLoop.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeLoop.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeLoop.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
@@ -5,13 +17,13 @@
     assert(config);
 
-    psMetadata *arguments = config->arguments; // Arguments
-    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
-    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); // Number of input files
-    bool mdok;                          // Status of MD lookup
-    bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
-
-    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
-    psArray *masks = NULL, *weights = NULL; // Input masks and weights
+    psMetadata *arguments = config->arguments; ///< Arguments
+    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
+    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); ///< Number of input files
+    bool mdok;                          ///< Status of MD lookup
+    bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); ///< Do we have masks?
+    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
+
+    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
+    psArray *masks = NULL, *weights = NULL; ///< Input masks and weights
     if (haveMasks) {
         masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
@@ -21,19 +33,19 @@
     }
 
-    // General combination parameters
-    int rows = psMetadataLookupS32(NULL, arguments, "ROWS"); // Number of rows to read per chunk
-    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); // Number of rejection iterations
-    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); // Rejection level
-    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); // Reject fraction of low pixels
-    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); // Reject fraction of hi pixels
-    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
-    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
-    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
-
-    // Fringe parameters
-    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); // Number of fringe points
-    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); // Size of fringe regions
-    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
-    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
+    /** General combination parameters */
+    int rows = psMetadataLookupS32(NULL, arguments, "ROWS"); ///< Number of rows to read per chunk
+    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); ///< Number of rejection iterations
+    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); ///< Rejection level
+    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); ///< Reject fraction of low pixels
+    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); ///< Reject fraction of hi pixels
+    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); ///< Minimum number of values to keep
+    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); ///< Combination statistic
+    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); ///< Use weights?
+
+    /** Fringe parameters */
+    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); ///* Number of fringe points
+    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); ///* Size of fringe regions
+    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); ///< Smoothing regions in x
+    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); ///< Smoothing regions in y
 
     // set the mask and mark bit values based on the named masks
@@ -45,5 +57,5 @@
     }
 
-    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); // Combination parameters
+    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); ///< Combination parameters
     combination->maskVal = maskVal;
     combination->blank = pmConfigMaskGet("BLANK", config);
@@ -55,5 +67,5 @@
     combination->weights = useWeights;
 
-    psMetadata *stats = NULL;           // Statistics for output
+    psMetadata *stats = NULL;           ///< Statistics for output
     if (psMetadataLookup(config->arguments, "STATS.NAME")) {
         stats = psMetadataAlloc();
@@ -61,9 +73,9 @@
     }
 
-    pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
+    pmFPAview *view = pmFPAviewAlloc(0); ///< View to component of interest
 
     // Retrieve data placed on analysis
-    psVector *scales = NULL, *zeros = NULL; // Scale and zeroes for combination
-    psArray *shutters = NULL;           // Shutter correction data
+    psVector *scales = NULL, *zeros = NULL; ///< Scale and zeroes for combination
+    psArray *shutters = NULL;           ///< Shutter correction data
     switch (type) {
       case PPMERGE_TYPE_FRINGE:
@@ -97,6 +109,6 @@
 
     // Dark parameters
-    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); // Dark info
-    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); // Dark normalisation
+    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); ///< Dark info
+    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); ///< Dark normalisation
 
 
@@ -105,19 +117,19 @@
         goto ERROR;
     }
-    psString outName = ppMergeOutputFile(config); // Name of output file
-    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
+    psString outName = ppMergeOutputFile(config); ///< Name of output file
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
     psFree(outName);
     assert(output && output->fpa);
-    pmFPA *outFPA = output->fpa;        // Output FPA
-    int cellNum = 0;                    // Index of cell
+    pmFPA *outFPA = output->fpa;        ///< Output FPA
+    int cellNum = 0;                    ///< Index of cell
     if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
         goto ERROR;
     }
-    pmChip *outChip;                    // Chip of interest
+    pmChip *outChip;                    ///< Chip of interest
     while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
         if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
             goto ERROR;
         }
-        pmCell *outCell;                // Cell of interest
+        pmCell *outCell;                ///< Cell of interest
         while ((outCell = pmFPAviewNextCell(view, outFPA, 1))) {
             if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
@@ -125,5 +137,5 @@
             }
 
-            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); // HDU for cell
+            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); ///< HDU for cell
             if (!hdu || hdu->blankPHU) {
                 // No data here
@@ -133,5 +145,5 @@
             pmReadout *outRO = pmReadoutAlloc(outCell);
 
-            psArray *readouts = psArrayAlloc(numFiles); // Input readouts
+            psArray *readouts = psArrayAlloc(numFiles); ///< Input readouts
             for (int i = 0; i < numFiles; i++) {
                 // We need to do some of the opening ourselves
@@ -142,9 +154,9 @@
 
                 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i);
-                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
+                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
                 readouts->data[i] = pmReadoutAlloc(inCell);
             }
 
-            float shutterRef = NAN;     // Reference shutter correction
+            float shutterRef = NAN;     ///< Reference shutter correction
             if (type == PPMERGE_TYPE_SHUTTER) {
                 shutterRef = pmShutterCorrectionReference(shutters->data[cellNum]);
@@ -156,5 +168,5 @@
                 psTrace("ppStack", 2, "Initial stack of chunk %d....\n", numChunk);
                 for (int i = 0; i < numFiles; i++) {
-                    pmReadout *inRO = readouts->data[i]; // Input readout
+                    pmReadout *inRO = readouts->data[i]; ///< Input readout
 
                     // Read a chunk from a file
@@ -229,7 +241,7 @@
 
             // Get list of cells for concepts averaging
-            psList *inCells = psListAlloc(NULL); // List of cells
+            psList *inCells = psListAlloc(NULL); ///< List of cells
             for (int i = 0; i < numFiles; i++) {
-                pmReadout *readout = readouts->data[i]; // Readout of interest
+                pmReadout *readout = readouts->data[i]; ///< Readout of interest
                 psListAdd(inCells, PS_LIST_TAIL, readout->parent);
             }
@@ -247,5 +259,5 @@
             {
                 pmCell *countsCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.COUNT");
-                pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
+                pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
                 psImage *counts = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_COUNT);
                 countsRO->image = psImageCopy(countsRO->image, counts, PS_TYPE_F32);
@@ -263,5 +275,5 @@
 
                 pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
-                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
+                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
                 psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
                 sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
@@ -297,5 +309,5 @@
                 }
 
-                psArray *fringes = psArrayAlloc(1); // Array of fringes
+                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
                 fringes->data[0] = fringe;
 
@@ -336,7 +348,7 @@
 
     // Get list of FPAs for concepts averaging
-    psList *inFPAs = psListAlloc(NULL); // List of FPAs
+    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
     for (int i = 0; i < numFiles; i++) {
-        pmFPAfile *input = inputs->data[i]; // Input file
+        pmFPAfile *input = inputs->data[i]; ///< Input file
         psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
     }
Index: /trunk/ppMerge/src/ppMergeLoop_Threaded.c
===================================================================
--- /trunk/ppMerge/src/ppMergeLoop_Threaded.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeLoop_Threaded.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeLoop_Threaded.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -19,13 +31,13 @@
     assert(config);
 
-    psMetadata *arguments = config->arguments; // Arguments
-    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
-    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); // Number of input files
-    bool mdok;                          // Status of MD lookup
+    psMetadata *arguments = config->arguments; ///< Arguments
+    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
+    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); ///< Number of input files
+    bool mdok;                          ///< Status of MD lookup
     bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
-
-    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
-    psArray *masks = NULL, *weights = NULL; // Input masks and weights
+    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
+
+    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
+    psArray *masks = NULL, *weights = NULL; ///< Input masks and weights
     if (haveMasks) {
         masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
@@ -38,18 +50,18 @@
     if (!mdok) nThreads = 0;
 
-    // General combination parameters
-    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); // Number of rejection iterations
-    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); // Rejection level
-    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); // Reject fraction of low pixels
-    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); // Reject fraction of hi pixels
-    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
-    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
-    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
-
-    // Fringe parameters
-    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); // Number of fringe points
-    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); // Size of fringe regions
-    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
-    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
+    /** General combination parameters */
+    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); ///< Number of rejection iterations
+    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); ///< Rejection level
+    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); ///< Reject fraction of low pixels
+    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); ///< Reject fraction of hi pixels
+    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); ///< Minimum number of values to keep
+    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); ///< Combination statistic
+    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); ///< Use weights?
+
+    /** Fringe parameters */
+    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); ///< Number of fringe points
+    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); ///< Size of fringe regions
+    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); ///< Smoothing regions in x
+    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); ///< Smoothing regions in y
 
     // set the mask and mark bit values based on the named masks
@@ -61,5 +73,5 @@
     }
 
-    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); // Combination parameters
+    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); ///< Combination parameters
     combination->maskVal = maskVal;
     combination->blank = pmConfigMaskGet("BLANK", config);
@@ -71,5 +83,5 @@
     combination->weights = useWeights;
 
-    psMetadata *stats = NULL;           // Statistics for output
+    psMetadata *stats = NULL;           ///< Statistics for output
     if (psMetadataLookup(config->arguments, "STATS.NAME")) {
         stats = psMetadataAlloc();
@@ -80,6 +92,6 @@
 
     // Retrieve data placed on analysis
-    psVector *scales = NULL, *zeros = NULL; // Scale and zeroes for combination
-    psArray *shutters = NULL;           // Shutter correction data
+    psVector *scales = NULL, *zeros = NULL; ///< Scale and zeroes for combination
+    psArray *shutters = NULL;           ///< Shutter correction data
     switch (type) {
       case PPMERGE_TYPE_FRINGE:
@@ -113,6 +125,6 @@
 
     // Dark parameters
-    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); // Dark info
-    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); // Dark normalisation
+    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); ///< Dark info
+    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); ///< Dark normalisation
 
 
@@ -121,19 +133,19 @@
         goto ERROR;
     }
-    psString outName = ppMergeOutputFile(config); // Name of output file
-    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
+    psString outName = ppMergeOutputFile(config); ///< Name of output file
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
     psFree(outName);
     assert(output && output->fpa);
-    pmFPA *outFPA = output->fpa;        // Output FPA
-    int cellNum = 0;                    // Index of cell
+    pmFPA *outFPA = output->fpa;        ///< Output FPA
+    int cellNum = 0;                    ///< Index of cell
     if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
         goto ERROR;
     }
-    pmChip *outChip;                    // Chip of interest
+    pmChip *outChip;                    ///< Chip of interest
     while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
         if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
             goto ERROR;
         }
-        pmCell *outCell;                // Cell of interest
+        pmCell *outCell;                ///< Cell of interest
         while ((outCell = pmFPAviewNextCell(view, outFPA, 1))) {
             if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
@@ -141,5 +153,5 @@
             }
 
-            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); // HDU for cell
+            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); ///< HDU for cell
             if (!hdu || hdu->blankPHU) {
                 // No data here
@@ -147,5 +159,5 @@
             }
 
-            float shutterRef = NAN;     // Reference shutter correction
+            float shutterRef = NAN;     ///< Reference shutter correction
             pmReadout *pattern = NULL;
             if (type == PPMERGE_TYPE_SHUTTER) {
@@ -169,8 +181,8 @@
             // Generate readouts for each input file in each file group
             for (int i = 0; i < fileGroups->n; i++) {
-                psArray *readouts = psArrayAlloc(numFiles); // Input readouts
+                psArray *readouts = psArrayAlloc(numFiles); ///< Input readouts
                 for (int j = 0; j < numFiles; j++) {
                     pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", j);
-                    pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
+                    pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
                     readouts->data[j] = pmReadoutAlloc(inCell);
                 }
@@ -234,5 +246,5 @@
                   case PPMERGE_TYPE_FLAT:
                   case PPMERGE_TYPE_FRINGE: {
-                      psThreadJob *job = psThreadJobAlloc("PPMERGE_READOUT_COMBINE"); // Job to start
+                      psThreadJob *job = psThreadJobAlloc("PPMERGE_READOUT_COMBINE"); ///< Job to start
 
                       // Construct the arguments for this job
@@ -250,5 +262,5 @@
                   }
                   case PPMERGE_TYPE_DARK: {
-                      psThreadJob *job = psThreadJobAlloc ("PPMERGE_DARK_COMBINE"); // Job to start
+                      psThreadJob *job = psThreadJobAlloc ("PPMERGE_DARK_COMBINE"); ///< Job to start
 
                       // construct the arguments for this job
@@ -311,5 +323,5 @@
             for (int i = 0; i < numFiles; i++) {
                 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i);
-                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
+                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
                 psListAdd(inCells, PS_LIST_TAIL, inCell);
             }
@@ -325,5 +337,5 @@
             {
                 pmCell *countsCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.COUNT");
-                pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
+                pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
                 psImage *counts = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_COUNT);
                 countsRO->image = psImageCopy(countsRO->image, counts, PS_TYPE_F32);
@@ -341,5 +353,5 @@
 
                 pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
-                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
+                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
                 psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
                 sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
@@ -375,5 +387,5 @@
                 }
 
-                psArray *fringes = psArrayAlloc(1); // Array of fringes
+                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
                 fringes->data[0] = fringe;
 
@@ -414,7 +426,7 @@
 
     // Get list of FPAs for concepts averaging
-    psList *inFPAs = psListAlloc(NULL); // List of FPAs
+    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
     for (int i = 0; i < numFiles; i++) {
-        pmFPAfile *input = inputs->data[i]; // Input file
+        pmFPAfile *input = inputs->data[i]; ///< Input file
         psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
     }
Index: /trunk/ppMerge/src/ppMergeMask.c
===================================================================
--- /trunk/ppMerge/src/ppMergeMask.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeMask.c	(revision 21244)
@@ -1,9 +1,21 @@
+/** @file ppMergeMask.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
-static bool mergeMask(pmConfig *config, // Configuration
-                      const pmFPAview *view, // View to chip
-                      bool writeOut,     // Write output?
-                      psRandom *rng,    // Random number generator
-                      psMetadata *stats // Statistics output
+static bool mergeMask(pmConfig *config, ///< Configuration
+                      const pmFPAview *view, ///< View to chip
+                      bool writeOut,     ///< Write output?
+                      psRandom *rng,    ///< Random number generator
+                      psMetadata *stats ///< Statistics output
     )
 {
@@ -12,17 +24,17 @@
     assert(view->chip != -1 && view->cell == -1 && view->readout == -1);
 
-    bool mdok;                          // Status of MD lookup
-    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of input files
-    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); // Statistic for mean
-    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); // Statistic for stdev
-    int sample = psMetadataLookupS32(NULL, config->arguments, "SAMPLE"); // Size of sample for statistics
-    bool chipStats = psMetadataLookupBool(&mdok, config->arguments, "MASK.CHIPSTATS"); // Statistics on chip?
-    float maskSuspect = psMetadataLookupF32(NULL, config->arguments, "MASK.SUSPECT"); // Threshold for suspect pixels
-    float maskBad = psMetadataLookupF32(NULL, config->arguments, "MASK.BAD"); // Threshold for bad pixels
-    pmMaskIdentifyMode maskMode = psMetadataLookupS32(NULL, config->arguments, "MASK.MODE"); // Mode for identifying bad pixels
-    int maskGrow = psMetadataLookupS32(NULL, config->arguments, "MASK.GROW"); // Radius to grow mask
-
-    bool smoothSuspect = psMetadataLookupBool(&mdok, config->arguments, "MASK.SMOOTH.SUSPECT"); // Radius to grow mask
-    float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); // Radius to grow mask
+    bool mdok;                          ///< Status of MD lookup
+    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of input files
+    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); ///< Statistic for mean
+    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); ///< Statistic for stdev
+    int sample = psMetadataLookupS32(NULL, config->arguments, "SAMPLE"); ///< Size of sample for statistics
+    bool chipStats = psMetadataLookupBool(&mdok, config->arguments, "MASK.CHIPSTATS"); ///< Statistics on chip?
+    float maskSuspect = psMetadataLookupF32(NULL, config->arguments, "MASK.SUSPECT"); ///< Threshold for suspect pixels
+    float maskBad = psMetadataLookupF32(NULL, config->arguments, "MASK.BAD"); ///< Threshold for bad pixels
+    pmMaskIdentifyMode maskMode = psMetadataLookupS32(NULL, config->arguments, "MASK.MODE"); ///< Mode for identifying bad pixels
+    int maskGrow = psMetadataLookupS32(NULL, config->arguments, "MASK.GROW"); ///< Radius to grow mask
+
+    bool smoothSuspect = psMetadataLookupBool(&mdok, config->arguments, "MASK.SMOOTH.SUSPECT"); ///< Radius to grow mask
+    float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); ///< Radius to grow mask
 
     psImageMaskType markVal;
@@ -40,8 +52,8 @@
     }
     
-    psStats *statistics = psStatsAlloc(meanStat | stdevStat); // Statistics for background
-
-    psString outName = ppMergeOutputFile(config); // Name of output file
-    pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); // Output chip
+    psStats *statistics = psStatsAlloc(meanStat | stdevStat); ///< Statistics for background
+
+    psString outName = ppMergeOutputFile(config); ///< Name of output file
+    pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); ///< Output chip
     psFree(outName);
     
@@ -58,24 +70,24 @@
 
     // For each input file, get the statistics, which can be calculated at the chip or cell levels
-    psVector *values = psVectorAlloc(sample, PS_TYPE_F32); // Pixel values for statistics
-    pmFPAview *inView = pmFPAviewAlloc(0); // View for input
+    psVector *values = psVectorAlloc(sample, PS_TYPE_F32); ///< Pixel values for statistics
+    pmFPAview *inView = pmFPAviewAlloc(0); ///< View for input
     for (int i = 0; i < numFiles; i++) {
         pmFPAfileActivate(config->files, false, NULL);
-        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Input files
-        pmFPAfile *input = files->data[0]; // Input file
+        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); ///< Input files
+        pmFPAfile *input = files->data[0]; ///< Input file
         psFree(files);
-        pmFPA *inFPA = input->fpa;  // Input FPA
+        pmFPA *inFPA = input->fpa;  ///< Input FPA
         *inView = *view;
 
-        int valueIndex = 0;             // Index for vector of pixel values
-
-        pmCell *inCell;                 // Input cell
+        int valueIndex = 0;             ///< Index for vector of pixel values
+
+        pmCell *inCell;                 ///< Input cell
         while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
 
 	    // the output FPA structure carries the information about which cells to process
-            pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
+            pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); ///< Output cell
 	    if (!outCell->process) continue;
 
-            pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
+            pmHDU *hdu = pmHDUFromCell(inCell); ///< HDU for cell
             if (!hdu || hdu->blankPHU) {
                 // No data here
@@ -106,5 +118,5 @@
             pmReadout *readout;
             if (inCell->readouts && inCell->readouts->n == 1) {
-                readout = psMemIncrRefCounter(inCell->readouts->data[0]); // Input readout
+                readout = psMemIncrRefCounter(inCell->readouts->data[0]); ///< Input readout
             } else {
                 readout = pmReadoutAlloc(inCell);
@@ -118,5 +130,5 @@
             }
 
-            pmReadout *outRO = NULL;    // Output readout
+            pmReadout *outRO = NULL;    ///< Output readout
             if (outCell->readouts && outCell->readouts->n == 1) {
                 outRO = psMemIncrRefCounter(outCell->readouts->data[0]);
@@ -124,10 +136,10 @@
                 outRO = pmReadoutAlloc(outCell);
             }
-            psImage *outMask = outRO->mask;    // Output mask image (for iterative generation of mask)
-
-            psImage *image = readout->image, *mask = readout->mask; // Image and mask
-            int numCols = readout->image->numCols, numRows = readout->image->numRows; // Image size
-            int numPix = numCols * numRows; // Number of pixels
-            int num = PS_MIN(numPix, sample / numCells); // Number of values to add
+            psImage *outMask = outRO->mask;    ///< Output mask image (for iterative generation of mask)
+
+            psImage *image = readout->image, *mask = readout->mask; ///< Image and mask
+            int numCols = readout->image->numCols, numRows = readout->image->numRows; ///< Image size
+            int numPix = numCols * numRows; ///< Number of pixels
+            int num = PS_MIN(numPix, sample / numCells); ///< Number of values to add
             if (!chipStats) {
                 valueIndex = 0;
@@ -187,11 +199,11 @@
 
 		// the output FPA structure carries the information about which cells to process
-		pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
+		pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); ///< Output cell
 		if (!outCell->process) continue;
 
-                pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
+                pmHDU *hdu = pmHDUFromCell(inCell); ///< HDU for cell
                 if (!hdu || hdu->blankPHU) continue;
 
-                pmReadout *readout = inCell->readouts->data[0]; // Readout of interest
+                pmReadout *readout = inCell->readouts->data[0]; ///< Readout of interest
 
                 inView->readout = 0;
@@ -225,7 +237,7 @@
         ppMergeFileActivate(config, PPMERGE_FILES_OUTPUT, true);
     }
-    pmFPA *outFPA = outChip->parent;    // Output FPA
-    pmCell *outCell;                    // Output cell
-    pmFPAview *outView = pmFPAviewAlloc(0); // View into output FPA
+    pmFPA *outFPA = outChip->parent;    ///< Output FPA
+    pmCell *outCell;                    ///< Output cell
+    pmFPAview *outView = pmFPAviewAlloc(0); ///< View into output FPA
     *outView = *view;
     while ((outCell = pmFPAviewNextCell(outView, outFPA, 1))) {
@@ -234,5 +246,5 @@
 	if (!outCell->process) continue;
 
-        pmHDU *hdu = pmHDUFromCell(outCell); // HDU for cell
+        pmHDU *hdu = pmHDUFromCell(outCell); ///< HDU for cell
         if (!hdu || hdu->blankPHU) continue;
 
@@ -240,11 +252,11 @@
 
         assert(outCell->readouts && outCell->readouts->n == 1);
-        pmReadout *outRO = outCell->readouts->data[0]; // Output readout
+        pmReadout *outRO = outCell->readouts->data[0]; ///< Output readout
 
 	if (smoothSuspect) {
 	    // XXX test output of suspect pixel image
-	    psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
+	    psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); ///< Suspect img
 	    assert (suspects);
-	    psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
+	    psImageSmooth (suspects, smoothScale, 3); ///< extend smoothing region to 3-sigma
 	}
 
@@ -259,5 +271,5 @@
             // The counts image is fairly useless, but it preserves the model
             pmCell *countsCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.COUNT");
-            pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
+            pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
             countsRO->image = psImageAlloc(outRO->mask->numCols, outRO->mask->numRows, PS_TYPE_F32);
             psImageInit(countsRO->image, numFiles);
@@ -266,5 +278,5 @@
 
             pmCell *sigmaCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.SIGMA");
-            pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with suspect image
+            pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with suspect image
             psImage *suspect = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT);
             sigmaRO->image = psImageCopy(sigmaRO->image, suspect, PS_TYPE_F32);
@@ -275,5 +287,5 @@
 
         if (maskGrow > 0) {
-            psImage *grown = psImageGrowMask(NULL, outRO->mask, maskValOut, maskGrow, maskValOut); // Grown mask
+            psImage *grown = psImageGrowMask(NULL, outRO->mask, maskValOut, maskGrow, maskValOut); ///< Grown mask
             psFree(outRO->mask);
             outRO->mask = grown;
@@ -289,8 +301,8 @@
 
             // Average concepts
-            psList *cells = psListAlloc(NULL); // List of cells, for concept averaging
+            psList *cells = psListAlloc(NULL); ///< List of cells, for concept averaging
             for (int i = 0; i < numFiles; i++) {
-                pmFPAfile *inFile = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
-                pmCell *inCell = pmFPAviewThisCell(outView, inFile->fpa); // Input cell
+                pmFPAfile *inFile = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
+                pmCell *inCell = pmFPAviewThisCell(outView, inFile->fpa); ///< Input cell
                 psListAdd(cells, PS_LIST_TAIL, inCell);
             }
@@ -340,16 +352,16 @@
     assert(config);
 
-    bool mdok;                          // Status of MD lookup
-    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
-    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Do we have weights?
-    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Number of rejection iterations
+    bool mdok;                          ///< Status of MD lookup
+    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of inputs
+    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); ///< Do we have masks?
+    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
+    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); ///< Number of rejection iterations
 
     PS_ASSERT_INT_POSITIVE(iter, false);
 
-    pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
-    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator
-
-    psMetadata *stats = NULL;           // Statistics for output
+    pmFPAview *view = pmFPAviewAlloc(0); ///< View to component of interest
+    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); ///< Random number generator
+
+    psMetadata *stats = NULL;           ///< Statistics for output
     if (psMetadataLookup(config->arguments, "STATS.NAME")) {
         stats = psMetadataAlloc();
@@ -357,5 +369,5 @@
     }
 
-    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
+    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
     psFree(inputs);
     if (haveMasks) {
@@ -380,14 +392,14 @@
     // for the input masks.
 
-    psString outName = ppMergeOutputFile(config); // Name of output file
-    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
+    psString outName = ppMergeOutputFile(config); ///< Name of output file
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
     psFree(outName);
     assert(output && output->fpa);
-    pmFPA *outFPA = output->fpa;        // Output FPA
+    pmFPA *outFPA = output->fpa;        ///< Output FPA
 
     if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
         goto PPMERGE_MASK_ERROR;
     }
-    pmChip *outChip;                    // Chip of interest
+    pmChip *outChip;                    ///< Chip of interest
     while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
 
@@ -408,5 +420,5 @@
 	    psList *inChips = psListAlloc(NULL);
 	    for (int i=0; i < numFiles; i++) {
-		pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
+		pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
 		pmChip *chip = pmFPAviewThisChip(view, file->fpa);
 		psListAdd(inChips, PS_LIST_TAIL, chip);
@@ -427,7 +439,7 @@
     }
 
-    psList *fpaList = psListAlloc(NULL);// List of FPAs for concept averaging
+    psList *fpaList = psListAlloc(NULL);///< List of FPAs for concept averaging
     for (int i = 0; i < numFiles; i++) {
-        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
+        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
         psListAdd(fpaList, PS_LIST_TAIL, file->fpa);
     }
Index: /trunk/ppMerge/src/ppMergeReadChunk.c
===================================================================
--- /trunk/ppMerge/src/ppMergeReadChunk.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeReadChunk.c	(revision 21244)
@@ -1,5 +1,17 @@
+/** @file ppMergeReadChunk.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 # include "ppMerge.h"
 
-#define THREAD_WAIT 10000               // Microseconds to wait if thread is not available
+#define THREAD_WAIT 10000               ///< Microseconds to wait if thread is not available
 
 ppMergeFileGroup *ppMergeReadChunk(bool *status, psArray *fileGroups, pmConfig *config, int numChunk)
@@ -8,7 +20,7 @@
 
     bool mdok;
-    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
-    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");// Do we have weights?
-    int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of rows to read per chunk
+    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); ///< Do we have masks?
+    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");///< Do we have weights?
+    int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); ///< Number of rows to read per chunk
 
     // select an available fileGroup
@@ -36,5 +48,5 @@
             psTrace("ppStack", 2, "Reading data for chunk %d into fileGroup %d....n", numChunk, j);
             for (int i = 0; i < readouts->n; i++) {
-                pmReadout *inRO = readouts->data[i]; // Input readout
+                pmReadout *inRO = readouts->data[i]; ///< Input readout
 
                 // override the recorded last scan
Index: /trunk/ppMerge/src/ppMergeScaleZero.c
===================================================================
--- /trunk/ppMerge/src/ppMergeScaleZero.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeScaleZero.c	(revision 21244)
@@ -1,20 +1,34 @@
+/** @file ppMergeScaleZero.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "ppMerge.h"
 
-// Get the scale and zero for each chip of each input
+/**
+ * Get the scale and zero for each chip of each input
+ */
 bool ppMergeScaleZero(pmConfig *config)
 {
     assert(config);
 
-    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
-    int numInputs = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
-    int numCells = psMetadataLookupS32(NULL, config->arguments, "INPUTS.CELLS"); // Number of cells
-    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); // Statistic for mean
-    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); // Statistic for stdev
-    int shutterSize = psMetadataLookupS32(NULL, config->arguments, "SHUTTER.SIZE"); // Size of shutter region
-
-    psVector *gains = NULL;             // Gains for each cell
-    psArray *shutters = NULL;           // Shutter data for each cell
-    psStats *stats = NULL;              // Statistics for background
-    psImage *background = NULL;         // Background measurements per cell per file
+    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
+    int numInputs = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of inputs
+    int numCells = psMetadataLookupS32(NULL, config->arguments, "INPUTS.CELLS"); ///< Number of cells
+    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); ///< Statistic for mean
+    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); ///< Statistic for stdev
+    int shutterSize = psMetadataLookupS32(NULL, config->arguments, "SHUTTER.SIZE"); ///< Size of shutter region
+
+    psVector *gains = NULL;             ///< Gains for each cell
+    psArray *shutters = NULL;           ///< Shutter data for each cell
+    psStats *stats = NULL;              ///< Statistics for background
+    psImage *background = NULL;         ///< Background measurements per cell per file
 
     switch (type) {
@@ -37,18 +51,18 @@
         break;
     }
-    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator
-    pmFPAview *view = NULL;             // View into FPA
+    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); ///< Random number generator
+    pmFPAview *view = NULL;             ///< View into FPA
 
     for (int i = 0; i < numInputs; i++) {
         pmFPAfileActivate(config->files, false, NULL);
-        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Activated files
-        pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or weight)
-        pmFPA *fpa = input->fpa;        // FPA of interest
-        view = pmFPAviewAlloc(0);       // View to component of interest
-        int cellNum = 0;                // Index for cell
+        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); ///< Activated files
+        pmFPAfile *input = files->data[0]; ///< Representative file; should be the image (not mask or weight)
+        pmFPA *fpa = input->fpa;        ///< FPA of interest
+        view = pmFPAviewAlloc(0);       ///< View to component of interest
+        int cellNum = 0;                ///< Index for cell
         if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
             goto ERROR;
         }
-        pmChip *chip;                   // Chip of interest
+        pmChip *chip;                   ///< Chip of interest
         while ((chip = pmFPAviewNextChip(view, fpa, 1))) {
             if (!chip->file_exists) {
@@ -59,5 +73,5 @@
             }
 
-            pmCell *cell;               // Cell of interest
+            pmCell *cell;               ///< Cell of interest
             while ((cell = pmFPAviewNextCell(view, fpa, 1))) {
                 if (!cell->file_exists) {
@@ -78,7 +92,8 @@
                     goto ERROR;
                 }
-                pmReadout *readout = cell->readouts->data[0]; // Readout of interest
-
-                psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
+                pmReadout *readout = cell->readouts->data[0]; ///< Readout of interest
+
+                psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); ///< Value to mask
+                psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); 
 
                 switch (type) {
@@ -86,5 +101,5 @@
                   case PPMERGE_TYPE_FRINGE: {
                       // Extract the gain
-                      float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // Cell gain
+                      float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); ///< Cell gain
                       if (!isfinite(gain)) {
                         // psError(PS_ERR_BAD_PARAMETER_VALUE, false,
@@ -110,5 +125,5 @@
                   }
                   case PPMERGE_TYPE_SHUTTER: {
-                      pmShutterCorrectionData *shutter = shutters->data[cellNum]; // Shutter correction data
+                      pmShutterCorrectionData *shutter = shutters->data[cellNum]; ///< Shutter correction data
                       if (!shutter) {
                           shutter = pmShutterCorrectionDataAlloc(readout->image->numCols,
@@ -174,5 +189,5 @@
               }
           }
-          psVector *fluxes = NULL;        // Solution to fluxes
+          psVector *fluxes = NULL;        ///< Solution to fluxes
           if (!pmFlatNormalize(&fluxes, &gains, background)) {
               psError(PS_ERR_UNKNOWN, false, "Normalisation failed to converge --- continuing anyway.");
Index: /trunk/ppMerge/src/ppMergeScaleZero.h
===================================================================
--- /trunk/ppMerge/src/ppMergeScaleZero.h	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeScaleZero.h	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeScaleZero.h
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifndef PP_MERGE_SCALE_ZERO_H
 #define PP_MERGE_SCALE_ZERO_H
@@ -8,11 +20,13 @@
 #include "ppMergeOptions.h"
 
-// Get the scale and zero for each chip of each input
-bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell
-                      psImage **zeros, // The zeroes for each integration/cell
-                      psArray **shutter,// The shutter correction data for each cell
-                      ppMergeData *data,// The data
-                      const ppMergeOptions *options, // The options
-                      const pmConfig *config // The configuration
+/**
+ * Get the scale and zero for each chip of each input
+ */
+bool ppMergeScaleZero(psImage **scales, ///< The scales for each integration/cell
+                      psImage **zeros, ///< The zeroes for each integration/cell
+                      psArray **shutter,///< The shutter correction data for each cell
+                      ppMergeData *data,///< The data
+                      const ppMergeOptions *options, ///< The options
+                      const pmConfig *config ///< The configuration
     );
 
Index: /trunk/ppMerge/src/ppMergeSetThreads.c
===================================================================
--- /trunk/ppMerge/src/ppMergeSetThreads.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeSetThreads.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeSetThreads.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 # include "ppMerge.h"
 
Index: /trunk/ppMerge/src/ppMergeThreadLauncher.c
===================================================================
--- /trunk/ppMerge/src/ppMergeThreadLauncher.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeThreadLauncher.c	(revision 21244)
@@ -1,6 +1,20 @@
+/** @file ppMergeThreadLauncher.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 # include "ppMerge.h"
 
-// each thread runs this function, starting a new job when it finished with an old one
-// it is called with a (void *) pointer to its own thread pointer
+/**
+ * each thread runs this function, starting a new job when it finished with an old one
+ * it is called with a (void *) pointer to its own thread pointer
+ */
 void *ppMergeThreadLauncher (void *data) {
 
Index: /trunk/ppMerge/src/ppMergeVersion.c
===================================================================
--- /trunk/ppMerge/src/ppMergeVersion.c	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeVersion.c	(revision 21244)
@@ -1,2 +1,14 @@
+/** @file ppMergeVersion.c
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -10,9 +22,9 @@
 #include "ppMergeVersion.h"
 
-static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
+static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name
 
 psString ppMergeVersion(void)
 {
-    psString version = NULL;            // Version, to return
+    psString version = NULL;            ///< Version, to return
     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
     return version;
@@ -21,6 +33,6 @@
 psString ppMergeVersionLong(void)
 {
-    psString version = ppMergeVersion(); // Version, to return
-    psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
+    psString version = ppMergeVersion(); ///< Version, to return
+    psString tag = psStringStripCVS(cvsTag, "Name"); ///< CVS tag
     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
     psFree(tag);
@@ -33,13 +45,13 @@
     PS_ASSERT_METADATA_NON_NULL(metadata,);
 
-    psString pslib = psLibVersionLong();// psLib version
-    psString psmodules = psModulesVersionLong(); // psModules version
-    psString ppStats = ppStatsVersionLong(); // ppStats version
-    psString ppMerge = ppMergeVersionLong(); // ppMerge version
+    psString pslib = psLibVersionLong();///< psLib version
+    psString psmodules = psModulesVersionLong(); ///< psModules version
+    psString ppStats = ppStatsVersionLong(); ///< ppStats version
+    psString ppMerge = ppMergeVersionLong(); ///< ppMerge version
 
-    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
-    psString timeString = psTimeToISO(time); // The time in an ISO string
+    psTime *time = psTimeGetNow(PS_TIME_TAI); ///< The time now
+    psString timeString = psTimeToISO(time); ///< The time in an ISO string
     psFree(time);
-    psString head = NULL;               // Head string
+    psString head = NULL;               ///< Head string
     psStringAppend(&head, "ppMerge processing at %s. Component information:", timeString);
     psFree(timeString);
Index: /trunk/ppMerge/src/ppMergeVersion.h
===================================================================
--- /trunk/ppMerge/src/ppMergeVersion.h	(revision 21243)
+++ /trunk/ppMerge/src/ppMergeVersion.h	(revision 21244)
@@ -1,12 +1,30 @@
+/** @file ppMergeVersion.h
+ *
+ *  @brief
+ *
+ *  @ingroup ppMerge
+ *
+ *  @author IfA
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-01 21:43:05 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #ifndef PP_MERGE_VERSION_H
 #define PP_MERGE_VERSION_H
 
-/// Return short version information
+/**
+ * Return short version information
+ */
 psString ppMergeVersion(void);
 
-/// Return long version information
+/**
+ * Return long version information
+ */
 psString ppMergeVersionLong(void);
 
-/// Update the metadata with version information for all dependencies
+/**
+ * Update the metadata with version information for all dependencies
+ */
 void ppMergeVersionMetadata(psMetadata *metadata ///< Metadata to update with version information
     );
