Index: /trunk/archive/pslib/include/psAstrom.h
===================================================================
--- /trunk/archive/pslib/include/psAstrom.h	(revision 1510)
+++ /trunk/archive/pslib/include/psAstrom.h	(revision 1511)
@@ -20,4 +20,21 @@
  * 4 <--> 5: SLALib transformation using exposure parameters (psExposure or psGrommit)
  */
+
+/** Observatory data */
+typedef struct {
+    const char *name;			///< Name of observatory
+    const double latitude;		///< Latitude of observatory, east positive
+    const double longitude;		///< Longitude of observatory
+    const double height;		///< Height of observatory
+    const double tlr;			///< Tropospheric Lapse Rate
+} psObservatory;
+
+psObservatory *
+psObservatoryAlloc(const char *name,	///< Name of observatory
+		   double latitude,	///< Latitude of observatory, east positive
+		   double longitude,	///< Longitude of observatory
+		   double height,	///< Height of observatory
+		   double tlr		///< Tropospheric Lapse Rate
+		   );
 
 /** Information needed (by SLALIB) to convert Apparent to Observed Position */
@@ -37,7 +54,22 @@
 } psGrommit;
 
+/** Constructor */
+psGrommit *
+psGrommitAlloc(double latitude,		///< geodetic latitude (radians)
+	       double sinLat, double cosLat, ///< sine and cosine of geodetic latitude
+	       double abberationMag,	///< magnitude of diurnal aberration vector
+	       double height,		///< height (HM)
+	       double temperature,	///< ambient temperature (TDK)
+	       double pressure,		///< pressure (PMB)
+	       double humidity,		///< relative humidity (RH)
+	       double wavelength,	///< wavelength (WL)
+	       double lapseRate,	///< lapse rate (TLR)
+	       double refractA, double refractB, ///< refraction constants A and B (radians)
+	       double longitudeOffset,	///< longitude + eqn of equinoxes + ``sidereal UT'' (radians)
+	       double siderealTime	///< local apparent sidereal time (radians)
+    );
+
 /** Exposure information from the telescope */
 typedef struct {
-    // Telescope longitude, latitude and height are stored separately, since they don't change with pointing
     const double ra, dec;		///< Telescope boresight
     const double ha;			///< Hour angle
@@ -45,5 +77,5 @@
     const double az;			///< Azimuth
     const double lst;			///< Local Sidereal Time
-    const float mjd;			///< MJD of observation
+    const psTime *time;			///< Time of observation
     const float rotAngle;		///< Rotator position angle
     const float temp;			///< Air temperature, for estimating refraction
@@ -51,4 +83,6 @@
     const float humidity;		///< Relative humidity, for calculating refraction
     const float exptime;		///< Exposure time
+    const float wavelength;		///< Wavelength of observation
+    const psObservatory *observatory;	///< Observatory data: longitude, latitude, height etc.
     /* Derived quantities */
     const float posAngle;		///< Position angle
@@ -60,4 +94,20 @@
 } psExposure;
 
+/** Constructor */
+psExposure *
+psExposureAlloc(double ra, double dec,  ///< Telescope boresight
+                double ha,              ///< Hour angle
+                double zd,              ///< Zenith distance
+                double az,              ///< Azimuth
+                double lst,             ///< Local Sidereal Time
+		const psTime *time,	///< Time of observation
+                float rotAngle,         ///< Rotator position angle
+                float temp,             ///< Temperature
+                float pressure,         ///< Pressure
+                float humidity,         ///< Relative humidity
+                float exptime,		///< Exposure time
+		float wavelength,	///< Wavelength of observation
+		const psObservatory *observatory ///< Observatory data
+		);
 
 /** The fixed pattern residual offsets.  These are specified via a coarse grid of x and y offsets. */
@@ -69,4 +119,12 @@
 } psFixedPattern;
 
+/** Constructor */
+psFixedPattern *
+psFixedPatternAlloc(double x0, double y0, ///< Position of the lower-left corner of the grid on the focal plane
+		    double xScale, double yScale, ///< Scale of the grid
+		    const psImage *x,	///< Grid of offsets in x
+		    const psImage *y	///< Grid of offsets in y
+		    );
+
 
 /** a Focal plane array: a collection of chips.  Not all chips in a camera need to be listed in an instance of
@@ -83,4 +141,5 @@
     psFixedPattern *pattern;		///< Fixed pattern residual offsets
     const psExposure *exp;		///< information about this exposure
+    const psGrommit *grommit;		///< Information for conversion from TP to Sky.
     psPhotSystem colorPlus, colorMinus; ///< Colour reference
     float rmsX, rmsY;                   ///< Dispersion in astrometric solution
@@ -88,4 +147,11 @@
 } psFPA;
 
+/** Constructor: makes an empty FPA */
+psFPA *
+psFPAAlloc(int nAlloc,			///< Number of Cells to allocate
+	   const psExposure *exp	///< information about this exposure
+	   );
+
+
 /** a Chip: a collection of cells.  Not all valid cells in a chip need to be listed in an
  *  instance of psChip.
@@ -101,4 +167,11 @@
     struct psFPA *parentFPA;		///< FPA which contains this chip
 } psChip;
+
+/** Constructor */
+psChip *
+psChipAlloc(int nCells,			///< Number of Cells assigned
+	    psFPA *parentFPA		///< FPA which contains this chip
+	    );
+
 
 /** a Cell: a collection of readouts.
@@ -109,11 +182,16 @@
     struct psReadout *readouts;		///< Readouts from the cell
     psMetadata *md;			///< Cell-level metadata
-
     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
 } psCell;
+
+/** Constructor */
+psCell *
+psCellAlloc(int nReadouts,		///< number of readouts in this cell
+	    struct psChip *parentChip	///< chip which contains this cell
+	    );
+
 
 /** a Readout: a collection of pixels */
@@ -127,4 +205,11 @@
     
 
+/** Constructor */
+psReadout *
+psReadoutAlloc(int x0, int y0,		///< Offset from the lower-left corner of the physical device
+	       const psImage *image	///< imaging area of cell
+	       );
+
+
 /** Functions **************************************************************/
 /** \addtogroup AstroGroup Astronomy-Specific Utilities
@@ -280,18 +365,4 @@
 /*** Constructors / Destructors ******************************************************/
 
-/** Constructor */
-psExposure *
-psExposureAlloc(double ra, double dec,  ///< Telescope boresight
-                double ha,              ///< Hour angle
-                double zd,              ///< Zenith distance
-                double az,              ///< Azimuth
-                double lst,             ///< Local Sidereal Time
-                float mjd,              ///< MJD
-                float rotAngle,         ///< Rotator position angle
-                float temp,             ///< Temperature
-                float pressure,         ///< Pressure
-                float humidity,         ///< Relative humidity
-                float exptime)		///< Exposure time
-;
 
 /** Destructor */
