Index: trunk/archive/pslib/include/psAstrom.h
===================================================================
--- trunk/archive/pslib/include/psAstrom.h	(revision 704)
+++ trunk/archive/pslib/include/psAstrom.h	(revision 753)
@@ -79,6 +79,6 @@
 
     psMetadata *md;			///< FPA-level metadata 
-    psPlaneDistortion *TPtoFP;		///< Transformation term from 
-    psPlaneDistortion *FPtoTP;		///< Transformation term from 
+    psPlaneDistort *TPtoFP;		///< Transformation term from 
+    psPlaneDistort *FPtoTP;		///< Transformation term from 
     psFixedPattern *pattern;		///< Fixed pattern residual offsets
     const psExposure *exp;		///< information about this exposure
@@ -96,6 +96,6 @@
 
     psMetadata *md;			///< Chip-level metadata
-    psPlaneCoordXform *chipToFPA;	///< Transformations from chip coordinates to FPA coordinates
-    psPlaneCoordXform *FPAtoChip;	///< Transformations from FPA coordinates to chip
+    psPlaneTransform *chipToFPA;	///< Transformations from chip coordinates to FPA coordinates
+    psPlaneTransform *FPAtoChip;	///< Transformations from FPA coordinates to chip
 
     struct psFPA *parentFPA;		///< FPA which contains this chip
@@ -110,7 +110,7 @@
     psMetadata *md;			///< Cell-level metadata
 
-    psPlaneCoordXform *cellToChip;	///< Transformations from cell coordinates to chip coordinates
-    psPlaneCoordXform *cellToFPA;	///< Transformations from cell coordinates to FPA coordinates
-    psPlaneCoordXform *cellToSky;	///< Quick and Dirty transformations from cell coordinates to sky
+    psPlaneTransform *cellToChip;	///< Transformations from cell coordinates to chip coordinates
+    psPlaneTransform *cellToFPA;	///< Transformations from cell coordinates to FPA coordinates
+    psPlaneTransform *cellToSky;	///< Quick and Dirty transformations from cell coordinates to sky
 
     struct psChip  *parentChip;		///< chip which contains this cell
@@ -134,123 +134,134 @@
 /*** Calculating and applying astrometric solutions ***/
 
+/** Return the cell in FPA which contains the given FPA coordinates */
+psCell *
+psCellInFPA(psCell *out,		///< Cell to return, or NULL
+	    const psPlane *coord,	///< Coordinate in FPA
+	    const psFPA *fpa)		///< FPA description
+;
+
+
 /** returns Chip in FPA which contains the given FPA coordinate */
 psChip *
 psChipInFPA (psChip *out,		///< Chip to return, or NULL
-	     const psPlaneCoord *coord,	///< coordinate in FPA
-	     const psFPA *fpa 		///< FPA description
-	     );
+	     const psPlane *coord,	///< coordinate in FPA
+	     const psFPA *fpa) 		///< FPA description
+;
 
 /** returns Cell in Chip which contains the given chip coordinate */
 psCell *
 psCellInChip(psCell *out,		///< Cell to return, or NULL
-	     const psPlaneCoord *coord,	///< coordinate in chip
-	     const psChip *chip	///< chip description
-	     );
-
-/** Return the cell in FPA which contains the given FPA coordinates */
-psCell *
-psCellInFPA(psCell *out,		///< Cell to return, or NULL
-	    const psPlaneCoord *coord,	///< Coordinate in FPA
-	    const psFPA *fpa		///< FPA description
-	    );
-
+	     const psPlane *coord,	///< coordinate in chip
+	     const psChip *chip)	///< chip description
+;
+
+/************ conversions low -> high ****************/
+/** converts the specified Cell coord to the coord on the parent Chip */
+psPlane *
+psCoordCelltoChip (psPlane *out,	///< Coordinates to return, or NULL
+		   const psPlane *in,	///< input Cell coordinate
+		   const psCell *cell) 	///< Cell description
+;
+
+/** converts the specified Chip coord to the coord on the parent FPA */
+psPlane *
+psCoordChiptoFPA (psPlane *out,		///< Coordinates to return, or NULL
+		  const psPlane *in,	///< input Chip coordinate
+		  const psChip *chip) 	///< Chip description
+;
+
+/** Convert focal plane coords to tangent plane coordinates */
+psPlane *
+psCoordFPAToTP(psPlane *out,		///< Coordinates to return, or NULL
+	       const psPlane *in,	///< input FPA coordinate
+	       const psFPA *fpa)	///< FPA description
+;
+
+/** Convert tangent plane coords to (RA,Dec) */
+psSphere *
+psCoordTPtoSky(psSphere *out,		///< Coordinates to return, or NULL
+	       const psPlane *in,	///< input TP coordinate
+	       const psGrommit *grommit) ///< Grommit for fast conversion
+;
+
+/** Convert Cell coords to FPA coordinates */
+psPlane *
+psCoordCellToFPA(psPlane *out,		///< Coordinates to return, or NULL
+		 const psPlane *in,	///< Input cell coordinates
+		 const psCell *cell)	///< Cell description
+;
+
+/** Convert cell and cell coordinate to (RA,Dec) */
+psSphere *
+psCoordCellToSky(psSphere *out,		///< Coordinates to return, or NULL
+		 const psPlane *in,	///< cell coordinates to transform
+		 const psCell *cell)	///< Cell to get coordinates for
+;
+
+/** Convert cell and cell coordinate to (RA,Dec) */
+psSphere *
+psCoordCellToSkyQD(psSphere *out,	///< Coordinates to return, or NULL
+		   const psPlane *in,	///< cell coordinates to transform
+		   const psCell *cell)	///< Cell to get coordinates for
+;
+
+
+/************ conversions low -> high ****************/
+/** Convert (RA,Dec) to tangent plane coords */
+psPlane *
+psCoordSkyToTP(psPlane *out,		///< Coordinates to return, or NULL
+	       const psSphere *in,	///< input Sky coordinate
+	       const psGrommit *grommit) ///< Grommit for fast conversion
+;
+
+/** Convert tangent plane coords to focal plane coordinates */
+psPlane *
+psCoordTPtoFPA(psPlane *out,		///< Coordinates to return, or NULL
+	       const psPlane *in,	///< input TP coordinate
+	       const psFPA *fpa)	///< FPA description
+;
+
+/** converts the specified FPA coord to the coord on the given Chip */
+psPlane *
+psCoordFPAtoChip (psPlane *out,		///< Coordinates to return, or NULL
+		  const psPlane *in,	///< input FPA coordinate
+		  const psChip *chip)	///< Chip of interest
+;
+
+/** converts the specified Chip coord to the coord on the given Cell */
+psPlane *
+psCoordChiptoCell (psPlane *out,	///< Coordinates to return, or NULL
+		   const psPlane *in,	///< input Chip coordinate
+		   const psCell *cell) 	///< Cell of interest
+;
 
 /** Convert (RA,Dec) to cell and cell coordinates */
-psPlaneCoord *
-psCoordSkyToCell(psPlaneCoord *out,	///< Coordinates to return, or NULL
-		 psCell *cell,		///< Cell to return
-		 const psSphereCoord *in, ///< Input coordinates
-		 const psFPA *fpa	///< FPA description
-		 );
-
-/** Convert cell and cell coordinate to (RA,Dec) */
-psSphereCoord *
-psCoordCellToSky(psSphereCoord *out,	///< Coordinates to return, or NULL
-		 const psPlaneCoord *coord, ///< cell coordinates to transform
-		 const psCell *cell	///< Cell to get coordinates for
-		 );
+psPlane *
+psCoordSkyToCell(psPlane *out,		///< Coordinates to return
+		 const psSphere *in,	///< Input coordinates
+		 const psCell *cell)	///< Cell of interest
+;
 
 /** Quick and dirty cell to (RA,Dec) --- employs cellToSky transformation */
-psSphereCoord *
-psCoordCellToSkyQuick(psSphereCoord *out, ///< Coordinates to return, or NULL
-		      const psPlaneCoord *coord,	///< cell coordinates to transform
-		      const psCell *cell ///< Cell description
-		      );
-
-/** Convert (RA,Dec) to tangent plane coords */
-psPlaneCoord *
-psCoordSkyToTP(psPlaneCoord *out,	///< Coordinates to return, or NULL
-	       const psSphereCoord *coord, ///< input Sky coordinate
-	       const psGrommit *grommit ///< Grommit for fast conversion
-	       );
-
-/** Convert tangent plane coords to focal plane coordinates */
-psPlaneCoord *
-psCoordTPtoFPA(psPlaneCoord *out,	///< Coordinates to return, or NULL
-	       const psPlaneCoord *coord, ///< input TP coordinate
-	       const psFPA *fpa	       ///< FPA description
-	       );
-
-/** converts the specified FPA coord to the coord on the given Chip */
-psPlaneCoord *
-psCoordFPAtoChip (psPlaneCoord *out,	///< Coordinates to return, or NULL
-		  const psPlaneCoord *coord, ///< input FPA coordinate
-		  const psChip *chip	///< Chip of interest
-		  ); 
-
-/** converts the specified Chip coord to the coord on the given Cell */
-psPlaneCoord *
-psCoordChiptoCell (psPlaneCoord *out,	///< Coordinates to return, or NULL
-		   const psPlaneCoord *coord, ///< input Chip coordinate
-		   const psCell *cell 	///< Cell of interest
-		   );
-
-/** converts the specified Cell coord to the coord on the parent Chip */
-psPlaneCoord *
-psCoordCelltoChip (psPlaneCoord *out,	///< Coordinates to return, or NULL
-		   const psPlaneCoord *coord, ///< input Cell coordinate
-		   const psCell *cell 	///< Cell description
-		   );
-
-/** converts the specified Chip coord to the coord on the parent FPA */
-psPlaneCoord *
-psCoordChiptoFPA (psPlaneCoord *out,		///< Coordinates to return, or NULL
-		  const psPlaneCoord *coord,	///< input Chip coordinate
-		  const psChip *chip 	///< Chip description
-		  );
-
-/** Convert focal plane coords to tangent plane coordinates */
-psPlaneCoord *
-psCoordFPAToTP(psPlaneCoord *out,		///< Coordinates to return, or NULL
-	       const psPlaneCoord *coord, ///< input FPA coordinate
-	       const psFPA *fpa		///< FPA description
-	       );
-
-/** Convert tangent plane coords to (RA,Dec) */
-psSphereCoord *
-psCoordTPtoSky(psSphereCoord *out,	///< Coordinates to return, or NULL
-	       const psPlaneCoord *coord, ///< input TP coordinate
-	       const psGrommit *grommit ///< Grommit for fast conversion
-	       );
-
-/** Convert Cell coords to FPA coordinates */
-psPlaneCoord *
-psCoordCellToFPA(psPlaneCoord *out,	///< Coordinates to return, or NULL
-		 const psPlaneCoord *coord, ///< Input cell coordinates
-		 const psCell *cell	///< Cell description
-		 );
+psSphere *
+psCoordSkyToCellQD(psPlane *out,	///< Coordinates to return
+		   const psSphere *in,	///< Input coordinates
+		   const psCell *cell)	///< Cell of interest
+;
+
+/**** other utilities ****/
 
 /** Get the airmass for a given position and sidereal time */
 float
-psGetAirmass(const psSphereCoord *coord, ///< Position on the sky
+psGetAirmass(const psSphere *coord,	///< Position on the sky
              double siderealTime,	///< Sidereal time
-	     float height		///< Height above sea level
-             );
+	     float height)		///< Height above sea level
+;
 
 /** Get the parallactic angle for a given position and sidereal time */
 float
-psGetParallactic(const psSphereCoord *coord, ///< Position on the sky
-                 double siderealTime    ///< Sidereal time
-                 );
+psGetParallactic(const psSphere *coord, ///< Position on the sky
+                 double siderealTime)	///< Sidereal time
+;
 
 /** Estimate atmospheric refraction, along the parallactic */
@@ -259,11 +270,11 @@
 		psPhotSystem colorPlus,	///< Colour reference
 		psPhotSystem colorMinus, ///< Colour reference
-                const psExposure *exp	///< Telescope pointing information, for airmass, temp and pressure
-		);
+                const psExposure *exp)	///< Telescope pointing information, for airmass, temp and pressure
+;
 
 /** Calculate the parallax factor */
-psSphereCoord *
-psGetParallaxFactor(const psExposure *exp ///< Exposure details
-    );
+psSphere *
+psGetParallaxFactor(const psExposure *exp) ///< Exposure details
+;
 
 /*** Constructors / Destructors ******************************************************/
@@ -281,21 +292,21 @@
                 float pressure,         ///< Pressure
                 float humidity,         ///< Relative humidity
-                float exptime           ///< Exposure time
-		);
+                float exptime)		///< Exposure time
+;
 
 /** Destructor */
 void
-psExposureFree(psExposure *restrict myExp ///< Object to destroy
-	       );
+psExposureFree(psExposure *restrict myExp) ///< Object to destroy
+;
 
 /** Constructor */
 psGrommit *
-psGrommitAlloc(const psExposure *exp	///< Relevant exposure
-    );
+psGrommitAlloc(const psExposure *exp)	///< Relevant exposure
+;
 
 /** Destructor */
 void
-psGrommitFree(psGrommit *grommit	///< Grommit to destroy
-    );
+psGrommitFree(psGrommit *grommit)	///< Grommit to destroy
+;
 
 /* \} */ // End of AstroGroup Functions
@@ -304,11 +315,11 @@
 
 /*
-   example images:
-
-   GPC:          1 Chip per file, 1 Cell per extension 
-   Megacam:      1 FPA per file, 1 Chip per extension, 2 Cell per extension (DSEC) 
-   CFH12K (MEF): 1 FPA per file, 1 Chip per extension, 1 Cell per extension
-   CFHT-IR:      1 FPA per file, 1 Chip per extension, 4 Cell per extension (NAXIS = 3)
-   WIRCAM:       1 FPA per file, 1 Chip per extension, 1 Cell per extension (?)
+  example images:
+
+  GPC:          1 Chip per file, 1 Cell per extension 
+  Megacam:      1 FPA per file, 1 Chip per extension, 2 Cell per extension (DSEC) 
+  CFH12K (MEF): 1 FPA per file, 1 Chip per extension, 1 Cell per extension
+  CFHT-IR:      1 FPA per file, 1 Chip per extension, 4 Cell per extension (NAXIS = 3)
+  WIRCAM:       1 FPA per file, 1 Chip per extension, 1 Cell per extension (?)
    
 
