Index: trunk/doc/modules/CameraImages.tex
===================================================================
--- trunk/doc/modules/CameraImages.tex	(revision 4757)
+++ trunk/doc/modules/CameraImages.tex	(revision 5022)
@@ -105,4 +105,16 @@
 \subsection{Image Data Container Hierarchy}
 
+Here we specify the contents of the focal plane hierarchy:
+\code{pmReadout}, \code{pmCell}, \code{pmChip} and \code{pmFPA}.  Many
+of the components of these are similar.  All but the \code{pmFPA}
+contain offsets from the level above (\code{col0,row0}), and a link to
+the parent. All but the \code{pmReadout} contain a private pointer to
+FITS data and more detailed astrometric transforms.  Each contains an
+\code{analysis} metadata container which is intended to store results
+of analyses (e.g., the r.m.s. of the overscan fit).
+
+\tbd{At what stage are the offsets (\code{col0,row0}) get set, and how
+are they known?}
+
 \subsubsection{A Readout}
 
@@ -112,6 +124,6 @@
 factors and parity (if the binning value is negative, then the parity
 is reversed).  It also contains the pixel data (with corresponding
-mask), metadata containers for the concepts and analysis, and a link
-to the parent.
+mask and weight), metadata container for the analysis, and a link to
+the parent.
 
 \begin{verbatim}
@@ -125,7 +137,7 @@
     psImage *image;                    // Imaging area of readout
     psImage *mask;                     // Mask for image
+    psImage *weight;                   // Weight for image
     psList *bias;                      // List of bias section (sub-)images
     psMetadata *analysis;              // Readout-level analysis metadata
-    psMetadata *concepts;              // Cache for PS concepts
     pmCell *parent;                    // Parent cell
 } pmReadout;
@@ -146,5 +158,5 @@
 A cell consists of one or more readouts (usually only one except in
 the case that the cell has been used for fast guiding, or similar
-situations).  It have values which specifies the position of the cell
+situations).  It has values which specifies the position of the cell
 on the chip for rough positioning, along with more precise coordinate
 transforms from the cell to the chip and, as a convenience, from the
@@ -159,7 +171,7 @@
 Focal Plane $\rightarrow$ Tangent Plane $\rightarrow$ Sky, but will be
 faster.  The cell also contains metadata containers for the concepts
-and analysis, a link to the parent, and pointers to the various FITS
-data, if that corresponds to this level.  A boolean indicates whether
-the cell is of interest, allowing it to be excluded from analysis.
+and analysis, a link to the parent, and a container for the FITS data,
+if that corresponds to this level.  A boolean indicates whether the
+cell is of interest, allowing it to be excluded from analysis.
 
 \begin{verbatim}
@@ -174,12 +186,10 @@
     // Information
     psMetadata *concepts;              // Cache for PS concepts
+    psMetadata *camera;		       // Camera information
     psMetadata *analysis;              // Cell-level analysis metadata
     psArray *readouts;                 // The readouts (referred to by number)
     pmChip *parent;                    // Parent chip
     bool valid;                        // Do we bother about reading and working with this cell?
-    // FITS data
-    const char *extname;               // Extension name, if it corresponds to this level
-    psArray *pixels;                   // The pixel data, if it corresponds to this level
-    psMetadata *header;                // The FITS header, if it corresponds to this level
+    p_pmHDU *private;		       // FITS data
 } pmCell;
 \end{verbatim}
@@ -187,5 +197,5 @@
 The constructor for \code{pmCell} shall be:
 \begin{verbatim}
-pmCell *pmCellAlloc(pmChip *chip);
+pmCell *pmCellAlloc(pmChip *chip, psMetadata *cameraData, psString name);
 \end{verbatim}
 The constructor shall make an empty \code{pmCell}.  If the parent
@@ -193,6 +203,8 @@
 cell shall be placed in the parent's array of \code{cells}.  The
 \code{readouts} array shall be allocated with a zero size, and the
-metadata containers constructed.  All other pointers in the structure
-shall be initialized to \code{NULL}.
+metadata containers constructed.  The cell's \code{camera} pointer
+shall be set to the provided \code{cameraData}, and the \code{name}
+shall be used to set \code{CELL.NAME} in the \code{concepts}.  All
+other pointers in the structure shall be initialized to \code{NULL}.
 
 \subsubsection{A Chip}
@@ -224,8 +236,5 @@
     pmFPA *parent;                     // Parent FPA
     bool valid;                        // Do we bother about reading and working with this chip?
-    // FITS data
-    const char *extname;               // Extension name, if it corresponds to this level
-    psArray *pixels;                   // The pixel data, if it corresponds to this level
-    psMetadata *header;                // The FITS header, if it corresponds to this level
+    p_pmHDU *private;			// FITS data
 } pmChip;
 \end{verbatim}
@@ -233,5 +242,5 @@
 The constructor for \code{pmChip} shall be:
 \begin{verbatim}
-pmChip *pmChipAlloc(pmFPA *fpa);
+pmChip *pmChipAlloc(pmFPA *fpa, psString name);
 \end{verbatim}
 The constructor shall make an empty \code{pmChip}.  If the parent
@@ -239,6 +248,7 @@
 shall be placed in the parent's array of \code{chips}.  The
 \code{cells} array shall be allocated with a zero size, and the
-metadata containers constructed. All other pointers in the structure
-shall be initialized to \code{NULL}.
+metadata containers constructed.  The \code{name} shall be used to set
+\code{CHIP.NAME} in the \code{concepts}.  All other pointers in the
+structure shall be initialized to \code{NULL}.
 
 \subsubsection{A Focal Plane}
@@ -268,19 +278,13 @@
     psMetadata *analysis;              // FPA-level analysis metadata
     const psMetadata *camera;          // Camera configuration
-    psDB *db;                          // Database handle
     psArray *chips;                    // The chips
-    // FITS data
-    psMetadata *header;                // The FITS header, if it corresponds to this level
+    p_pmHDU *private;		       // FITS data
+    psMetadata *phu;		       // Primary Header
 } pmFPA;
 \end{verbatim}
 
-\tbd{Carrying the DB handle around in the pmFPA may not be what we
-really want to do in the end (we might want to stuff it into a
-separate structure with other sources of information), but for now this
-serves as an approximation and a useful convenience.}
-
 The constructor for \code{pmFPA} shall be:
 \begin{verbatim}
-pmFPA *pmFPAAlloc(const psMetadata *camera, psDB *db);
+pmFPA *pmFPAAlloc(const psMetadata *camera);
 \end{verbatim}
 The constructor shall make an empty \code{pmFPA}.  The \code{chips}
@@ -376,5 +380,6 @@
 \code{pmFPARead} shall read a \code{fits} file (the contents of which
 are described by the previous \code{camera} configuration) into an
-extant \code{fpa}.
+extant \code{fpa}.  This involves reading the headers and pixels, as
+well as ingesting all the concepts.
 
 \begin{prototype}
