Index: trunk/psModules/src/camera/pmFPARead.c
===================================================================
--- trunk/psModules/src/camera/pmFPARead.c	(revision 9584)
+++ trunk/psModules/src/camera/pmFPARead.c	(revision 9599)
@@ -16,7 +16,4 @@
 
 #include "pmFPARead.h"
-
-#define MAX(x,y) ((x) > (y) ? (x) : (y))
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -45,8 +42,8 @@
         return false;
     }
-    psRegion region = psRegionSet(MAX(trimsec->x0 - readout->col0, 0), // x0
-                                  MIN(trimsec->x1 - readout->col0, image->numCols), // x1
-                                  MAX(trimsec->y0 - readout->row0, 0), // y0
-                                  MIN(trimsec->y1 - readout->row0, image->numRows) // y1
+    psRegion region = psRegionSet(PS_MAX(trimsec->x0 - readout->col0, 0), // x0
+                                  PS_MIN(trimsec->x1 - readout->col0, image->numCols), // x1
+                                  PS_MAX(trimsec->y0 - readout->row0, 0), // y0
+                                  PS_MIN(trimsec->y1 - readout->row0, image->numRows) // y1
                                  );
     if (readout->image) {
@@ -71,8 +68,8 @@
             return false;
         }
-        psRegion region = psRegionSet(MAX(biassec->x0 - readout->col0, 0), // x0
-                                      MIN(biassec->x1 - readout->col0, image->numCols), // x1
-                                      MAX(biassec->y0 - readout->row0, 0), // y0
-                                      MIN(biassec->y1 - readout->row0, image->numRows) // y1
+        psRegion region = psRegionSet(PS_MAX(biassec->x0 - readout->col0, 0), // x0
+                                      PS_MIN(biassec->x1 - readout->col0, image->numCols), // x1
+                                      PS_MAX(biassec->y0 - readout->row0, 0), // y0
+                                      PS_MIN(biassec->y1 - readout->row0, image->numRows) // y1
                                      );
         psImage *overscan = psMemIncrRefCounter(psImageSubset(image, region));
@@ -162,14 +159,5 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// Read the next readout; return true if we read pixels in.
-//
-// Note that this doesn't put pixels in the HDU.  It is therefore NOT COMPATIBLE with pmCellWrite,
-// pmChipWrite, and pmFPAWrite (or any function that uses or creates an HDU for that matter).
-// Use pmReadoutWriteNext to write the data that's read by this function.
-bool pmReadoutReadNext(pmReadout *readout, // Readout into which to read
-                       psFits *fits,    // FITS file from which to read
-                       int z,           // Readout number/plane; zero-offset indexing
-                       int numScans     // The number of scans to read
-                      )
+bool pmReadoutReadNext(pmReadout *readout, psFits *fits, int z, int numScans)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -284,8 +272,6 @@
     // Blow away existing data.
     // Do this before returning, so that we're not returning data from a previous read
-    #if 1
     psFree(readout->image);
     readout->image = NULL;
-    #endif
 
     while (readout->bias->n > 0) {
@@ -321,9 +307,5 @@
 
 
-// Read in the cell, and allocate the readouts
-bool pmCellRead(pmCell *cell,           // Cell to read into
-                psFits *fits,           // FITS file from which to read
-                psDB *db                // Database handle, for "concepts" ingest
-               )
+bool pmCellRead(pmCell *cell, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -383,9 +365,5 @@
 }
 
-// Read in the component cells
-bool pmChipRead(pmChip *chip,           // Chip to read into
-                psFits *fits,           // FITS file from which to read
-                psDB *db                // Database handle, for "concepts" ingest
-               )
+bool pmChipRead(pmChip *chip, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
@@ -410,9 +388,5 @@
 }
 
-// Read in the component chips
-bool pmFPARead(pmFPA *fpa,              // FPA to read into
-               psFits *fits,            // FITS file from which to read
-               psDB *db                 // Database handle, for "concepts" ingest
-              )
+bool pmFPARead(pmFPA *fpa, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
@@ -442,9 +416,5 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// Read the mask into the cell, and allocate the readouts
-bool pmCellReadMask(pmCell *cell,           // Cell to read into
-                    psFits *fits,           // FITS file from which to read
-                    psDB *db                // Database handle, for "concepts" ingest
-                   )
+bool pmCellReadMask(pmCell *cell, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -497,9 +467,5 @@
 }
 
-// Read the mask into the component cells
-bool pmChipReadMask(pmChip *chip,           // Chip to read into
-                    psFits *fits,           // FITS file from which to read
-                    psDB *db                // Database handle, for "concepts" ingest
-                   )
+bool pmChipReadMask(pmChip *chip, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
@@ -524,9 +490,5 @@
 }
 
-// Read the mask into the component chips
-bool pmFPAReadMask(pmFPA *fpa,              // FPA to read into
-                   psFits *fits,            // FITS file from which to read
-                   psDB *db                 // Database handle, for "concepts" ingest
-                  )
+bool pmFPAReadMask(pmFPA *fpa, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
@@ -555,9 +517,5 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// Read the weight map into the cell, and allocate the readouts
-bool pmCellReadWeight(pmCell *cell,           // Cell to read into
-                      psFits *fits,           // FITS file from which to read
-                      psDB *db                // Database handle, for "concepts" ingest
-                     )
+bool pmCellReadWeight(pmCell *cell, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -610,9 +568,5 @@
 }
 
-// Read the weight map into the component cells
-bool pmChipReadWeight(pmChip *chip,           // Chip to read into
-                      psFits *fits,           // FITS file from which to read
-                      psDB *db                // Database handle, for "concepts" ingest
-                     )
+bool pmChipReadWeight(pmChip *chip, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
@@ -637,9 +591,5 @@
 }
 
-// Read the weight map into the component chips
-bool pmFPAReadWeight(pmFPA *fpa,              // FPA to read into
-                     psFits *fits,            // FITS file from which to read
-                     psDB *db                 // Database handle, for "concepts" ingest
-                    )
+bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, psDB *db)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
