Index: /trunk/archive/pslib/include/psAstrom.h
===================================================================
--- /trunk/archive/pslib/include/psAstrom.h	(revision 269)
+++ /trunk/archive/pslib/include/psAstrom.h	(revision 270)
@@ -113,4 +113,5 @@
     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
 
     struct psChip  *parentChip;		///< chip which contains this cell
@@ -119,5 +120,5 @@
 /** a Frame: a collection of pixels */
 typedef struct {
-    int x0, y0;				//!< Offset from the lower-left corner
+    const int x0, y0;			//!< Offset from the lower-left corner
     psImage *image;                     ///< imaging area of cell 
     psDlist *objects;			///< objects derived from cell
@@ -136,67 +137,111 @@
 /** returns Chip in FPA which contains the given FPA coordinate */
 psChip *
-psChipInFPA (psFPA *fpa, 		///< FPA description
-	     psCoord *coord		///< coordinate in FPA
+psChipInFPA (psChip *out,		//!< Chip to return, or NULL
+	     const psFPA *fpa, 		///< FPA description
+	     const psCoord *coord	///< coordinate in FPA
 	     );
 
 /** returns Cell in Chip which contains the given chip coordinate */
 psCell *
-psCellInChip (psChip *chip, 		///< chip description
-	      psCoord *coord		///< coordinate in chip
-	      );
+psCellInChip(psCell *out,		//!< Cell to return, or NULL
+	     const psChip *chip,	///< chip description
+	     const psCoord *coord	///< coordinate in chip
+	     );
+
+/** Return the cell in FPA which contains the given FPA coordinates */
+psCell *
+psCellInFPA(psCell *out,		//!< Cell to return, or NULL
+	    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
+		 psCell *cell,		//!< Cell to return
+		 const psFPA *fpa	//!< FPA description
+		 );
+
+/** Convert cell and cell coordinate to (RA,Dec) */
+psCoord *
+psCoordCellToSky(psCoord *out,		//!< Coordinates to return, or NULL
+		 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
+		      const psCell *cell, //!< Cell description
+		      const psCoord *coord //!< cell coordinates to transform
+		      );
 
 /** Convert (RA,Dec) to tangent plane coords */
 psCoord *
-psCoordSkyToTP(psExposure *exp,		//!< Exposure description
-	       psCoord *coord		//!< input Sky coordinate
+psCoordSkyToTP(psCoord *out,		//!< Coordinates to return, or NULL
+	       const psExposure *exp,	//!< Exposure description
+	       const psCoord *coord	//!< input Sky coordinate
 	       );
 
 /** Convert tangent plane coords to focal plane coordinates */
 psCoord *
-psCoordTPtoFPA(psFPA *fpa,		//!< FPA description
-	       psCoord *coord		//!< input TP coordinate
+psCoordTPtoFPA(psCoord *out,		//!< Coordinates to return, or NULL
+	       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 (psFPA *fpa, 		///< FPA description
-		  psChip *chip,		///< Chip of interest
-		  psCoord *coord	///< input FPA coordinate
+psCoordFPAtoChip (psCoord *out,		//!< Coordinates to return, or NULL
+		  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 (psChip *chip,	///< Chip description
-		   psCell *cell, 	///< Cell of interest
-		   psCoord *coord	///< input Chip coordinate
+psCoordChiptoCell (psCoord *out,	//!< Coordinates to return, or NULL
+		   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 (psCell *cell, 	///< Cell description
-		   psCoord *coord	///< input Cell coordinate
+psCoordCelltoChip (psCoord *out,	//!< Coordinates to return, or NULL
+		   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 (psChip *chip, 	///< Chip description
-		  psCoord *coord	///< input Chip coordinate
+psCoordChiptoFPA (psCoord *out,		//!< Coordinates to return, or NULL
+		  const psChip *chip, 	///< Chip description
+		  const psCoord *coord	///< input Chip coordinate
 		  );
 
 /** Convert focal plane coords to tangent plane coordinates */
 psCoord *
-psCoordFPAToTP(psFPA *fpa,			//!< FPA description
-	       psCoord *coord		//!< input FPA coordinate
+psCoordFPAToTP(psCoord *out,		//!< Coordinates to return, or NULL
+	       const psFPA *fpa,	//!< FPA description
+	       const psCoord *coord	//!< input FPA coordinate
 	       );
 
 /** Convert tangent plane coords to (RA,Dec) */
 psCoord *
-psCoordTPtoSky(psExposure *exp,		//!< Exposure description
-	       psCoord *coord		//!< input TP coordinate
-	       );
+psCoordTPtoSky(psCoord *out,		//!< Coordinates to return, or NULL
+	       const psExposure *exp,	//!< Exposure description
+	       const psCoord *coord	//!< input TP coordinate
+	       );
+
+/** Convert Cell coords to FPA coordinates */
+psCoord *
+psCoordCellToFPA(psCoord *out,		//!< Coordinates to return, or NULL
+		 const psCell *cell,	//!< Cell description
+		 const psCoord *coord	//!< Input cell coordinates
+		 );
 
 /** Get the airmass for a given position and sidereal time */
 float
-psGetAirmass(psCoord *coord,		//!< Position on the sky
+psGetAirmass(const psCoord *coord,	//!< Position on the sky
              double siderealTime        //!< Sidereal time
              );
@@ -204,5 +249,5 @@
 /** Get the parallactic angle for a given position and sidereal time */
 float
-psGetParallactic(psCoord *coord,	//!< Position on the sky
+psGetParallactic(const psCoord *coord,	//!< Position on the sky
                  double siderealTime    //!< Sidereal time
                  );
@@ -211,7 +256,7 @@
 float
 psGetRefraction(float colour,           //!< Colour of object
-		psPhotSystem colorPlus,	// 
+		psPhotSystem colorPlus,	///< Colour reference
 		psPhotSystem colorMinus, ///< Colour reference
-                psExposure *exp         //!< Telescope pointing information, for airmass, temp and pressure
+                const psExposure *exp	//!< Telescope pointing information, for airmass, temp and pressure
 		);
 
