Index: trunk/archive/pslib/include/psAstrom.h
===================================================================
--- trunk/archive/pslib/include/psAstrom.h	(revision 621)
+++ trunk/archive/pslib/include/psAstrom.h	(revision 623)
@@ -96,6 +96,6 @@
 
     psMetadata *md;			///< Chip-level metadata
-    psCoordXform *chipToFPA;            ///< Transformations from chip coordinates to FPA coordinates
-    psCoordXform *FPAtoChip;		///< Transformations from FPA coordinates to chip
+    psPlaneCoordXform *chipToFPA;	///< Transformations from chip coordinates to FPA coordinates
+    psPlaneCoordXform *FPAtoChip;	///< Transformations from FPA coordinates to chip
 
     struct psFPA *parentFPA;		///< FPA which contains this chip
@@ -110,7 +110,7 @@
     psMetadata *md;			///< Cell-level metadata
 
-    psCoordXform *cellToChip;		///< Transformations from cell coordinates to chip coordinates
-    psCoordXform *cellToFPA;		///< Transformations from cell coordinates to FPA coordinates
-    psCoordXform *cellToSky;		///< Quick and Dirty transformations from cell coordinates to sky
+    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
 
     struct psChip  *parentChip;		///< chip which contains this cell
@@ -137,6 +137,6 @@
 psChip *
 psChipInFPA (psChip *out,		///< Chip to return, or NULL
+	     const psPlaneCoord *coord	///< coordinate in FPA
 	     const psFPA *fpa, 		///< FPA description
-	     const psCoord *coord	///< coordinate in FPA
 	     );
 
@@ -144,6 +144,6 @@
 psCell *
 psCellInChip(psCell *out,		///< Cell to return, or NULL
+	     const psPlaneCoord *coord	///< coordinate in chip
 	     const psChip *chip,	///< chip description
-	     const psCoord *coord	///< coordinate in chip
 	     );
 
@@ -151,96 +151,97 @@
 psCell *
 psCellInFPA(psCell *out,		///< Cell to return, or NULL
+	    const psPlaneCoord *coord	///< Coordinate in FPA
 	    const psFPA *fpa,		///< FPA description
-	    const psCoord *coord	///< Coordinate in FPA
 	    );
 
 
 /** Convert (RA,Dec) to cell and cell coordinates */
-psCoord *
-psCoordSkyToCell(psCoord *out,		///< Coordinates to return, or NULL
+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) */
-psCoord *
-psCoordCellToSky(psCoord *out,		///< Coordinates to return, or NULL
+psSphereCoord *
+psCoordCellToSky(psSphereCoord *out,	///< Coordinates to return, or NULL
+		 const psPlaneCoord *coord ///< cell coordinates to transform
 		 const psCell *cell,	///< Cell to get coordinates for
-		 const psCoord *coord	///< cell coordinates to transform
 		 );
 
 /** Quick and dirty cell to (RA,Dec) --- employs cellToSky transformation */
-psCoord *
-psCoordCellToSkyQuick(psCoord *out,	///< Coordinates to return, or NULL
+psSphereCoord *
+psCoordCellToSkyQuick(psSphereCoord *out, ///< Coordinates to return, or NULL
+		      const psPlaneCoord *coord	///< cell coordinates to transform
 		      const psCell *cell, ///< Cell description
-		      const psCoord *coord ///< cell coordinates to transform
 		      );
 
 /** Convert (RA,Dec) to tangent plane coords */
-psCoord *
-psCoordSkyToTP(psCoord *out,		///< Coordinates to return, or NULL
-	       const psExposure *exp,	///< Exposure description
-	       const psCoord *coord	///< input Sky coordinate
+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 */
-psCoord *
-psCoordTPtoFPA(psCoord *out,		///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordTPtoFPA(psPlaneCoord *out,	///< Coordinates to return, or NULL
+	       const psPlaneCoord *coord ///< input TP coordinate
 	       const psFPA *fpa,	///< FPA description
-	       const psCoord *coord	///< input TP coordinate
 	       );
 
 /** converts the specified FPA coord to the coord on the given Chip */
-psCoord *
-psCoordFPAtoChip (psCoord *out,		///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordFPAtoChip (psPlaneCoord *out,	///< Coordinates to return, or NULL
+		  const psPlaneCoord *coord ///< input FPA coordinate
 		  const psChip *chip,	///< Chip of interest
-		  const psCoord *coord	///< input FPA coordinate
 		  ); 
 
 /** converts the specified Chip coord to the coord on the given Cell */
-psCoord *
-psCoordChiptoCell (psCoord *out,	///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordChiptoCell (psPlaneCoord *out,	///< Coordinates to return, or NULL
+		   const psPlaneCoord *coord ///< input Chip coordinate
 		   const psCell *cell, 	///< Cell of interest
-		   const psCoord *coord	///< input Chip coordinate
 		   );
 
 /** converts the specified Cell coord to the coord on the parent Chip */
-psCoord *
-psCoordCelltoChip (psCoord *out,	///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordCelltoChip (psPlaneCoord *out,	///< Coordinates to return, or NULL
+		   const psPlaneCoord *coord ///< input Cell coordinate
 		   const psCell *cell, 	///< Cell description
-		   const psCoord *coord	///< input Cell coordinate
 		   );
 
 /** converts the specified Chip coord to the coord on the parent FPA */
-psCoord *
-psCoordChiptoFPA (psCoord *out,		///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordChiptoFPA (psPlaneCoord *out,		///< Coordinates to return, or NULL
+		  const psPlaneCoord *coord	///< input Chip coordinate
 		  const psChip *chip, 	///< Chip description
-		  const psCoord *coord	///< input Chip coordinate
 		  );
 
 /** Convert focal plane coords to tangent plane coordinates */
-psCoord *
-psCoordFPAToTP(psCoord *out,		///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordFPAToTP(psPlaneCoord *out,		///< Coordinates to return, or NULL
+	       const psPlaneCoord *coord ///< input FPA coordinate
 	       const psFPA *fpa,	///< FPA description
-	       const psCoord *coord	///< input FPA coordinate
 	       );
 
 /** Convert tangent plane coords to (RA,Dec) */
-psCoord *
-psCoordTPtoSky(psCoord *out,		///< Coordinates to return, or NULL
-	       const psExposure *exp,	///< Exposure description
-	       const psCoord *coord	///< input TP coordinate
+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 */
-psCoord *
-psCoordCellToFPA(psCoord *out,		///< Coordinates to return, or NULL
+psPlaneCoord *
+psCoordCellToFPA(psPlaneCoord *out,	///< Coordinates to return, or NULL
+		 const psPlaneCoord *coord ///< Input cell coordinates
 		 const psCell *cell,	///< Cell description
-		 const psCoord *coord	///< Input cell coordinates
 		 );
 
 /** Get the airmass for a given position and sidereal time */
 float
-psGetAirmass(const psCoord *coord,	///< Position on the sky
+psGetAirmass(const psSphereCoord *coord, ///< Position on the sky
              double siderealTime,	///< Sidereal time
 	     float height		///< Height above sea level
@@ -249,5 +250,5 @@
 /** Get the parallactic angle for a given position and sidereal time */
 float
-psGetParallactic(const psCoord *coord,	///< Position on the sky
+psGetParallactic(const psSphereCoord *coord, ///< Position on the sky
                  double siderealTime    ///< Sidereal time
                  );
@@ -262,5 +263,5 @@
 
 /** Calculate the parallax factor */
-psCoord *
+psSphereCoord *
 psGetParallaxFactor(const psExposure *exp ///< Exposure details
     );
