Index: /trunk/psModules/src/camera/Makefile.am
===================================================================
--- /trunk/psModules/src/camera/Makefile.am	(revision 9583)
+++ /trunk/psModules/src/camera/Makefile.am	(revision 9584)
@@ -21,5 +21,7 @@
 	pmFPAfileDefine.c \
 	pmFPAfileIO.c \
-	pmFPAfileFitsIO.c
+	pmFPAfileFitsIO.c \
+	pmFPAFlags.c \
+	pmFPALevel.c
 
 pkginclude_HEADERS = \
@@ -41,5 +43,7 @@
 	pmFPAfileDefine.h \
 	pmFPAfileIO.h \
-	pmFPAfileFitsIO.h
+	pmFPAfileFitsIO.h \
+	pmFPAFlags.h \
+	pmFPALevel.h
 
 CLEANFILES = *~
Index: /trunk/psModules/src/camera/pmFPA.c
===================================================================
--- /trunk/psModules/src/camera/pmFPA.c	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPA.c	(revision 9584)
@@ -12,6 +12,6 @@
 * XXX: Should we implement non-linear cell->chip transforms?
 *
-*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-09-15 09:49:01 $
+*  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-17 00:33:56 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -101,5 +101,4 @@
     psFree(chip->analysis);
     psFree(chip->hdu);
-    psFree(chip->mosaic);
 
     # if FPA_ASTROM
@@ -322,5 +321,5 @@
     tmpChip->toFPA = NULL;
     tmpChip->fromFPA = NULL;
-    # endif
+    #endif
 
     tmpChip->analysis = psMetadataAlloc();
@@ -331,5 +330,4 @@
     }
     tmpChip->hdu = NULL;
-    tmpChip->mosaic = NULL;
     tmpChip->process = true;            // Work on all chips, by default
     tmpChip->file_exists = false;       // Not yet identified
@@ -355,5 +353,5 @@
     tmpFPA->toTangentPlane = NULL;
     tmpFPA->projection = NULL;
-    # endif
+    #endif
 
     tmpFPA->analysis = NULL;
@@ -369,5 +367,7 @@
 }
 
-static bool cellCheckParents(pmCell *cell)
+// Check a cell to ensure that all component readouts have the parent pointer set correctly
+static bool cellCheckParents(pmCell *cell // Cell to check
+                            )
 {
     PS_ASSERT_PTR_NON_NULL(cell, true);
@@ -387,5 +387,7 @@
 }
 
-static bool chipCheckParents(pmChip *chip)
+// Check a chip to ensure that all component cells have the parent pointer set correctly
+static bool chipCheckParents(pmChip *chip // Chip to check
+                            )
 {
     PS_ASSERT_PTR_NON_NULL(chip, true);
@@ -393,5 +395,5 @@
     bool flag = true;
     for (long i = 0; i < chip->cells->n ; i++) {
-        pmCell *tmpCell = (pmCell *) chip->cells->data[i];
+        pmCell *tmpCell = (pmCell*)chip->cells->data[i];
         if (!tmpCell) {
             continue;
@@ -413,5 +415,5 @@
     bool flag = true;
     for (long i = 0; i < fpa->chips->n ; i++) {
-        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
+        pmChip *tmpChip = (pmChip*)fpa->chips->data[i];
         if (!tmpChip) {
             continue;
@@ -426,327 +428,2 @@
     return flag;
 }
-
-/** functions to turn on/off the file_exists flag **/
-bool pmFPASetFileStatus(pmFPA *fpa, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(fpa, false);
-
-    for (int i = 0; i < fpa->chips->n; i++) {
-        pmChip *chip = fpa->chips->data[i];
-        pmChipSetFileStatus (chip, status);
-    }
-    return true;
-}
-
-bool pmChipSetFileStatus(pmChip *chip, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(chip, false);
-
-    chip->file_exists = status;
-    for (int i = 0; i < chip->cells->n; i++) {
-        pmCell *cell = chip->cells->data[i];
-        pmCellSetFileStatus (cell, status);
-    }
-    return true;
-}
-
-bool pmCellSetFileStatus(pmCell *cell, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(cell, false);
-
-    cell->file_exists = status;
-    for (int i = 0; i < cell->readouts->n; i++) {
-        pmReadout *readout = cell->readouts->data[i];
-        readout->file_exists = status;
-    }
-    return true;
-}
-
-bool pmFPACheckFileStatus(const pmFPA *fpa)
-{
-    PS_ASSERT_PTR_NON_NULL(fpa, false);
-
-    for (int i = 0; i < fpa->chips->n; i++) {
-        pmChip *chip = fpa->chips->data[i];
-        if (!pmChipCheckFileStatus(chip)) {
-            return false;
-        }
-    }
-    return true;
-}
-
-bool pmChipCheckFileStatus(const pmChip *chip)
-{
-    PS_ASSERT_PTR_NON_NULL(chip, false);
-    if (!chip->file_exists) {
-        return false;
-    }
-
-    for (int i = 0; i < chip->cells->n; i++) {
-        pmCell *cell = chip->cells->data[i];
-        if (!pmCellCheckFileStatus(cell)) {
-            return false;
-        }
-    }
-    return true;
-}
-
-bool pmCellCheckFileStatus(const pmCell *cell)
-{
-    PS_ASSERT_PTR_NON_NULL(cell, false);
-    if (!cell->file_exists) {
-        return false;
-    }
-
-    for (int i = 0; i < cell->readouts->n; i++) {
-        pmReadout *readout = cell->readouts->data[i];
-        if (!readout->file_exists) {
-            return false;
-        }
-    }
-    return true;
-}
-
-/** functions to turn on/off the data_exists flag **/
-bool pmFPASetDataStatus(pmFPA *fpa, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(fpa, false);
-
-    for (int i = 0; i < fpa->chips->n; i++) {
-        pmChip *chip = fpa->chips->data[i];
-        pmChipSetDataStatus (chip, status);
-    }
-    return true;
-}
-
-bool pmChipSetDataStatus(pmChip *chip, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(chip, false);
-
-    chip->data_exists = status;
-    for (int i = 0; i < chip->cells->n; i++) {
-        pmCell *cell = chip->cells->data[i];
-        pmCellSetDataStatus (cell, status);
-    }
-    return true;
-}
-
-bool pmCellSetDataStatus (pmCell *cell, bool status)
-{
-    PS_ASSERT_PTR_NON_NULL(cell, false);
-
-    cell->data_exists = status;
-    for (int i = 0; i < cell->readouts->n; i++) {
-        pmReadout *readout = cell->readouts->data[i];
-        readout->data_exists = status;
-    }
-    return true;
-}
-
-/*****************************************************************************
- *****************************************************************************/
-
-// Set cells within a chip to be processed or not
-static bool setCellsProcess(const pmChip *chip, // Chip of interest
-                            bool process  // Process this chip?
-                           )
-{
-    PS_ASSERT_PTR_NON_NULL(chip, false);
-
-    psArray *cells = chip->cells;       // Component cells
-    if (! cells) {
-        return false;
-    }
-    for (int i = 0; i < cells->n; i++) {
-        pmCell *tmpCell = cells->data[i]; // Cell of interest
-        if (tmpCell) {
-            tmpCell->process = process;
-        }
-    }
-
-    return true;
-}
-
-/*****************************************************************************
-XXX EAM : I've added the 'exclusive' option.  if true all other chips are de-selected
-XXX EAM : a negative value is valid and, in combinations with exclusive, de-selects all chips
- *****************************************************************************/
-bool pmFPASelectChip(pmFPA *fpa, int chipNum, bool exclusive)
-{
-    PS_ASSERT_PTR_NON_NULL(fpa, false);
-
-    psArray *chips = fpa->chips;        // Component chips
-    if ((chips == NULL) || (chipNum >= chips->n)) {
-        return(false);
-    }
-
-    for (int i = 0 ; i < chips->n ; i++) {
-        pmChip *tmpChip = (pmChip *) chips->data[i];
-        if (tmpChip == NULL) {
-            continue;
-        }
-        if (i == chipNum) {
-            tmpChip->process = true;
-            setCellsProcess(tmpChip, true);
-        } else {
-            if (exclusive) {
-                tmpChip->process = false;
-                setCellsProcess(tmpChip, false);
-            }
-        }
-
-    }
-
-    return true;
-}
-
-/*****************************************************************************
-XXX EAM : I've added the 'exclusive' option.  if true all other chips are de-selected
-XXX EAM : a negative value is valid and, in combinations with exclusive, de-selects all cells
-XXX this function should probably be re-defined to merge with 'setCellsProcess'
- *****************************************************************************/
-bool pmChipSelectCell(pmChip *chip, int cellNum, bool exclusive)
-{
-    PS_ASSERT_PTR_NON_NULL(chip, false);
-
-    psArray *cells = chip->cells;       // Component cells
-    if (!cells || cellNum > cells->n) {
-        return false;
-    }
-
-    for (int i = 0; i < cells->n; i++) {
-        pmCell *cell = cells->data[i];
-        if (!cell) {
-            continue;
-        }
-        if (i == cellNum) {
-            cell->process = true;
-        } else {
-            if (exclusive) {
-                cell->process = false;
-            }
-        }
-    }
-    return true;
-}
-
-/*****************************************************************************
-XXX: The SDRS is ambiguous on a few things:
-    Whether or not the other chips should be set process=true. [PAP: No]
-    Should we return the number of chip process=true before or after they're set, [PAP: After]
- *****************************************************************************/
-/**
- *
- * pmFPAExcludeChip shall set process to false only for the specified chip
- * number (chipNum). In the event that the specified chip number does not exist
- * within the fpa, the function shall generate a warning, and perform no action.
- * The function shall return the number of chips within the fpa that have process
- * set to true.
- *
- */
-int pmFPAExcludeChip(
-    pmFPA *fpa,
-    int chipNum)
-{
-    PS_ASSERT_PTR_NON_NULL(fpa, -1);
-
-    psArray *chips = fpa->chips;        // Component chips
-    if (chips == NULL) {
-        psLogMsg(__func__, PS_LOG_WARN, "WARNING: fpa->chips == NULL\n");
-        return(0);
-    }
-    if ((chipNum >= chips->n) || (NULL == (pmChip *) chips->data[chipNum])) {
-        psLogMsg(__func__, PS_LOG_WARN, "WARNING: the specified chip (%d) does not exist.\n", chipNum);
-        return(0);
-    }
-
-    int numChips = 0;                   // Number of chips to be processed
-    for (int i = 0 ; i < chips->n ; i++) {
-        pmChip *tmpChip = (pmChip *) chips->data[i]; // Chip of interest
-        if (tmpChip != NULL) {
-            if (i == chipNum) {
-                tmpChip->process = false;
-                setCellsProcess(tmpChip, false); // Wipe out the cell as well
-            } else if (tmpChip->process) {
-                numChips++;
-            }
-        }
-    }
-
-    return(numChips);
-}
-
-int pmChipExcludeCell(pmChip *chip,
-                      int cellNum
-                     )
-{
-    PS_ASSERT_PTR_NON_NULL(chip, -1);
-
-    psArray *cells = chip->cells;       // The component cells
-    if (!cells || cellNum > cells->n) {
-        return 0;
-    }
-
-    int numCells = 0;                   // Number of cells to be processed
-    for (int i = 0; i < cells->n; i++) {
-        pmCell *cell = cells->data[i];
-        if (!cell) {
-            continue;
-        }
-        if (i == cellNum) {
-            cell->process = false;
-        } else {
-            numCells++;
-        }
-    }
-
-    return numCells;
-}
-
-static char *NameNONE = "NONE";
-static char *NameFPA = "FPA";
-static char *NameCHIP = "CHIP";
-static char *NameCELL = "CELL";
-static char *NameREADOUT = "READOUT";
-
-char *pmFPALevelToName(pmFPALevel level)
-{
-
-    switch (level) {
-    case PM_FPA_LEVEL_NONE:
-        return NameNONE;
-    case PM_FPA_LEVEL_FPA:
-        return NameFPA;
-    case PM_FPA_LEVEL_CHIP:
-        return NameCHIP;
-    case PM_FPA_LEVEL_CELL:
-        return NameCELL;
-    case PM_FPA_LEVEL_READOUT:
-        return NameREADOUT;
-    default:
-        psAbort(PS_FILE_LINE, "You can't get here; level = %d", level);
-    }
-    return NULL;
-}
-
-pmFPALevel pmFPALevelFromName(const char *name)
-{
-    pmFPALevel val;
-
-    if (name == NULL) {
-        val = PM_FPA_LEVEL_NONE;
-    } else if (!strcasecmp(name, "FPA"))     {
-        val = PM_FPA_LEVEL_FPA;
-    } else if (!strcasecmp(name, "CHIP"))    {
-        val = PM_FPA_LEVEL_CHIP;
-    } else if (!strcasecmp(name, "CELL"))    {
-        val = PM_FPA_LEVEL_CELL;
-    } else if (!strcasecmp(name, "READOUT")) {
-        val = PM_FPA_LEVEL_READOUT;
-    } else {
-        val = PM_FPA_LEVEL_NONE;
-    }
-
-    return val;
-}
-
Index: /trunk/psModules/src/camera/pmFPA.h
===================================================================
--- /trunk/psModules/src/camera/pmFPA.h	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPA.h	(revision 9584)
@@ -1,101 +1,93 @@
-/** @file  pmFPA.h
-*
-*  @brief This file defines the basic types the focal plane hierarchy.
-*
-*  @ingroup AstroImage
-*
-*  @author GLG, MHPCC
-*
-*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-08-02 02:17:11 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
+/// @file pmFPA.h
+///
+/// @brief Defines the focal plane hierarchy, along with functions for interacting with it
+///
+/// @ingroup Camera
+///
+/// @author George Gusciora, MHPCC
+/// @author Paul Price, IfA
+/// @author Eugene Magnier, IfA
+///
+/// @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-10-17 00:33:56 $
+///
+/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
+///
 
 #ifndef PM_FPA_H
 #define PM_FPA_H
+
 #if HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include "pslib.h"
+#include <pslib.h>
 #include "pmHDU.h"
 
-# define FPA_ASTROM 1
+#define FPA_ASTROM 1                    ///< Include astrometry information in the structures?
 
-/// @addtogroup AstroImage
-/// @{
-
-/** Focal plane data structure
- *
- *  A focal plane consists of one or more chips (according to the number of
- *  pieces of contiguous silicon). It contains metadata containers for the
- *  concepts and analysis, a link to the parent, and pointers to the FITS header,
- *  if that corresponds to this level (the FPA may be the PHU, but will not ever
- *  contain pixels). For astrometry, it contains a transformation from the focal
- *  plane to the tangent plane and the fixed pattern residuals. It is expected
- *  that the transformation will consist of two 4D polynomials (i.e. a function
- *  of two coordinates in position, the magnitude of the object, and the color of
- *  the object) in order to correct for optical distortions and the effects of
- *  the atmosphere; hence we think that it is prudent to include a reverse
- *  transformation which will be derived from numerically inverting the forward
- *  transformation.
- *
- */
+/// Focal plane array (the entirety of the camera)
+///
+/// The FPA is the top-level camera structure, and consists of one or more chips.  It also contains the
+/// concepts metadata appropriate to this level, a summary of analysis tasks that have been performed, the
+/// camera configuration information, any HDU that corresponds to this level for the file of interest, and
+/// astrometric transformations.  The astrometric transformations encode how to transform from the tangent
+/// plane to the sky, and back.
 typedef struct
 {
-    # if FPA_ASTROM
+    #if FPA_ASTROM
     // Astrometric transformations
-    psPlaneDistort* fromTangentPlane;   ///< Transformation from tangent plane to focal plane
-psPlaneDistort* toTangentPlane;     ///< Transformation from focal plane to tangent plane
-psProjection *projection;           ///< Projection from tangent plane to sky
-# endif
-// Information
-psMetadata *concepts;               ///< Cache for PS concepts
-unsigned int conceptsRead;          ///< Which concepts have been read
-psMetadata *analysis;               ///< FPA-level analysis metadata
-const psMetadata *camera;           ///< Camera configuration
-psArray *chips;                     ///< The chips
-pmHDU *hdu;                         ///< FITS data
+    psPlaneDistort *fromTangentPlane;   ///< Transformation from tangent plane to focal plane, or NULL
+    psPlaneDistort *toTangentPlane;     ///< Transformation from focal plane to tangent plane, or NULL
+    psProjection *projection;           ///< Projection from tangent plane to sky, or NULL
+    #endif
+    // Information
+    psMetadata *concepts;               ///< FPA-level concepts
+    unsigned int conceptsRead;          ///< Which concepts have been read; see pmConceptsSource
+    psMetadata *analysis;               ///< FPA-level analysis metadata
+    const psMetadata *camera;           ///< Camera configuration
+    psArray *chips;                     ///< The component chips
+    pmHDU *hdu;                         ///< FITS header data unit of interest, or NULL
 }
 pmFPA;
 
-/** Chip data structure
- *
- *  A chip consists of one or more cells (according to the number of amplifiers
- *  on the device). The chip contains metadata containers for the concepts and
- *  analysis, a link to the parent, and pointers to the pointers to the various
- *  FITS data, if that corresponds to this level. For astrometry, in addition to
- *  the rough positioning information, it contains a coordinate transform from
- *  the chip to the focal plane. It is expected that this transform will consist
- *  of two second-order 2D polynomials; hence we think that it is prudent to
- *  include a reverse transformation which will be derived from numerically
- *  inverting the forward transformation. A boolean indicates whether the chip is
- *  of interest, allowing it to be excluded from analysis.
- *
- */
+/// A chip (contiguous detector element)
+///
+/// The chip is the mid-level camera structure, being part of an FPA, and consisting of one or more cells
+/// (e.g., a CCD).  It also contains the concepts metadata appropriate to this level, a summary of analysis
+/// tasks that have been performed, status flags, any HDU that corresponds to this level for the file of
+/// interest, and astrometric transformations.  The astrometric transformations are of two types: rough
+/// (indicating an offset from the origin of the FPA) and precise (transformations between the chip and FPA
+/// coordinates).
 typedef struct
 {
-# if FPA_ASTROM
+    #if FPA_ASTROM
     // Offset specifying position on focal plane
     int col0;                           ///< Offset from the left of FPA.
-int row0;                           ///< Offset from the bottom of FPA.
-// Astrometric transformations
-psPlaneTransform* toFPA;            ///< Transformation from chip to FPA coordinates
-psPlaneTransform* fromFPA;          ///< Transformation from FPA to chip coordinates
-# endif
-// Information
-psMetadata *concepts;               ///< Cache for PS concepts
-unsigned int conceptsRead;          ///< Which concepts have been read
-psMetadata *analysis;               ///< Chip-level analysis metadata
-psArray *cells;                     ///< The cells (referred to by name)
-pmFPA *parent;                      ///< Parent FPA
-bool process;                       ///< Do we bother about reading and working with this chip?
-bool file_exists;                   ///< Does the file for this chip exist (read case only)?
-bool data_exists;                   ///< Does the data for this chip exist (read case only)?
-pmHDU *hdu;                         ///< FITS data
-struct pmCell *mosaic;              ///< A mosaic cell
+    int row0;                           ///< Offset from the bottom of FPA.
+    // Astrometric transformations
+    psPlaneTransform *toFPA;            ///< Transformation from chip to FPA coordinates, or NULL
+    psPlaneTransform *fromFPA;          ///< Transformation from FPA to chip coordinates, or NULL
+    #endif
+    // Information
+    psMetadata *concepts;               ///< Chip-level concepts
+    unsigned int conceptsRead;          ///< Which concepts have been read; see pmConceptsSource
+    psMetadata *analysis;               ///< Chip-level analysis metadata
+    psArray *cells;                     ///< The component cells
+    pmFPA *parent;                      ///< Parent FPA
+    bool process;                       ///< Do we bother about reading and working with this chip?
+    bool file_exists;                   ///< Does the file for this chip exist (read case only)?
+    bool data_exists;                   ///< Does the data for this chip exist (read case only)?
+    pmHDU *hdu;                         ///< FITS header data unit of interest,
 }
 pmChip;
+
+/// A cell (smallest logical unit)
+///
+/// A cell is the lowest-level camera structure, being part of a chip (e.g., an amplifier).  It may consist of
+/// one or more readouts, which are individual reads of the cell.  It also contains the concepts metadata
+/// appropriate to this level, the cell configuration information (for convenience) from the camera
+/// configuration, a summary of analysis tasks that have been performed, status flags, and any HDU that
+/// corresponds to this level for the file of interest
 
 /** Cell data structure
@@ -110,189 +102,95 @@
 typedef struct
 {
-psMetadata *concepts;               ///< Cache for PS concepts
-unsigned int conceptsRead;          ///< Which concepts have been read
-psMetadata *config;                 ///< Cell configuration info
-psMetadata *analysis;               ///< Cell-level analysis metadata
-psArray *readouts;                  ///< The readouts (referred to by number)
-pmChip *parent;                     ///< Parent chip
-bool process;                       ///< Do we bother about reading and working with this cell?
-bool file_exists;                   ///< Does the file for this cell exist (read case only)?
-bool data_exists;                   ///< Does the data for this cell exist (read case only)?
-pmHDU *hdu;                         ///< FITS data
+    psMetadata *concepts;               ///< Cell-level concepts
+    unsigned int conceptsRead;          ///< Which concepts have been read; see pmConceptsSource
+    psMetadata *config;                 ///< Cell configuration information (from CELLS in the camera config)
+    psMetadata *analysis;               ///< Cell-level analysis metadata
+    psArray *readouts;                  ///< The component readouts
+    pmChip *parent;                     ///< Parent chip
+    bool process;                       ///< Do we bother about reading and working with this cell?
+    bool file_exists;                   ///< Does the file for this cell exist (read case only)?
+    bool data_exists;                   ///< Does the data for this cell exist (read case only)?
+    pmHDU *hdu;                         ///< FITS header data unit of interest
 }
 pmCell;
 
-/** Readout data structure.
- *
- *  A readout is the result of a single read of a cell (or a portion thereof).
- *  It contains the offset from the lower-left corner of the chip, in the case
- *  that the CCD was windowed, as well as the binning factors and parity (if the
- *  binning value is negative, then the parity is reversed). It also contains the
- *  pixel data, metadata containers for the concepts and analysis, and a link to
- *  the parent.
- *
- */
+/// A readout (individual read of a cell)
+///
+/// A readout corresponds to an individual read of a cell (e.g., a single image as part of a video sequence,
+/// or one of multiple coadds).  It contains the actual pixels used in analysis (along with mask and weight
+/// maps).  When reading from a FITS file, the images are subimages (from CELL.TRIMSEC) of the pixels read
+/// from the appropriate HDU (at the FPA, chip or cell level).  The readout also contains a list of bias
+/// sections (prescans or overscans, or otherwise), a summary of analysis tasks that have been performed,
+/// status flags, and the offsets used for reading a FITS file incrementally.
 typedef struct
 {
-int col0;                           ///< Column offset; non-zero if reading in columns bit by bit
-int row0;                           ///< Row offset; non-zero if reading in rows bit by bit
-psImage *image;                     ///< Imaging area of readout
-psImage *mask;                      ///< Mask of input image
-psImage *weight;                    ///< Weight of input image
-psList *bias;                       ///< Overscan images
-psMetadata *analysis;               ///< Readout-level analysis metadata
-pmCell *parent;                     ///< Parent cell
-bool process;                       ///< Do we bother about reading and working with this readout?
-bool file_exists;                   ///< Does the file for this readout exist (read case only)?
-bool data_exists;                   ///< Does the data for this readout exist (read case only)?
+    int col0;                           ///< Column offset; non-zero if reading in columns incrementally
+    int row0;                           ///< Row offset; non-zero if reading in rows incrementally
+    psImage *image;                     ///< Imaging area of readout (corresponds to CELL.TRIMSEC region)
+    psImage *mask;                      ///< Mask of input image (corresponds to CELL.TRIMSEC region)
+    psImage *weight;                    ///< Weight of input image (corresponds to CELL.TRIMSEC region)
+    psList *bias;                       ///< List of bias (prescan/overscan) images
+    psMetadata *analysis;               ///< Readout-level analysis metadata
+    pmCell *parent;                     ///< Parent cell
+    bool process;                       ///< Do we bother about reading and working with this readout?
+    bool file_exists;                   ///< Does the file for this readout exist (read case only)?
+    bool data_exists;                   ///< Does the data for this readout exist (read case only)?
 }
 pmReadout;
 
-void pmCellFreeReadouts(pmCell *cell);
-void pmChipFreeCells(pmChip *chip);
+/// Free all readouts within a cell
+void pmCellFreeReadouts(pmCell *cell    ///< Cell for which to free readouts
+                       );
 
-void pmReadoutFreeData (pmReadout *readout);
-void pmCellFreeData(pmCell *cell);
-void pmChipFreeData(pmChip *chip);
-void pmFPAFreeData(pmFPA *fpa);
+/// Free all cells within a chip
+void pmChipFreeCells(pmChip *chip       ///< Chip for which to free cells
+                    );
 
-/** Allocates a pmReadout
- *
- *  The constructor shall make an empty pmReadout. If the parent cell is not
- *  NULL, the parent link is made and the readout shall be placed in the
- *  parents array of readouts. The metadata containers shall be allocated. All
- *  other pointers in the structure shall be initialized to NULL.
- *
- *  @return pmReadout*    newly allocated pmReadout with all internal pointers set to NULL
- */
-pmReadout *pmReadoutAlloc(
-    pmCell *cell                        ///< Parent cell
-);
+/// Free all data within a readout
+void pmReadoutFreeData(pmReadout *readout ///< Readout for which to free data
+                      );
 
-/** Allocates a pmCell
- *
- *  The constructor shall make an empty pmCell. If the parent chip is not NULL,
- *  the parent link is made and the cell shall be placed in the parents array of
- *  cells. The readouts array shall be allocated with a zero size, and the
- *  metadata containers constructed. All other pointers in the structure shall be
- *  initialized to NULL.
- *
- *  @return pmCell*    newly allocated pmCell
- */
-pmCell *pmCellAlloc(
-    pmChip *chip,       ///< Parent chip
-    const char *name    ///< Name of cell
-);
+/// Free all data within a cell (all readouts as well as metadata)
+void pmCellFreeData(pmCell *cell        ///< Cell for which to free data
+                   );
 
-/** Allocates a pmChip
- *
- *  The constructor shall make an empty pmChip. If the parent fpa is not NULL,
- *  the parent link is made and the chip shall be placed in the parent's array
- *  of chips. The cells array shall be allocated with a zero size, and the
- *  metadata containers constructed. All other pointers in the structure shall be
- *  initialized to NULL.
- *
- *  @return pmChip*    newly allocated pmChip
- */
-pmChip *pmChipAlloc(
-    pmFPA *fpa,                         ///< FPA to which the chip belongs
-    const char *name                    ///< Name of chip
-);
+/// Free all data within a chip (all cells as well as metadata)
+void pmChipFreeData(pmChip *chip        ///< Chip for which to free data
+                   );
 
-/** Allocates a pmFPA
- *
- *  The constructor shall make an empty pmFPA. The chips array shall be
- *  allocated with a zero size, the camera and db pointers set to the values
- *  provided, and the concepts metadata constructed. All other pointers in the
- *  structure shall be initialized to NULL.
- *
- */
-pmFPA *pmFPAAlloc(
-    const psMetadata *camera            ///< Camera configuration
-);
+/// Free all data within an FPA (all chips as well as metadata)
+void pmFPAFreeData(pmFPA *fpa           ///< FPA for which to free data
+                  );
+
+/// Allocate a readout associated with a cell
+pmReadout *pmReadoutAlloc(pmCell *cell  ///< Parent cell, or NULL
+                         );
+
+/// Allocate a cell associated with a chip
+///
+/// The name is used to set CELL.NAME within the concepts.
+pmCell *pmCellAlloc(pmChip *chip,       ///< Parent chip, or NULL
+                    const char *name    ///< Name of cell, for CELL.NAME
+                   );
+
+/// Allocate a chip associated with an FPA
+///
+/// The name is used to set CHIP.NAME within the concepts
+pmChip *pmChipAlloc(pmFPA *fpa,         ///< Parent FPA, or NULL
+                    const char *name    ///< Name of chip, for CHIP.NAME
+                   );
+
+/// Allocate an FPA
+pmFPA *pmFPAAlloc(const psMetadata *camera ///< Camera configuration (to store in FPA)
+                 );
 
 
-/** Verify parent links.
- *
- *  This function checks the validity of the parent links in the FPA hierarchy.
- *  If a parent link is not set (or not set correctly), it is corrected, and the
- *  function shall return false. If all the parent pointers were correct, the
- *  function shall return true.
- *
- */
-bool pmFPACheckParents(
-    pmFPA *fpa
-);
-
-/* functions to turn on/off the file_exists flags */
-bool pmFPASetFileStatus (pmFPA *fpa, bool status);
-bool pmChipSetFileStatus (pmChip *chip, bool status);
-bool pmCellSetFileStatus (pmCell *cell, bool status);
-
-/* Functions to check the file_exists flags */
-bool pmFPACheckFileStatus(const pmFPA *fpa);
-bool pmChipCheckFileStatus(const pmChip *chip);
-bool pmCellCheckFileStatus(const pmCell *cell);
-
-/* functions to turn on/off the data_exists flags */
-bool pmFPASetDataStatus (pmFPA *fpa, bool status);
-bool pmChipSetDataStatus (pmChip *chip, bool status);
-bool pmCellSetDataStatus (pmCell *cell, bool status);
-
-/** Specify the level for an operation.
- */
-typedef enum {
-    PM_FPA_LEVEL_NONE,                  ///< No particular level specified
-    PM_FPA_LEVEL_FPA,                   ///< Level corresponds to an FPA
-    PM_FPA_LEVEL_CHIP,                  ///< Level corresponds to a Chip
-    PM_FPA_LEVEL_CELL,                  ///< Level corresponds to a Cell
-    PM_FPA_LEVEL_READOUT                ///< Level corresponds to a Readout
-} pmFPALevel;
+/// Check parent links within an FPA
+///
+/// Iterates through the FPA to verify that the "parent" links in the chip, cell and readout are set
+/// correctly.  If there are any incorrect links, they are fixed, and the function returns false.
+bool pmFPACheckParents(pmFPA *fpa       ///< FPA to check
+                      );
 
 
-/**
- *
- * pmFPASelectChip shall set valid to true for the specified chip number
- * (chipNum), and all other chips shall have valid set to false. In the event
- * that the specified chip number does not exist within the fpa, the function
- * shall return false.
- *
- */
-bool pmFPASelectChip(
-    pmFPA *fpa,
-    int chipNum,
-    bool exclusive
-);
-
-bool pmChipSelectCell(pmChip *chip,
-                      int cellNum,
-                      bool exclusive
-                     );
-
-/**
- *
- * pmFPAExcludeChip shall set valid to false only for the specified chip
- * number (chipNum). In the event that the specified chip number does not exist
- * within the fpa, the function shall generate a warning, and perform no action.
- * The function shall return the number of chips within the fpa that have valid
- * set to true.
- *
- */
-int pmFPAExcludeChip(
-    pmFPA *fpa,
-    int chipNum
-);
-
-int pmChipExcludeCell(pmChip *chip,
-                      int cellNum
-                     );
-
-// Set the weights and masks within a cell, based on the gain and RN
-bool pmCellSetWeights(pmCell *cell // Cell for which to set weights
-                     );
-
-
-char *pmFPALevelToName(pmFPALevel level);
-pmFPALevel pmFPALevelFromName(const char *name);
-
 #endif // #ifndef PM_FPA_H
Index: /trunk/psModules/src/camera/pmFPAConstruct.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPAConstruct.c	(revision 9584)
@@ -9,4 +9,6 @@
 
 #include "pmFPA.h"
+#include "pmFPALevel.h"
+#include "pmFPAFlags.h"
 #include "pmConcepts.h"
 #include "pmFPAConstruct.h"
Index: /trunk/psModules/src/camera/pmFPAFlags.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAFlags.c	(revision 9584)
+++ /trunk/psModules/src/camera/pmFPAFlags.c	(revision 9584)
@@ -0,0 +1,259 @@
+#include <stdio.h>
+#include <pslib.h>
+
+#include "pmFPA.h"
+#include "pmFPAFlags.h"
+
+
+/** functions to turn on/off the file_exists flag **/
+bool pmFPASetFileStatus(pmFPA *fpa, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    for (int i = 0; i < fpa->chips->n; i++) {
+        pmChip *chip = fpa->chips->data[i];
+        pmChipSetFileStatus (chip, status);
+    }
+    return true;
+}
+
+bool pmChipSetFileStatus(pmChip *chip, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+
+    chip->file_exists = status;
+    for (int i = 0; i < chip->cells->n; i++) {
+        pmCell *cell = chip->cells->data[i];
+        pmCellSetFileStatus (cell, status);
+    }
+    return true;
+}
+
+bool pmCellSetFileStatus(pmCell *cell, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(cell, false);
+
+    cell->file_exists = status;
+    for (int i = 0; i < cell->readouts->n; i++) {
+        pmReadout *readout = cell->readouts->data[i];
+        readout->file_exists = status;
+    }
+    return true;
+}
+
+bool pmFPACheckFileStatus(const pmFPA *fpa)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    for (int i = 0; i < fpa->chips->n; i++) {
+        pmChip *chip = fpa->chips->data[i];
+        if (!pmChipCheckFileStatus(chip)) {
+            return false;
+        }
+    }
+    return true;
+}
+
+bool pmChipCheckFileStatus(const pmChip *chip)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+    if (!chip->file_exists) {
+        return false;
+    }
+
+    for (int i = 0; i < chip->cells->n; i++) {
+        pmCell *cell = chip->cells->data[i];
+        if (!pmCellCheckFileStatus(cell)) {
+            return false;
+        }
+    }
+    return true;
+}
+
+bool pmCellCheckFileStatus(const pmCell *cell)
+{
+    PS_ASSERT_PTR_NON_NULL(cell, false);
+    if (!cell->file_exists) {
+        return false;
+    }
+
+    for (int i = 0; i < cell->readouts->n; i++) {
+        pmReadout *readout = cell->readouts->data[i];
+        if (!readout->file_exists) {
+            return false;
+        }
+    }
+    return true;
+}
+
+/** functions to turn on/off the data_exists flag **/
+bool pmFPASetDataStatus(pmFPA *fpa, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    for (int i = 0; i < fpa->chips->n; i++) {
+        pmChip *chip = fpa->chips->data[i];
+        pmChipSetDataStatus (chip, status);
+    }
+    return true;
+}
+
+bool pmChipSetDataStatus(pmChip *chip, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+
+    chip->data_exists = status;
+    for (int i = 0; i < chip->cells->n; i++) {
+        pmCell *cell = chip->cells->data[i];
+        pmCellSetDataStatus (cell, status);
+    }
+    return true;
+}
+
+bool pmCellSetDataStatus (pmCell *cell, bool status)
+{
+    PS_ASSERT_PTR_NON_NULL(cell, false);
+
+    cell->data_exists = status;
+    for (int i = 0; i < cell->readouts->n; i++) {
+        pmReadout *readout = cell->readouts->data[i];
+        readout->data_exists = status;
+    }
+    return true;
+}
+
+
+// Set cells within a chip to be processed or not
+static bool setCellsProcess(const pmChip *chip, // Chip of interest
+                            bool process  // Process this chip?
+                           )
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+
+    psArray *cells = chip->cells;       // Component cells
+    if (! cells) {
+        return false;
+    }
+    for (int i = 0; i < cells->n; i++) {
+        pmCell *tmpCell = cells->data[i]; // Cell of interest
+        if (tmpCell) {
+            tmpCell->process = process;
+        }
+    }
+
+    return true;
+}
+
+
+bool pmFPASelectChip(pmFPA *fpa, int chipNum, bool exclusive)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    psArray *chips = fpa->chips;        // Component chips
+    if ((chips == NULL) || (chipNum >= chips->n)) {
+        return(false);
+    }
+
+    for (int i = 0 ; i < chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) chips->data[i];
+        if (tmpChip == NULL) {
+            continue;
+        }
+        if (i == chipNum) {
+            tmpChip->process = true;
+            setCellsProcess(tmpChip, true);
+        } else {
+            if (exclusive) {
+                tmpChip->process = false;
+                setCellsProcess(tmpChip, false);
+            }
+        }
+
+    }
+
+    return true;
+}
+
+// XXX this function should probably be re-defined to merge with 'setCellsProcess'
+bool pmChipSelectCell(pmChip *chip, int cellNum, bool exclusive)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, false);
+
+    psArray *cells = chip->cells;       // Component cells
+    if (!cells || cellNum > cells->n) {
+        return false;
+    }
+
+    for (int i = 0; i < cells->n; i++) {
+        pmCell *cell = cells->data[i];
+        if (!cell) {
+            continue;
+        }
+        if (i == cellNum) {
+            cell->process = true;
+        } else {
+            if (exclusive) {
+                cell->process = false;
+            }
+        }
+    }
+    return true;
+}
+
+
+int pmFPAExcludeChip(pmFPA *fpa, int chipNum)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, -1);
+
+    psArray *chips = fpa->chips;        // Component chips
+    if (chips == NULL) {
+        psLogMsg(__func__, PS_LOG_WARN, "WARNING: fpa->chips == NULL\n");
+        return(0);
+    }
+    if ((chipNum >= chips->n) || (NULL == (pmChip *) chips->data[chipNum])) {
+        psLogMsg(__func__, PS_LOG_WARN, "WARNING: the specified chip (%d) does not exist.\n", chipNum);
+        return(0);
+    }
+
+    int numChips = 0;                   // Number of chips to be processed
+    for (int i = 0 ; i < chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) chips->data[i]; // Chip of interest
+        if (tmpChip != NULL) {
+            if (i == chipNum) {
+                tmpChip->process = false;
+                setCellsProcess(tmpChip, false); // Wipe out the cell as well
+            } else if (tmpChip->process) {
+                numChips++;
+            }
+        }
+    }
+
+    return(numChips);
+}
+
+
+int pmChipExcludeCell(pmChip *chip, int cellNum)
+{
+    PS_ASSERT_PTR_NON_NULL(chip, -1);
+
+    psArray *cells = chip->cells;       // The component cells
+    if (!cells || cellNum > cells->n) {
+        return 0;
+    }
+
+    int numCells = 0;                   // Number of cells to be processed
+    for (int i = 0; i < cells->n; i++) {
+        pmCell *cell = cells->data[i];
+        if (!cell) {
+            continue;
+        }
+        if (i == cellNum) {
+            cell->process = false;
+        } else {
+            numCells++;
+        }
+    }
+
+    return numCells;
+}
+
Index: /trunk/psModules/src/camera/pmFPAFlags.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAFlags.h	(revision 9584)
+++ /trunk/psModules/src/camera/pmFPAFlags.h	(revision 9584)
@@ -0,0 +1,106 @@
+/// @file pmFPAFlags.h
+///
+/// @brief Functions for setting and checking the status flags within the FPA hierarchy
+///
+/// @ingroup Camera
+///
+/// @author George Gusciora, MHPCC
+/// @author Paul Price, IfA
+/// @author Eugene Magnier, IfA
+///
+/// @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-10-17 00:33:56 $
+///
+/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
+///
+
+#ifndef PM_FPA_FLAGS_H
+#define PM_FPA_FLAGS_H
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "pmFPA.h"
+
+
+// Functions to turn on/off the file_exists flags
+
+/// Set the file_exists flag for an FPA and components
+bool pmFPASetFileStatus(pmFPA *fpa,     ///< FPA for which to set status
+                        bool status     ///< Status to set
+                       );
+
+/// Set the file_exists flag for a chip and components
+bool pmChipSetFileStatus(pmChip *chip,  ///< Chip for which to set status
+                         bool status    ///< Status to set
+                        );
+
+/// Set the file_exists flag for a cell and components
+bool pmCellSetFileStatus(pmCell *cell,  ///< Cell for which to set status
+                         bool status    ///< Status to set
+                        );
+
+// Functions to check the file_exists flags
+
+/// Return the file_exists status for an FPA and components
+bool pmFPACheckFileStatus(const pmFPA *fpa ///< FPA for which to check status
+                         );
+
+/// Return the file_exists status for a chip and components
+bool pmChipCheckFileStatus(const pmChip *chip ///< Chip for which to check status
+                          );
+
+/// Return the file_exists status for a chip and components
+bool pmCellCheckFileStatus(const pmCell *cell ///< Cell for which to check status
+                          );
+
+// Functions to turn on/off the data_exists flags
+
+/// Set the data_exists flag for an FPA and components
+bool pmFPASetDataStatus(pmFPA *fpa,     ///< FPA for which to set status
+                        bool status     ///< Status to set
+                       );
+
+/// Set the data_exists flag for a chip and components
+bool pmChipSetDataStatus(pmChip *chip,  ///< Chip for which to set status
+                         bool status    ///< Status to set
+                        );
+
+/// Set the data_exists flag for a cell and components
+bool pmCellSetDataStatus(pmCell *cell,  ///< Cell for which to set status
+                         bool status    ///< Status to set
+                        );
+
+// Functions to set the process flags
+
+/// Select a chip within an FPA for processing
+///
+/// If exclusive is true, the specified chip is the only chip to be processed.  A negative value for chipNum
+/// is valid and, in combinations with exclusive, de-selects all chips.
+bool pmFPASelectChip(pmFPA *fpa,        ///< FPA containing the chip of interest
+                     int chipNum,       ///< Chip number to select
+                     bool exclusive     ///< Process this chip exclusive of the others?
+                    );
+
+/// Select a chip within a chip for processing
+///
+/// If exclusive is true, the specified cell is the only chip to be processed.  A negative value for cellNum
+/// is valid and, in combinations with exclusive, de-selects all chips.
+bool pmChipSelectCell(pmChip *chip,     ///< Chip containing the cell of interest
+                      int cellNum,      ///< Cell number to select
+                      bool exclusive    ///< Process this cell exclusive of the others?
+                     );
+
+/// Exclude a chip within an FPA from processing
+int pmFPAExcludeChip(pmFPA *fpa,        ///< FPA containing the chip of interest
+                     int chipNum        ///< Chip number to exclude
+                    );
+
+/// Exclude a cell within a chip from processing
+int pmChipExcludeCell(pmChip *chip,     ///< Chip containing the chip of interest
+                      int cellNum       ///< Cell number to exclude
+                     );
+
+
+#endif
Index: /trunk/psModules/src/camera/pmFPALevel.c
===================================================================
--- /trunk/psModules/src/camera/pmFPALevel.c	(revision 9584)
+++ /trunk/psModules/src/camera/pmFPALevel.c	(revision 9584)
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <strings.h>
+#include <pslib.h>
+
+#include "pmFPALevel.h"
+
+static const char *NameNONE = "NONE";   ///< Name for PM_FPA_LEVEL_NONE
+static const char *NameFPA = "FPA";     ///< Name for PM_FPA_LEVEL_FPA
+static const char *NameCHIP = "CHIP";   ///< Name for PM_FPA_LEVEL_CHIP
+static const char *NameCELL = "CELL";   ///< Name for PM_FPA_LEVEL_CELL
+static const char *NameREADOUT = "READOUT"; ///< Name for PM_FPA_LEVEL_READOUT
+
+const char *pmFPALevelToName(pmFPALevel level)
+{
+
+    switch (level) {
+    case PM_FPA_LEVEL_NONE:
+        return NameNONE;
+    case PM_FPA_LEVEL_FPA:
+        return NameFPA;
+    case PM_FPA_LEVEL_CHIP:
+        return NameCHIP;
+    case PM_FPA_LEVEL_CELL:
+        return NameCELL;
+    case PM_FPA_LEVEL_READOUT:
+        return NameREADOUT;
+    default:
+        psAbort(PS_FILE_LINE, "You can't get here; level = %d", level);
+    }
+    return NULL;
+}
+
+pmFPALevel pmFPALevelFromName(const char *name)
+{
+    pmFPALevel val;
+
+    if (name == NULL) {
+        val = PM_FPA_LEVEL_NONE;
+    } else if (!strcasecmp(name, "FPA"))     {
+        val = PM_FPA_LEVEL_FPA;
+    } else if (!strcasecmp(name, "CHIP"))    {
+        val = PM_FPA_LEVEL_CHIP;
+    } else if (!strcasecmp(name, "CELL"))    {
+        val = PM_FPA_LEVEL_CELL;
+    } else if (!strcasecmp(name, "READOUT")) {
+        val = PM_FPA_LEVEL_READOUT;
+    } else {
+        val = PM_FPA_LEVEL_NONE;
+    }
+
+    return val;
+}
+
+
Index: /trunk/psModules/src/camera/pmFPALevel.h
===================================================================
--- /trunk/psModules/src/camera/pmFPALevel.h	(revision 9584)
+++ /trunk/psModules/src/camera/pmFPALevel.h	(revision 9584)
@@ -0,0 +1,41 @@
+/// @file pmFPALevel.h
+///
+/// @brief Defines enum and string representations for the FPA levels
+///
+/// @ingroup Camera
+///
+/// @author Eugene Magnier, MHPCC
+///
+/// @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-10-17 00:33:56 $
+///
+/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
+///
+
+#ifndef PM_FPA_LEVEL_H
+#define PM_FPA_LEVEL_H
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+/// Specify the level of the FPA hierarchy
+typedef enum {
+    PM_FPA_LEVEL_NONE,                  ///< No particular level specified
+    PM_FPA_LEVEL_FPA,                   ///< Level corresponds to an FPA
+    PM_FPA_LEVEL_CHIP,                  ///< Level corresponds to a Chip
+    PM_FPA_LEVEL_CELL,                  ///< Level corresponds to a Cell
+    PM_FPA_LEVEL_READOUT                ///< Level corresponds to a Readout
+} pmFPALevel;
+
+
+/// Return the string representation of the FPA level
+const char *pmFPALevelToName(pmFPALevel level ///< Level enum
+                            );
+
+/// Return the enum representation of the FPA level
+pmFPALevel pmFPALevelFromName(const char *name ///< Level name
+                             );
+
+#endif // #ifndef PM_FPA_LEVEL_H
Index: /trunk/psModules/src/camera/pmFPAMosaic.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAMosaic.c	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPAMosaic.c	(revision 9584)
@@ -7,4 +7,5 @@
 #include <pslib.h>
 #include "pmFPA.h"
+#include "pmFPAFlags.h"
 #include "pmHDU.h"
 #include "pmConceptsAverage.h"
Index: /trunk/psModules/src/camera/pmFPARead.c
===================================================================
--- /trunk/psModules/src/camera/pmFPARead.c	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPARead.c	(revision 9584)
@@ -9,4 +9,5 @@
 
 #include "pmFPA.h"
+#include "pmFPAFlags.h"
 #include "pmHDU.h"
 #include "pmHDUUtils.h"
Index: /trunk/psModules/src/camera/pmFPAview.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAview.h	(revision 9583)
+++ /trunk/psModules/src/camera/pmFPAview.h	(revision 9584)
@@ -7,6 +7,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-08-02 02:17:11 $
+*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-17 00:33:56 $
 *
 *  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
@@ -17,4 +17,5 @@
 
 #include "pmFPA.h"
+#include "pmFPALevel.h"
 
 /// @addtogroup AstroImage
Index: /trunk/psModules/src/camera/pmHDUGenerate.c
===================================================================
--- /trunk/psModules/src/camera/pmHDUGenerate.c	(revision 9583)
+++ /trunk/psModules/src/camera/pmHDUGenerate.c	(revision 9584)
@@ -9,4 +9,5 @@
 
 #include "pmFPA.h"
+#include "pmFPALevel.h"
 #include "pmHDU.h"
 #include "pmHDUUtils.h"
Index: /trunk/psModules/src/concepts/pmConcepts.h
===================================================================
--- /trunk/psModules/src/concepts/pmConcepts.h	(revision 9583)
+++ /trunk/psModules/src/concepts/pmConcepts.h	(revision 9584)
@@ -7,6 +7,6 @@
 /// @author Paul Price, IfA
 ///
-/// @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2006-10-16 22:03:56 $
+/// @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-10-17 00:33:56 $
 ///
 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
@@ -18,4 +18,5 @@
 #include <pslib.h>
 #include "pmFPA.h"
+#include "pmFPALevel.h"
 
 /// Function to call to parse a concept once it has been read
Index: /trunk/psModules/src/detrend/pmDetrendDB.c
===================================================================
--- /trunk/psModules/src/detrend/pmDetrendDB.c	(revision 9583)
+++ /trunk/psModules/src/detrend/pmDetrendDB.c	(revision 9584)
@@ -7,4 +7,5 @@
 #include <pslib.h>
 #include "pmFPA.h"
+#include "pmFPALevel.h"
 #include "pmDetrendDB.h"
 #include "psPipe.h"
Index: /trunk/psModules/src/detrend/pmDetrendDB.h
===================================================================
--- /trunk/psModules/src/detrend/pmDetrendDB.h	(revision 9583)
+++ /trunk/psModules/src/detrend/pmDetrendDB.h	(revision 9584)
@@ -6,5 +6,5 @@
 *  to the detrend database go through the external dettools functions.  this allows the modules
 *  and directly dependent program to be sufficiently independent of the database schema that it
-*  can be used with any properly defined detrend database tables.  
+*  can be used with any properly defined detrend database tables.
 *
 *  XXX place the specific name of the detrend database query command in the configuration data
@@ -14,6 +14,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-10-10 01:02:25 $
+*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-17 00:33:57 $
 *
 *  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
@@ -22,4 +22,6 @@
 #ifndef PM_DETREND_DB_H
 #define PM_DETREND_DB_H
+
+#include "pmFPALevel.h"
 
 typedef enum {
Index: /trunk/psModules/src/psmodules.h
===================================================================
--- /trunk/psModules/src/psmodules.h	(revision 9583)
+++ /trunk/psModules/src/psmodules.h	(revision 9584)
@@ -19,4 +19,6 @@
 #include <pmHDUGenerate.h>
 #include <pmFPA.h>
+#include <pmFPALevel.h>
+#include <pmFPAFlags.h>
 #include <pmFPAview.h>
 #include <pmFPAfile.h>
