Index: trunk/archive/scripts/src/papFocalPlane.h
===================================================================
--- trunk/archive/scripts/src/papFocalPlane.h	(revision 4309)
+++ trunk/archive/scripts/src/papFocalPlane.h	(revision 4386)
@@ -9,46 +9,55 @@
 #define PS_META_CELL PS_META_UNKNOWN
 
-
 typedef struct {
-    // How to get information
-    const psMetadata *defaults;		// IPP concepts supplied with defaults
-    const psMetadata *database;		// IPP concepts supplied from database lookup
-    const psMetadata *fits;		// IPP concepts supplied from FITS headers
-    
-    // A source of information
+    // 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
+    // Information
     psMetadata *values;			// Important values (cached)
-    psMetadata *header;			// The FITS header
-    psDB *db;				// The database handle
-
-    // Lower levels
+    const psMetadata *camera;		// Camera configuration
+    psDB *db;				// Database
     psMetadata *chips;			// The chips (referred to by name)
-
-    psArray *images;			// The pixel data, if it corresponds to this level
+    // FITS data
+    psArray *pixels;			// The pixel data, if it corresponds to this level
+    psMetadata *header;			// The FITS header, if it corresponds to this level
 } papFPA;
 
 typedef struct {
-    // Sources of information
+    // Offset specifying position on focal plane
+    const int col0;			// Offset from the left of FPA
+    const 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
+    // Information
     psMetadata *values;			// Important values (cached)
-    psMetadata *header;			// The FITS header
-
-    // Lower levels
     psMetadata *cells;			// The cells (referred to by name)
-
-    psArray *images;			// The pixel data, if it corresponds to this level
+    // FITS data
+    psArray *pixels;			// The pixel data, if it corresponds to this level
+    psMetadata *header;			// The FITS header, if it corresponds to this level
 } papChip;
 
 typedef struct {
-    // Sources of information
+    // Offset specifying position on chip
+    const int col0;			// Offset from the left of chip
+    const 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
+    // Information
     psMetadata *values;			// Important values (cached)
-    psMetadata *header;			// The FITS header
-
-    // Lower levels
     psArray *readouts;			// The readouts (referred to by number)
-
-    psArray *images;			// The pixel data, if it corresponds to this level
+    // FITS data
+    psArray *pixels;			// The pixel data, if it corresponds to this level
+    psMetadata *header;			// The FITS header, if it corresponds to this level
 } papCell;
 
 
 typedef struct {
+    // Details for position on the cell
     const int col0;			// Offset from the left of cell.
     const int row0;			// Offset from the bottom of cell.
@@ -57,7 +66,8 @@
     const unsigned int colBins;		// Amount of binning in x-dimension
     const unsigned int rowBins;		// Amount of binning in y-dimension
-    psImage* image;			// The pixels
+    // Information
+    psImage *image;			// The pixels
     psList *overscans;			// Array of subimages containing the overscan region(s)
-    psMetadata* values;			// readout-level metadata
+    psMetadata *values;			// readout-level metadata
 } papReadout;
 
@@ -68,5 +78,5 @@
 			       const char *cellName, // The name of the cell
 			       const char *valueName // Name of value
-			       );
+    );
 
 // Type-specific functions provided as a convenience to the user
@@ -94,12 +104,10 @@
 
 // Allocators and deallocators
-papFPA *papFPAAlloc(psMetadata *fits, // FITS translation info
-		    psMetadata *database, // Database lookup info
-		    psMetadata *defaults, // Defaults info
-		    psDB *db		// Database handle
+papFPA *papFPAAlloc(const psMetadata *camera, // Camera configuration
+		    psDB *db		// Database
     );
 void p_papFPAFree(papFPA *fpa);
 
-papChip *papChipAlloc(papFPA *fpa,		// FPA to which the chip belongs
+papChip *papChipAlloc(papFPA *fpa,	// FPA to which the chip belongs
 		    const char *name	// Name of the chip
     );
@@ -107,14 +115,14 @@
 
 papCell *papCellAlloc(papChip *chip,	// Chip to which the cell belongs
-		    const char *name,	// Name of the cell
-		    int nReadouts	// Number of readouts contained
+		      const char *name,	// Name of the cell
+		      int nReadouts	// Number of readouts contained
     );
 void p_papCellFree(papCell *cell);
 
 papReadout *papReadoutAlloc(papCell *cell,	// Cell to which the readout belongs
-			  int readoutNum, // Number of the readout
-			  psImage *image, // The pixels
-			  psList *overscans, // The overscan images
-			  int col0, int row0, int colParity, int rowParity, int colBin, int rowBin // Data
+			    int readoutNum, // Number of the readout
+			    psImage *image, // The pixels
+			    psList *overscans, // The overscan images
+			    int col0, int row0, int colParity, int rowParity, int colBin, int rowBin // Data
     );
 void p_papReadoutFree(papReadout *readout);
