Index: trunk/pswarp/src/pswarpLoop.c
===================================================================
--- trunk/pswarp/src/pswarpLoop.c	(revision 21256)
+++ trunk/pswarp/src/pswarpLoop.c	(revision 21323)
@@ -1,17 +1,30 @@
+/** @file pswarpLoop.c
+ *
+ *  @brief
+ *
+ *  @ingroup pswarp
+ *
+ *  @author IfA
+ *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-05 20:44:04 $
+ *  Copyright 2009 Institute for Astronomy, University of Hawaii
+ */
+
 #include "pswarp.h"
 #include <ppStats.h>
 
-#define WCS_NONLIN_TOL 0.001            // Non-linear tolerance for header WCS
-#define PSPHOT_FIND_PSF 1               // Use psphot's findPSF function?
-#define TESTING 0                       // Testing output?
-
-// Lists of file rules used at different stages
-#include "pswarpFileNames.h"
-
-// XXX these are generic functions which should be moved to psModules
-// Activate a list of files
-static void fileActivation(pmConfig *config, // Configuration
-                           char **files, // Files to turn on/off
-                           bool state   // Activation state
+#define WCS_NONLIN_TOL 0.001            ///< Non-linear tolerance for header WCS
+#define PSPHOT_FIND_PSF 1               ///< Use psphot's findPSF function?
+#define TESTING 0                       ///< Testing output?
+
+#include "pswarpFileNames.h" ///< Lists of file rules used at different stages
+
+/**
+ * XXX these are generic functions which should be moved to psModules
+ * Activate a list of files
+ */
+static void fileActivation(pmConfig *config, ///< Configuration
+                           char **files, ///< Files to turn on/off
+                           bool state   ///< Activation state
     )
 {
@@ -22,10 +35,12 @@
 }
 
-// Run down the FPA hierarchy, checking files
-static bool ioChecksBefore(pmConfig *config // Configuration
+/**
+ * Run down the FPA hierarchy, checking files
+ */
+static bool ioChecksBefore(pmConfig *config ///< Configuration
                            )
 {
-    pmFPAview *view = pmFPAviewAlloc(0); // View for checking
-    bool status = true;                 // Status of checks
+    pmFPAview *view = pmFPAviewAlloc(0); ///< View for checking
+    bool status = true;                 ///< Status of checks
     status &= pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     view->chip = 0;
@@ -37,11 +52,13 @@
 }
 
-// Run up the FPA hierarchy, checking files
-static bool ioChecksAfter(pmConfig *config // Configuration
+/**
+ * Run up the FPA hierarchy, checking files
+ */
+static bool ioChecksAfter(pmConfig *config ///< Configuration
                           )
 {
-    pmFPAview *view = pmFPAviewAlloc(0); // View for checking
+    pmFPAview *view = pmFPAviewAlloc(0); ///< View for checking
     view->chip = view->cell = 0;
-    bool status = true;                 // Status of checks
+    bool status = true;                 ///< Status of checks
     status &= pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     view->cell = -1;
@@ -54,5 +71,7 @@
 
 
-// Loop over the inputs, warp them to the output skycell and then write out the output.
+/**
+ * Loop over the inputs, warp them to the output skycell and then write out the output.
+ */
 bool pswarpLoop(pmConfig *config)
 {
@@ -100,8 +119,8 @@
     psFree (view);
 
-    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 (mdok && statsName && strlen(statsName) > 0) {
         psString resolved = pmConfigConvertFilename(statsName, config, true, true);
@@ -245,7 +264,7 @@
     }
 
-    pmCell *outCell = output->parent;   // Output cell
-    pmChip *outChip = outCell->parent;  // Output chip
-    pmFPA *outFPA = outChip->parent;    // Output FP
+    pmCell *outCell = output->parent;   ///< Output cell
+    pmChip *outChip = outCell->parent;  ///< Output chip
+    pmFPA *outFPA = outChip->parent;    ///< Output FP
 
     if (!pswarpPixelFraction(output, stats, config)) {
@@ -265,5 +284,5 @@
         varFactor /= goodPix;
 
-        psMetadataItem *vfItem = psMetadataLookup(outCell->concepts, "CELL.VARFACTOR"); // Item to update
+        psMetadataItem *vfItem = psMetadataLookup(outCell->concepts, "CELL.VARFACTOR"); ///< Item to update
         psAssert(vfItem && vfItem->type == PS_TYPE_F32, "Concept should be as specified.");
         if (!isfinite(vfItem->data.F32)) {
@@ -283,6 +302,6 @@
     psFree(cells);
 
-    psRegion *trimsec = psMetadataLookupPtr(NULL, outCell->concepts, "CELL.TRIMSEC"); // Trim section
-    trimsec->x0 = trimsec->x1 = trimsec->y0 = trimsec->y1 = 0; // All pixels
+    psRegion *trimsec = psMetadataLookupPtr(NULL, outCell->concepts, "CELL.TRIMSEC"); ///< Trim section
+    trimsec->x0 = trimsec->x1 = trimsec->y0 = trimsec->y1 = 0; ///< All pixels
 
     if (!psMetadataCopy(outFPA->concepts, input->fpa->concepts)) {
@@ -293,13 +312,13 @@
     }
 
-    pmHDU *hdu = outFPA->hdu;           // HDU for the output warped image
+    pmHDU *hdu = outFPA->hdu;           ///< HDU for the output warped image
 
     // Copy header from target
     {
-        pmFPAview *skyView = pmFPAviewAlloc(0); // View into skycell
+        pmFPAview *skyView = pmFPAviewAlloc(0); ///< View into skycell
         skyView->chip = skyView->cell = 0;
         pmCell *cell = pmFPAfileThisCell(config->files, skyView, "PSWARP.SKYCELL"); // Skycell cell
         psFree(skyView);
-        pmHDU *skyHDU = pmHDUFromCell(cell); // HDU
+        pmHDU *skyHDU = pmHDUFromCell(cell); ///< HDU
         if (!skyHDU) {
             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find skycell HDU.");
@@ -333,5 +352,5 @@
         pmFPACopy(photFile->fpa, outFPA);
 
-        pmFPAview *view = pmFPAviewAlloc(0); // View into skycell
+        pmFPAview *view = pmFPAviewAlloc(0); ///< View into skycell
         view->chip = view->cell = view->readout = 0;
 
@@ -340,5 +359,5 @@
         // We can adjust the weight directly since this is a deep copy
         pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa);
-        float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); // Variance factor
+        float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); ///< Variance factor
         psBinaryOp(photRO->weight, photRO->weight, "*", psScalarAlloc(vf, PS_TYPE_F32));
 
@@ -359,6 +378,6 @@
 #if (TESTING)
         {
-            #define PSF_SIZE 20         // Half-size of PSF
-            #define PSF_FLUX 10000      // Central flux for PSF
+            #define PSF_SIZE 20         ///< Half-size of PSF
+            #define PSF_FLUX 10000      ///< Central flux for PSF
             pmChip *photChip = pmFPAviewThisChip(view, photFile->fpa);
             pmPSF *psf = psMetadataLookupPtr(NULL, photChip->analysis, "PSPHOT.PSF");
@@ -390,8 +409,8 @@
     const char *chipName = psMetadataLookupStr(NULL, output->parent->parent->concepts, "CHIP.NAME");
     const char *cellName = psMetadataLookupStr(NULL, output->parent->concepts, "CELL.NAME");
-    psString headerName = NULL; // Header name for MD5
+    psString headerName = NULL; ///< Header name for MD5
     psStringAppend(&headerName, "MD5_%s_%s_%d", chipName, cellName, view->readout);
-    psVector *md5 = psImageMD5(output->image); // md5 hash
-    psString md5string = psMD5toString(md5); // String
+    psVector *md5 = psImageMD5(output->image); ///< md5 hash
+    psString md5string = psMD5toString(md5); ///< String
     psFree(md5);
     psMetadataAddStr(hdu->header, PS_LIST_TAIL, headerName, PS_META_REPLACE,
