Index: trunk/archive/scripts/src/phase2/pmFPA.h
===================================================================
--- trunk/archive/scripts/src/phase2/pmFPA.h	(revision 5462)
+++ trunk/archive/scripts/src/phase2/pmFPA.h	(revision 5564)
@@ -15,54 +15,70 @@
     psArray *masks;			// The mask data, if it corresponds to this level
     psArray *weights;			// The weight data, if it corresponds to this level
-} pmPixelData;
+} p_pmHDU;
 
 typedef struct {
     // 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
+    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
     // Information
-    psMetadata *camera;			// Camera configuration
-    psMetadata *concepts;		// Values for concepts
-    psMetadata *phu;			// Primary Header
-    psArray *chips;			// The chips
-    pmPixelData *data;			// FITS data
+    psMetadata *concepts;              // Cache for PS concepts
+    psMetadata *analysis;              // FPA-level analysis metadata
+    const psMetadata *camera;          // Camera configuration
+    psArray *chips;                    // The chips
+    p_pmHDU *hdu;		       // FITS data
+    psMetadata *phu;		       // Primary Header
 } pmFPA;
 
 typedef struct {
     // Offset specifying position on focal plane
-    const int col0;			// Offset from the left of FPA
-    const int row0;			// Offset from the bottom of FPA
+    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
+    psPlaneTransform* toFPA;           // Transformation from chip to FPA coordinates
+    psPlaneTransform* fromFPA;         // Transformation from FPA to chip coordinates
     // Information
-    psMetadata *concepts;		// Values for concepts
-    psArray *cells;			// The cells (referred to by name)
-    pmFPA *parent;			// Parent FPA
-    bool valid;				// Valid for reading in?
-    pmPixelData *data;			// FITS data
+    psMetadata *concepts;              // Cache for PS concepts
+    psMetadata *analysis;              // Chip-level analysis metadata
+    psArray *cells;                    // The cells (referred to by name)
+    pmFPA *parent;                     // Parent FPA
+    bool valid;                        // Do we bother about reading and working with this chip?
+    p_pmHDU *hdu;			// FITS data
 } pmChip;
 
 typedef struct {
     // Offset specifying position on chip
-    const int col0;			// Offset from the left of chip
-    const int row0;			// Offset from the bottom of chip
+    int col0;                          // Offset from the left of chip.
+    int row0;                          // Offset from the bottom of chip.
     // Astrometric transformations
-    psPlaneTransform* toChip;		// Transformations from cell to chip coordinates
-    psPlaneTransform* fromChip;		// Transformations from cell to chip coordinates
-    psPlaneTransform* toFPA;		// Transformations from cell to FPA coordinates
-    psPlaneTransform* toTP;		// Transformations from cell to FPA coordinates
-    psPlaneTransform* toSky;		// Transformations from cell to tangent plane coordinates
+    psPlaneTransform* toChip;          // Transformations from cell to chip coordinates
+    psPlaneTransform* toFPA;           // Transformations from cell to FPA coordinates
+    psPlaneTransform* toSky;           // Transformations from cell to sky coordinates
     // Information
-    psMetadata *concepts;		// Values for concepts
-    psMetadata *camera;			// Camera information
-    psArray *readouts;			// The readouts (referred to by number)
-    pmChip *parent;			// Parent chip
-    bool valid;				// Valid for operating on?
-    pmPixelData *data;			// FITS data
+    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?
+    p_pmHDU *hdu;		       // FITS data
 } pmCell;
 
+typedef struct {
+    // Position on the cell
+    int col0;                          // Offset from the left of cell.
+    int row0;                          // Offset from the bottom of cell.
+    int colBins;                       // Amount of binning in x-dimension and parity (from sign)
+    int rowBins;                       // Amount of binning in y-dimension and parity (from sign)
+    // Information
+    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
+    pmCell *parent;                    // Parent cell
+} pmReadout;
 
+#if 0
 typedef struct {
     // Details for position on the cell
@@ -80,5 +96,5 @@
     psImage *weight;			// Weight image
 } pmReadout;
-
+#endif
 
 psList *pmReadoutGetBias(pmReadout *readout // Readout for which to get the bias sections
@@ -87,6 +103,6 @@
 
 // Allocators and deallocators
-pmPixelData *pmPixelDataAlloc(const char *extname);
-void p_pmPixelDataFree(pmPixelData *pd);
+p_pmHDU *p_pmHDUAlloc(const char *extname);
+void p_pmHDUFree(p_pmHDU *hdu);
 pmFPA *pmFPAAlloc(const psMetadata *camera // Camera configuration
     );
@@ -107,5 +123,5 @@
 			  psImage *image, // The pixels
 			  psImage *mask,// The mask pixels
-			  int col0, int row0, int colParity, int rowParity, int colBin, int rowBin // Data
+			  int col0, int row0, int colBin, int rowBin // Data
     );
 void p_pmReadoutFree(pmReadout *readout);
