Index: trunk/psModules/src/camera/pmFPARead.h
===================================================================
--- trunk/psModules/src/camera/pmFPARead.h	(revision 13768)
+++ trunk/psModules/src/camera/pmFPARead.h	(revision 16365)
@@ -4,6 +4,6 @@
  * @author Paul Price, IfA
  *
- * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-06-12 22:22:33 $
+ * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2008-02-08 03:16:12 $
  * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
  */
@@ -15,5 +15,28 @@
 /// @{
 
-/// Read a readout incrementally
+/// Check to see if there is more to read when reading a readout incrementally
+bool pmReadoutMore(pmReadout *readout,  ///< Readout of interest
+                   psFits *fits,        ///< FITS file from which to read
+                   int z,               ///< Readout number/plane; zero-offset indexing
+                   int numScans         ///< Number of scans (rows/cols) to read
+    );
+
+/// Read a chunk of a readout.
+///
+/// Allows reading the readout incrementally
+bool pmReadoutReadChunk(pmReadout *readout,  ///< Readout of interest
+                        psFits *fits,        ///< FITS file from which to read
+                        int z,               ///< Readout number/plane; zero-offset indexing
+                        int numScans         ///< Number of scans (rows/cols) to read
+    );
+
+/// Read the entire readout
+bool pmReadoutRead(pmReadout *readout,  ///< Readout of interest
+                   psFits *fits,        ///< FITS file from which to read
+                   int z               ///< Readout number/plane; zero-offset indexing
+    );
+
+/// Read a readout incrementally --- this is maintained temporarily only for backwards compatibility; it has
+/// been replaced by pmReadoutRead, pmReadoutReadChunk and pmReadoutMore.
 ///
 /// Multiple calls to this function moves through a readout within a cell incrementally.  It is required to
@@ -25,10 +48,15 @@
 /// Use pmReadoutWriteNext to write the data that's read by this function.  This function is intended for
 /// reading in many readouts into memory at once (e.g., for stacking) where the input is not written out.
-bool pmReadoutReadNext(bool *status,	// non-error exit condition?
-		       pmReadout *readout, // Readout into which to read
+bool pmReadoutReadNext(bool *status,    // non-error exit condition?
+                       pmReadout *readout, // Readout into which to read
                        psFits *fits,    // FITS file from which to read
                        int z,           // Readout number/plane; zero-offset indexing
                        int numRows      // The number of rows to read
                       );
+
+/// Return the number of readouts within a cell
+///
+/// This function is type-independent (doesn't matter if you are interested in the image/mask/weight).
+int pmCellNumReadouts(pmCell *cell, psFits *fits);
 
 /// Read an entire cell
@@ -57,10 +85,34 @@
               );
 
+// Mask functions follow
+
+/// Check to see if there is more to read when reading a readout incrementally into the mask
+bool pmReadoutMoreMask(pmReadout *readout, ///< Readout of interest
+                       psFits *fits,    ///< FITS file from which to read
+                       int z,           ///< Readout number/plane; zero-offset indexing
+                       int numScans     ///< Number of scans (rows/cols) to read
+    );
+
+/// Read a chunk of a readout into the mask
+///
+/// Allows reading the readout incrementally
+bool pmReadoutReadChunkMask(pmReadout *readout, ///< Readout of interest
+                            psFits *fits, ///< FITS file from which to read
+                            int z,      ///< Readout number/plane; zero-offset indexing
+                            int numScans ///< Number of scans (rows/cols) to read
+    );
+
+/// Read the entire readout into the mask
+bool pmReadoutReadMask(pmReadout *readout, ///< Readout of interest
+                       psFits *fits,    ///< FITS file from which to read
+                       int z            ///< Readout number/plane; zero-offset indexing
+    );
+
 /// Read an entire cell into the mask
 ///
 /// Same as pmCellRead, but reads into the mask element of 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,       // Cell to read into
+                    psFits *fits,       // FITS file from which to read
+                    psDB *db            // Database handle, for "concepts" ingest
                    );
 
@@ -68,7 +120,7 @@
 ///
 /// Same as pmChipRead, but reads into the mask element of the readouts.
-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,       // Chip to read into
+                    psFits *fits,       // FITS file from which to read
+                    psDB *db            // Database handle, for "concepts" ingest
                    );
 
@@ -76,8 +128,32 @@
 ///
 /// Same as pmFPARead, but reads into the mask element of the readouts.
-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,          // FPA to read into
+                   psFits *fits,        // FITS file from which to read
+                   psDB *db             // Database handle, for "concepts" ingest
                   );
+
+// Weight functions follow
+
+/// Check to see if there is more to read when reading a readout incrementally into the weight
+bool pmReadoutMoreWeight(pmReadout *readout, ///< Readout of interest
+                         psFits *fits,  ///< FITS file from which to read
+                         int z,         ///< Readout number/plane; zero-offset indexing
+                         int numScans   ///< Number of scans (rows/cols) to read
+    );
+
+/// Read a chunk of a readout into the weight
+///
+/// Allows reading the readout incrementally
+bool pmReadoutReadChunkWeight(pmReadout *readout, ///< Readout of interest
+                            psFits *fits, ///< FITS file from which to read
+                            int z,      ///< Readout number/plane; zero-offset indexing
+                            int numScans ///< Number of scans (rows/cols) to read
+    );
+
+/// Read the entire readout into the weight
+bool pmReadoutReadWeight(pmReadout *readout, ///< Readout of interest
+                         psFits *fits,  ///< FITS file from which to read
+                         int z          ///< Readout number/plane; zero-offset indexing
+    );
 
 /// Read an entire cell into the weight
@@ -109,6 +185,6 @@
 /// Same as pmCellRead, but reads only the headers of the readouts.
 bool pmCellReadHeaderSet(pmCell *cell,           // Cell to read into
-			 psFits *fits,           // FITS file from which to read
-			 psDB *db                // Database handle, for "concepts" ingest
+                         psFits *fits,           // FITS file from which to read
+                         psDB *db                // Database handle, for "concepts" ingest
     );
 
@@ -125,6 +201,6 @@
 /// Same as pmFPARead, but reads only the headers of the readouts.
 bool pmFPAReadHeaderSet(pmFPA *fpa,              // FPA to read into
-			psFits *fits,            // FITS file from which to read
-			psDB *db                 // Database handle, for "concepts" ingest
+                        psFits *fits,            // FITS file from which to read
+                        psDB *db                 // Database handle, for "concepts" ingest
     );
 
